Tip 1 : DSA is a must(arrays, linked list, stacks, queues, heaps are extremely imp)
Tip 2 : Quantitative Aptitude
Tip 3 : CS Fundamentals
Tip 1 : Mention only those which at which you are expert
Tip 2 : Mention 2-3 projects of different categories. Ex- Full stack development, ML based projects
This round consisted of MCQs that were divided into 2 sections. First was Aptitude. Other was CS Fundamentals.
A sum of money is to be distributed among A, B, C, D in the proportion of 5 : 2 : 4 : 3. If C gets Rs. 1000 more than D, what is B's share?
A alone can do a piece of work in 6 days and B alone in 8 days. They undertook to do it in 3200. With help of C they finished they completed it in 3 days. How much did they had to pay to C?
Consider a disk queue with requests for I/O to blocks on cylinders 47, 38, 121, 191, 87, 11, 92, 10. The C-LOOK scheduling algorithm is used. The head is initially at cylinder number 63, moving towards larger cylinder numbers on its servicing pass. The cylinders are numbered from 0 to 199. The total head movement (in number of cylinders) incurred while servicing these requests is______.
The total head movement incurred while servicing these requests:
= (87 – 63) + (92 - 87) + (121 - 92) + (191 - 121) + (191 – 10) + (11 – 10) + (38 - 11) + (47 - 38)
= 24 + 5 + 29 + 70 + 181 + 1 + 27 + 9
= 346 (in number of cylinders)
What is deadlock?
This round was taken early in the morning at 9 am.



1. Constructor:
It initializes the data members(queues) as required.
2. push(data) :
This function should take one argument of type integer. It pushes the element into the stack and returns nothing.
3. pop() :
It pops the element from the top of the stack and, in turn, returns the element being popped or deleted. In case the stack is empty, it returns -1.
4. top :
It returns the element being kept at the top of the stack. In case the stack is empty, it returns -1.
5. size() :
It returns the size of the stack at any given instance of time.
6. isEmpty() :
It returns a boolean value indicating whether the stack is empty or not.
Query-1(Denoted by an integer 1): Pushes an integer data to the stack. (push function)
Query-2(Denoted by an integer 2): Pops the data kept at the top of the stack and returns it to the caller. (pop function)
Query-3(Denoted by an integer 3): Fetches and returns the data being kept at the top of the stack but doesn't remove it, unlike the pop function. (top function)
Query-4(Denoted by an integer 4): Returns the current size of the stack. (size function)
Query-5(Denoted by an integer 5): Returns a boolean value denoting whether the stack is empty or not. (isEmpty function)
Operations:
1 5
1 10
2
3
4
Enqueue operation 1 5: We insert 5 at the back of the queue.
Queue: [5]
Enqueue operation 1 10: We insert 10 at the back of the queue.
Queue: [5, 10]
Dequeue operation 2: We remove the element from the front of the queue, which is 5, and print it.
Output: 5
Queue: [10]
Peek operation 3: We return the element present at the front of the queue, which is 10, without removing it.
Output: 10
Queue: [10]
IsEmpty operation 4: We check if the queue is empty.
Output: False
Queue: [10]
I told him that I can use two queues and make it work like stack. After that he asked me to code it while explaining the approach.
Asked me if I knew mutex. I said yes. He told me that I have been given a critical section protected with nested mutex. There was only one process in the system. It tries to enter the critical section. What will happen?
The answer is it will be deadlocked while entering into critical section. Process will perform one down operation on mutex and then will be blocked while performing other down. There is no other process in system so it will remain blocked.
Tip 1: you should have strong grip on topics like process, threads, process syncronization, deadlock, memory management etc.
Asked me about Virtual Functions and run time polymorphism. I was supposed to explain with real life example.
Tip :Revise oops topics like polymorphism, inheritance, constructors, destructions, virtual class, abstract class, virtual functions
He asked me three coding questions. For each question we had a almost 15-20 mins discussion.



Step - 1 : Verbally explained him a brute force approach.
I told that it could be solved by comparing all time pairs with every other time pair and incrementing count every time there is an overlap. Explained that it will be taking O(n^2) amount of time.
Interviewer - Can you optimise this approach?
Step - 2 : Explained him an efficient approach.
Told that I could sort the pairs using meeting start timings. It will take O(nlogn) time. After that in single iteration, I can count the number of timing overlaps. It will take O(n) time. So overall it will take O(nlogn) time.
Step - 3 : Wrote code for the efficient approach.



[2,3,4] - median is 3.
[2,3] - median is floor((2+3)/2) = 2.
Step - 1 : Explained a insertion sort approach. Told that every incoming integer could be placed at correct position using insertion sort. This means every insertion will take O(n) time. Hence overall it will take O(n^2) time.
Interviewer : Can you optimise your solution?
Step - 2: Though a bit. Then said maybe I could do it with heaps. After thinking a bit told him correct approach involving a min heap and a max heap. Explained the approach correctly. He did not ask me to code for it.



At this point, very less time was left. Interviewer asked me to directly give efficient approach.
Told him that both arrays could be individually sorted. After sorting I can check if before the next arrival will any train depart. If yes, then decrease count else increase count. The maximum value of count gives the minimum number of platforms required.
He asked me to write pseudo code for it. Wrote the code.
Basic Hr questions
tell me about myself
Asked me my hobbies/ what do I do in my free time.
Asked me about things mentioned in resume like I had mentioned that I am a classical singer, so she asked me about it.
She asked me if I was ok to relocate to a new city? I said yes.

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