Tip 1 : Revise all the coding interview questions that you have solved so far in the last few days
Tip 2 : Practice writing the codes on paper with clarity
Tip 3 : Mention only those thing that you know in your CV and revise your projects nd everything you have mentioned on your resume thoroughly.
Tip 1 : Do not even mention topics you have no idea about
Tip 2 : you should have some projects on resume and you should be able to explain clearly why you have chosen the particular project, what does it do, its functionality, outcomes and everything about each of the projects.
Tip 3 : Tailor your resume according to the needs/the role you are applying for
A 120-minute online test was conducted on HackerRank which had the following format:
1st Section :
2 Coding questions(30 minutes)
2nd Section :
10 MCQ questions(30 minutes)
3rd Section :
1 Advanced Programming Question(45 minutes)
4th Section :
2 Subjective Questions(15 minutes)
The coding questions and MCQ questions were a bit tricky so you need to manage your time properly and try to solve all the questions correctly..
Technical – included c and c++ output question, os(scheduling, semaphore), dbms(normal form, etc).



There are N people in a party, they might or might not know each other names.
There is a celebrity in the group, celebrity does not know anyone and all people know the celebrity.We can only ask questions like “does A know B?”. (Celebrity problem)
What is the worst case time complexity of the optimal solution to find the celebrity?
O(n)
Let’s say we ask “does A know B?”. If A knows B, A can not be a celebrity.If A does not know B then B can not be a celebrity. So after each question, we can reject one person. Thus we need to ask a maximum of n questions to correctly figure out the celebrity.
Approach: The idea is to use two pointers, one from start and one from the end. Assume the start person is A, and the end person is B. If A knows B, then A must not be the celebrity. Else, B must not be the celebrity. At the end of the loop, only one index will be left as a celebrity. Go through each person again and check whether this is the celebrity.
The Two Pointer approach can be used where two pointers can be assigned, one at the start and other at the end and the elements can be compared and the search space can be reduced.
Algorithm :
Create two indices a and b, where a = 0 and b = n-1
Run a loop until a is less than b.
Check if a knows b, then a can’t be celebrity. so increment a, i.e. a++
Else b cannot be celebrity, so decrement b, i.e. b–
Assign a as the celebrity
Run a loop from 0 to n-1 and find the count of persons who knows the celebrity and the number of people whom the celebrity knows. if the count of persons who knows the celebrity is n-1 and the count of people whom the celebrity knows is 0 then return the id of celebrity else return -1.
complexity analysis for this implementation:
Complexity Analysis:
Time Complexity: O(n).
Total number of comparisons 2(N-1), so the time complexity is O(n).
Space Complexity : O(1).
No extra space is required.



N = 9
‘9’ can be represented as:
2 + 3 + 4 = 9
4 + 5 = 9
The number of ways to represent ‘9’ as a sum of consecutive natural numbers is ‘2’. So, the answer is ‘2’.
1. The numbers used to represent ‘N’ should be natural numbers (Integers greater than equal to 1).
Suppose we start our summation series from 1 i.e. 1+2+3+…..
Max no. of numbers whose summation will be less than or equal to N: floor(X)
where X*(X+1)/2=N
So N as a sum of positive consecutive integers will at max consist of X numbers.
Here we can check each possibility k(assume) between 2 and X (both inclusive) and to check we can use the concept of A.P. as the summation series is an A.P whose sum is N.
We know the no. of term in A.P, n: k
Sum of A.P, S: N
Common difference, d: 1
We can easily calculate the first term a, using formula:
S=n/2*(2a + (n-1)d)
If a is an integer then N can be represented as a sum of k continuous integers, otherwise, it is not possible. Count the number of occurrences when a is an integer and that is our answer.
Time Complexity: Loop run X time which is O(sqrt(N)) and in each iteration, we take O(1) time. So overall time complexity is O(sqrt(N)).



Given array/list can contain duplicate elements.
(arr[i],arr[j]) and (arr[j],arr[i]) are considered same.
interview started with a typical tell me about yourself question. The interviewer was nice and friendly.
He asked me to explain a little about my projects (only basics).
Which all data structures you know and my favourite data structure. I replied with a linked list.
He asked the difference between array and linked list, time complexities of insertion, deletion, etc. in both of them. Then he asked about sorting an array, different algorithms, and their time complexities.
How would you sort a linked list? How would you find the middle of the linked list in one pass? How would you merge two linked lists (I had to write code for the same)?
Then he asked how would you be able to manage the business and finance decisions at GS.
Tell me an incident when you had the chance to display your leadership skills.
Lastly, I was allowed to ask questions from the interviewer.
Explain linked list and operations on linked list. (Learn)




4 and 7 are cousins of each other since they are at the same level and have different parents, 3 and 2 respectively.
intially a solution that finds whether given nodes are cousins or not by performing three traversals of binary tree has been discussed. next after asking for any different or optimal way to solve the same question by interviewer,
the approach to solve the problem by performing level order traversal is discussed . The idea was to use a queue to perform level order traversal, in which each queue element is a pair of node and parent of that node. For each node visited in level order traversal, check if that node is either first given node or second given node. If any node is found store parent of that node. While performing level order traversal, one level is traversed at a time. If both nodes are found in given level, then their parent values are compared to check if they are siblings or not. If one node is found in given level and another is not found, then given nodes are not cousins.
This round was relatively short and mostly consisted of coding (on hackerrank’s codepair platform)
The interviewer asked me about my previous interview and what all questions were asked in it.
Then there was a discussion about my projects and the technologies used in them. How would you deploy an application and what happens in the process of entering a keyword in the browser and loading your requested page?
He asked me to write the code for finding the middle of a linked list in one pass.
After that, I had to write the code for the implementation of a queue. I first discussed the approaches with him using array and linked lists for some time. They wrote the code using a linked list by taking head and tail pointer.
He was satisfied with it and the round ended with me asking him the questions I had.


1. If the list is empty, the function immediately returns None because there is no middle node to find.
2. If the list has only one node, then the only node in the list is trivially the middle node, and the function returns that node.
Traverse linked list using two pointers. Move one pointer by one and the other pointers by two. When the fast pointer reaches the end slow pointer will reach the middle of the linked list.
Explain queue. (Learn)

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