Tip 1 : Solve 20 questions of each data structure of each level
Tip 2 : Participate in online contests
Tip 3 : Practice dry run of code
Tip 1 : Crisp and 1 page resume
Tip 2 : Mention your coding profiles
Tip 3 : Highlight your achievements and internships
It was a online test comprised of 30 aptitude based mcq's + 2 coding questions to be done in 1.5 hr on hackerrank platform



Step 1: Compute in-degree (number of incoming edges) for each of the vertex present in the graph and initialize the count of visited nodes as 0.
Step 2 : Pick all the vertices with in-degree as 0 and add them into a queue (Enqueue operation)
Step 3 : Remove a vertex from the queue (Dequeue operation) and then.
Increment count of visited nodes by 1.
Decrease in-degree by 1 for all its neighbouring nodes.
If in-degree of a neighbouring nodes is reduced to zero, then add it to the queue.
Step 4 : Repeat Step 3 until the queue is empty.
Step 5 : If count of visited nodes is not equal to the number of nodes in the graph has cycle, otherwise not.



1. Every train will depart on the same day and the departure time will always be greater than the arrival time. For example, A train with arrival time 2240 and departure time 1930 is not possible.
2. Time will be given in 24H format and colons will be omitted for convenience. For example, 9:05AM will be given as "905", or 9:10PM will be given as "2110".
3. Also, there will be no leading zeroes in the given times. For example, 12:10AM will be given as “10” and not as “0010”.
Firstly I started with naive approach -
Step1 : The idea is to take every interval one by one and find the number of intervals that overlap with it. Keep track of the maximum number of intervals that overlap with an interval. Finally, return the maximum value.
Then it did not pass all the cases
Step2 : Then I tried to do it with O(n) .The idea is to consider all events in sorted order. Once the events are in sorted order, trace the number of trains at any time keeping track of trains that have arrived, but not departed.
A coding question along with questions of OS were asked. It was a easy round



It is possible for Mr. X to rob the same amount of money by looting two different sets of houses. Just print the maximum possible robbed amount, irrespective of sets of houses robbed.
(i) Given the input array arr[] = {2, 3, 2} the output will be 3 because Mr X cannot rob house 1 (money = 2) and then rob house 3 (money = 2), because they are adjacent houses. So, he’ll rob only house 2 (money = 3)
(ii) Given the input array arr[] = {1, 2, 3, 1} the output will be 4 because Mr X rob house 1 (money = 1) and then rob house 3 (money = 3).
(iii) Given the input array arr[] = {0} the output will be 0 because Mr. X has got nothing to rob.
Step 1 : As I had already done the problem so solved it in 5 min, then interviewer changed the problem to like the thief cannot stole from adjacent n houses
Step2 : So I just replaced a[i-1] with a[i-n] and rest of the code remains same.
Tip 1 : Go through concepts of OS
Tip 2 : Take help from internet to study about the most asked OS interview questions
1 coding questions of moderate level was asked. Interviewer gave us enough time
After that a famous puzzle to find age of daughters was asked



A book will be allocated to exactly one ninja.
At least one book has to be allocated to a ninja.
Allotment of the books should be done in a contiguous manner. For example, a ninja can not be allocated book 2 and book 4, skipping book 3.
The idea is to use Binary Search.I fixed a value for the number of pages as mid of current minimum and maximum. I initialized minimum and maximum as 0 and sum-of-all-pages respectively. If a current mid can be a solution, then I will search on the lower half, else we search in higher half.Step 1- First
Find ages of daughters
Alok has three daughters. His friend Shyam wants to know the ages of his daughters. Alok gives him first hint.
1) The product of their ages is 72.
Shyam says this is not enough information Alok gives him a second hint.
2) The sum of their ages is equal to my house number.
Shyam goes out and looks at the house number and tells “I still do not have enough information to determine the ages”.
Alok admits that Shyam can not guess and gives him the third hint
3) The oldest girl likes strawberry ice cream.
Shyam is able to guess after the third hint. Can you guess what are the ages of the three daughters?
Tip 1 : Listen to the problem patiently
Tip 2 : Think for some moment before replying
Tip 1 : Stay calm
Tip 2 : Never lie in front of HR
Tip 3 : Show a positive attitude to join the organisation

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?