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.
This was a written test with 50 Objective type questions.
This was a technical round with questions on DSA and OOPS.
What is AVL Tree?
AVL tree is a self-balancing Binary Search Tree (BST) where the difference between heights of left and right subtrees cannot be more than one for all nodes.
Why is the time complexity of Binary Search O(Logn)?
Let say the iteration in Binary Search terminates after k iterations.
At each iteration, the array is divided by half. So let’s say the length of array at any iteration is n
At Iteration 1 :
Length of array = n
At Iteration 2 :
Length of array = n⁄2
At Iteration 3:
Length of array = (n⁄2)⁄2 = n⁄22
Therefore, after Iteration k :
Length of array = n⁄2k
Also, we know that after
After k iterations, the length of array becomes 1. Therefore ,
Length of array = n⁄2k=1
=> n = 2k
Applying log function on both sides:
=> log2 (n) = log2 (2k)
=> log2 (n) = k log2 (2)
As (loga (a) = 1)
Therefore, => k = log2 (n)



a) push(int x) : 'x' has to be inserted in the priority queue. This has been implemented already
b) pop() : return the maximum element in the priority queue, if priority queue is empty then return '-1'.
We perform the following operations on an empty priority queue:
When operation push(5) is performed, we insert 1 in the priority queue.
When operation push(2) is performed, we insert 2 in the priority queue.
When operation pop() is performed, we remove the maximum element from the priority queue and print which is 5.
When operation push(3) is performed, we insert 1 in the priority queue.
When operation pop() is performed, we remove the maximum element from the priority queue and print which is 3.
Priority Queues can be implemented using common data structures like arrays, linked-lists, heaps and binary trees. Here we are using a linked list.
The list is built up in such a way that the element with the highest priority is always at the top. The elements are listed in descending order of priority in the list. This allows us to remove the element with the highest priority in O(1) time. To insert an element, we must scan the list and identify the appropriate location in which to place the node so that the priority queue's overall order is maintained.
Algorithm :
PUSH(HEAD, DATA, PRIORITY)
Step 1: Create new node with DATA and PRIORITY
Step 2: Check if HEAD has lower priority. If true follow Steps 3-4 and end. Else goto Step 5.
Step 3: NEW -> NEXT = HEAD
Step 4: HEAD = NEW
Step 5: Set TEMP to head of the list
Step 6: While TEMP -> NEXT != NULL and TEMP -> NEXT -> PRIORITY > PRIORITY
Step 7: TEMP = TEMP -> NEXT
[END OF LOOP]
Step 8: NEW -> NEXT = TEMP -> NEXT
Step 9: TEMP -> NEXT = NEW
Step 10: End
POP(HEAD)
Step 2: Set the head of the list to the next node in the list. HEAD = HEAD -> NEXT.
Step 3: Free the node at the head of the list
Step 4: End
PEEK(HEAD):
Step 1: Return HEAD -> DATA
Step 2: End



Algorithm :
1. Declare a variable to store the sum and set it to 0
2. Repeat the next two steps till the number is not 0
3. Get the rightmost digit of the number with help of the remainder ‘%’ operator by dividing it by 10 and add it to sum.
4. Divide the number by 10 with help of ‘/’ operator to remove the rightmost digit.
5. Return the sum
Difference between Hashmap and Hashset
1. Hash Set implements Set interface while hash map implements Map interface .
2. No duplicates allowed in hash set. In hash map, duplicates values are allowed but no duplicate key is allowed
3. Only 1 Object is required during an add operation for hash set while 2 objects are required for hash map.
4. Hash set uses a hash map object for adding and storing mechanism while hashmap uses a hashing technique.
5. Hash set is comparatively slower than HashMap
Difference between Abstract Class and Interface
1) Abstract class can have abstract and non-abstract methods. Interface can have only abstract methods. Since Java 8, it can have default and static methods also.
2) Abstract class doesn't support multiple inheritance. Interface supports multiple inheritance.
3) Abstract class can have final, non-final, static and non-static variables. Interface has only static and final variables.
4) Abstract class can provide the implementation of interface. Interface can't provide the implementation of abstract class.
5) The abstract keyword is used to declare abstract class. The interface keyword is used to declare interface.
6) An abstract class can extend another Java class and implement multiple Java interfaces. An interface can extend another Java interface only.
Why are virtual destructors needed?
Virtual destructors in C++ are used to avoid memory leaks especially when your class contains unmanaged code, i.e., contains pointers or object handles to files, databases or other external objects. A destructor can be virtual.
This was a technical round with questions on OS and OOPS. A design question was also discussed.
What is Round Robin Algorithm?
In Round-robin scheduling, each ready task runs turn by turn only in a cyclic queue for a limited time slice. This algorithm also offers starvation free execution of processes.
The name of this algorithm comes from the round-robin principle, where each person gets an equal share of something in turns. It is the oldest, simplest scheduling algorithm, which is mostly used for multitasking.
Build a system where people subscribe to a particular topic . And if any message is posted regarding the particular topic then the people who have subscribed to that system must get the message
Tip 1: Firstly, remember that the system design round is extremely open-ended and there’s no such thing as a standard answer. Even for the same question, you’ll have a totally different discussion with different interviewers.
Tip 2: Before you jump into the solution always clarify all the assumptions you’re making at the beginning of the interview. Ask questions to identify the scope of the system. This will clear the initial doubt, and you will get to know what are the specific detail interviewer wants to consider in this service.
Tip 3: Design your structure and functions according to the requirements and try to convey your thoughts properly to the interviewer so that you do not mess up while implementing the idea .
How is memory allocation done in recursion?
When a function is called, its memory is allocated on a stack. Stacks in computing architectures are the regions of memory where data is added or removed in a last-in-first-out (LIFO) process. Each program has a reserved region of memory referred to as its stack. When a function executes, it adds its state data to the top of the stack. When the function exits, this data is removed from the stack.
Why are threads needed ?
It takes far less time to create a new thread in an existing process than to create a new process.
Threads can share the common data, they do not need to use Inter- Process communication.
Context switching is faster when working with threads.
It takes less time to terminate a thread than a process.
This was a group activity round.
Here, they gave us some wooden blocks and crayons and asked us to make a logo for Morgan Stanley and prepare a slogan individually which shows the technological development of MS with collaboration with Clients .
HR round with typical behavioral problems.
Q1. Projects which I did in the academic years .
Q2. Then he asked me that your idea was not brought into the group activity but still you said you will be the leader and How would I accept it ?
Q3. Then he asked whom will you eliminate from that group?
Q4. Questions based on Resume
Tip 1 : The cross questioning can go intense some time, think before you speak.
Tip 2 : Be open minded and answer whatever you are thinking, in these rounds I feel it is important to have opinion.
Tip 3 : Context of questions can be switched, pay attention to the details. It is okay to ask questions in these round, like what are the projects currently the company is investing, which team you are mentoring. How all is the work environment etc.

Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
How do you remove whitespace from the start of a string?