Tip 1 : Must do Previously asked Interview as well as Online Test Questions.
Tip 2 : Go through all the previous interview experiences from Codestudio and Leetcode.
Tip 3 : Do at-least 2 good projects and you must know every bit of them.
Tip 1 : Have at-least 2 good projects explained in short with all important points covered.
Tip 2 : Every skill must be mentioned.
Tip 3 : Focus on skills, projects and experiences more.
It was on online objective test consisting of 4 sections: Aptitude, Technical MCQs, Code snippet based MCQs and Coding part.



'S' = "{}()".
There is always an opening brace before a closing brace i.e. '{' before '}', '(' before ').
So the 'S' is Balanced.
A stack can be used to solve this question.
We traverse the given string s and if we:
1. see open bracket we put it to stack
2. see closed bracket, then it must be equal to bracket in the top of our stack, so we check it and if it is true, we remove this pair of brackets.
3. In the end, if and only if we have empty stack, we have valid string.
Complexity: time complexity is O(n): we put and pop each element of string from our stack only once.
Space complexity is O(n).


The given linked list is 1 -> 2 -> 3 -> 2-> 1-> NULL.
It is a palindrome linked list because the given linked list has the same order of elements when traversed forwards and backward.
Can you solve the problem in O(N) time complexity and O(1) space complexity iteratively?
A simple approach could be to use a stack. Traverse the given list and push all the nodes to a stack. Now, Traverse the list again. For every visited node, pop the topmost node from the stack and compare data of popped node with the currently visited node. If all nodes match, then the linked list is a palindrome.
Time Complexity : O(N)
Auxiliary Space : O(N)
A better approach would be to reverse the second half of the list. Get the middle of the linked list and reverse the second half of the linked list.
Next, Check if the first half and second half are identical. If they are identical, return true.
Time Complexity : O(N)
Auxiliary Space : O(1)
This was a technical and managerial round. The interviewer gave me a situation where I am in testing team and I found that customer requirement was drop down list at a place but developer has used bullet selection, and is not ready to change it. How will you manage? I gave some good replies and he was convinced.
There are 25 horses among which you need to find out the fastest 3 horses. You can conduct race among at most 5 to find out their relative speed. At no point you can find out the actual speed of the horse in a race. Find out the minimum no. of races which are required to get the top 3 horses.
Make group of 5 horses and run 5 races. Suppose five groups are a,b,c,d,e and next alphabet is its individual rank in tis group(of 5 horses).for eg. d3 means horse in group d and has rank 3rd in his group. [ 5 RACES DONE ]
a1 b1 c1 d1 e1
a2 b2 c2 d2 e2
a3 b3 c3 d3 e3
a4 b4 c4 d4 e4
a5 b5 c5 d5 e5
Now make a race of (a1,b1,c1,d1,e1).[RACE 6 DONE] suppose result is a1>b1>c1>d1>e1
which implies a1 must be FIRST.
b1 and c1 MAY BE(but not must be) 2nd and 3rd.
FOR II position, horse will be either b1 or a2
(we have to find top 3 horse therefore we choose horses b1,b2,a2,a3,c1 do racing among them [RACE 7 DONE].
The only possibilities are :
c1 may be third
b1 may be second or third
b2 may be third
a2 may be second or third
a3 may be third
The final result will give ANSWER. suppose result is a2>a3>b1>c1>b2
then answer is a1,a2,a3,b1,c1.
Hence answer is 7 races.
What is a virtual function?
A C++ virtual function is a member function in the base class that you redefine in a derived class. It is declared using the virtual keyword. It is used to tell the compiler to perform dynamic linkage or late binding on the function. A 'virtual' is a keyword preceding the normal declaration of a function. When the function is made virtual, C++ determines which function is to be invoked at the runtime based on the type of the object pointed by the base class pointer.


Level order traversal in spiral form
To print the nodes in spiral order, nodes at different levels should be printed in alternating order. An additional Boolean variable ltr is used to change printing order of levels. If ltr is 1 then printGivenLevel() prints nodes from left to right else from right to left. Value of ltr is flipped in each iteration to change the order.
Function to print level order traversal of tree :
printSpiral(tree)
bool ltr = 0;
for d = 1 to height(tree):
printGivenLevel(tree, d, ltr);
ltr ~= ltr /*flip ltr*/
Function to print all nodes at a given level :
printGivenLevel(tree, level, ltr) :
if tree is NULL then return;
if level is 1, then
print(tree->data);
else if level greater than 1, then
if(ltr) :
printGivenLevel(tree->left, level-1, ltr);
printGivenLevel(tree->right, level-1, ltr);
else :
printGivenLevel(tree->right, level-1, ltr);
printGivenLevel(tree->left, level-1, ltr);What are abstract classes in C++?
An abstract class in C++ is a class that has at least one pure virtual function (i.e., a function that has no definition). The classes inheriting the abstract class must provide a definition for the pure virtual function; otherwise, the subclass would become an abstract class itself. Abstract classes are essential to providing an abstraction to the code to make it reusable and extendable.
This was also a technical round. He asked to optimize the code I wrote in coding round. Then he asked me a few puzzles and questions on OOPS, OS and DBMS.
Given two candles. Each of them burns for one hour. They burn unevenly in different parts though. In addition, let’s have a box of matches. Measure 45 minutes and 15 minutes.
Step1: Both ends of the first candle should be lit, but only one end of the second candle should be lit. After the first candle has burned fully in 30 minutes, the remaining time is 30 minutes to burn the other candle with one end unburned.
Step2: Now lit both the ends of the 30-min(remaining) length of candle 2, it will burn in 15 minutes. Now let’s have a look at the solution candle-wise.
Candle1: The first candle is lit from the end, So it will be completely burned in 30 minutes.
Candle2: After 30 minutes, the two candles will be half burned. Now, let’s lit the second end also and candle 2 will be burned completely in 15 minutes.
Explain the ACID properties.
Atomicity :
By this, we mean that either the entire transaction takes place at once or doesn’t happen at all. There is no midway i.e. transactions do not occur partially. Each transaction is considered as one unit and either runs to completion or is not executed at all. It involves the following two operations.
—Abort: If a transaction aborts, changes made to database are not visible.
—Commit: If a transaction commits, changes made are visible.
Atomicity is also known as the ‘All or nothing rule’.
Consistency :
This means that integrity constraints must be maintained so that the database is consistent before and after the transaction. It refers to the correctness of a database. Referring to the example above,
Isolation :
This property ensures that multiple transactions can occur concurrently without leading to the inconsistency of database state. Transactions occur independently without interference. Changes occurring in a particular transaction will not be visible to any other transaction until that particular change in that transaction is written to memory or has been committed. This property ensures that the execution of transactions concurrently will result in a state that is equivalent to a state achieved these were executed serially in some order.
Durability :
This property ensures that once the transaction has completed execution, the updates and modifications to the database are stored in and written to disk and they persist even if a system failure occurs. These updates now become permanent and are stored in non-volatile memory. The effects of the transaction, thus, are never lost.
What is Paging and Segmentation?
Paging is a method or techniques which is used for non-contiguous memory allocation. It is a fixed size partitioning theme (scheme). In paging, both main memory and secondary memory are divided into equal fixed size partitions. The partitions of secondary memory area unit and main memory area unit known as as pages and frames respectively.
Segmentation is another non-contiguous memory allocation scheme like paging. like paging, in segmentation, process isn’t divided indiscriminately into mounted(fixed) size pages. It is variable size partitioning theme. like paging, in segmentation, secondary and main memory are not divided into partitions of equal size. The partitions of secondary memory area unit known as as segments. The details concerning every segment are hold in a table known as as segmentation table. Segment table contains two main data concerning segment, one is Base, which is the bottom address of the segment and another is Limit, which is the length of the segment.
What is concurrency control?
Concurrency Control: The process of managing the simultaneous execution of transactions in a shared database, is known as concurrency control. Basically, concurrency control ensures that correct results for concurrent operations are generated, while getting those results as quickly as possible.
Difference between String Buffer and String Builder
1. StringBuffer is synchronized i.e. thread safe. It means two threads can't call the methods of StringBuffer simultaneously. StringBuilder is non-synchronized i.e. not thread safe. It means two threads can call the methods of StringBuilder simultaneously.
2) StringBuffer is less efficient than StringBuilder. StringBuilder is more efficient than StringBuffer.
3) StringBuffer was introduced in Java 1.0. StringBuilder was introduced in Java 1.5
What are smart pointers?
A Smart Pointer is a wrapper class over a pointer with an operator like * and -> overloaded. The objects of the smart pointer class look like normal pointers. But, unlike Normal Pointers it can deallocate and free destroyed object memory. The idea is to take a class with a pointer, destructor and overloaded operators like * and ->. Since the destructor is automatically called when an object goes out of scope, the dynamically allocated memory would automatically be deleted (or reference count can be decremented).
A shop sells chocolates @ Re.1 each. You can exchange 3 wrappers for 1 chocolate. If you have Rs.15/- how many chocolates can you get totally?
For 15 rupees you get 15 chocolates.
On returning 15 wrappers you get 5 chocolates.
On returning 3 wrappers (keeping two wrappers in hand) you get 1 chocolate.
Now this one chocolate. wrapper and the twp wrapers you had will add on three.
Atlast on returning 3 wrappers you get 1 chocolate.
i.e., 15+5+1+1 = 22 chocolates.
Difference between Mutex and Semaphore
1. Mutex uses a locking mechanism i.e. if a process wants to use a resource then it locks the resource, uses it and then release it. But on the other hand, semaphore uses a signalling mechanism where wait() and signal() methods are used to show if a process is releasing a resource or taking a resource.
2. A mutex is an object but semaphore is an integer variable.
3. In semaphore, we have wait() and signal() functions. But in mutex, there is no such function.
4. A mutex object allows multiple process threads to access a single shared resource but only one at a time. On the other hand, semaphore allows multiple process threads to access the finite instance of the resource until available.
In mutex, the lock can be acquired and released by the same process at a time. But the value of the semaphore variable can be modified by any process that needs some resource but only one process can change the value at a time.

Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
What is recursion?