Tip 1 : practice previous questions
Tip 2 : attend mock interviews
Tip 3 : make your resume with good projects
Tip 1 : make it short and attractive
Tip 2 : mention only your top 2 or 3 projects
It was a proctored test. i was given a week to attempt it after that the link would expire. it consisted of 3 coding questions.



Let’s say ‘N’ is 4 and ‘M' is 3. The 3 edges are (1,2), (2,3) and (1,3). Then our graph will look as follows:-

To make the graph connected we can shift the edge between (1,3) to (1,4). This operation will make the graph connected. There are multiple ways in which we can make graph connected. So, in this case, we can make graph connected in just one operation.
1. A connected graph is a graph that is connected in the sense of a topological space, i.e., there is a path from any vertex to any other vertex in the graph.
2. There are no repeated edges and self-loops in the graph.
3. You do not need to print anything; it has already been taken care of. Just implement the function.
We need at least n - 1 cables to connect all nodes (like a tree).
If connections.size() < n - 1, we can directly return -1.
One trick is that, if we have enough cables,
we don't need to worry about where we can get the cable from.
We only need to count the number of connected networks.
To connect two unconneccted networks, we need to set one cable.
The number of operations we need = the number of connected networks - 1



We will use two variables to represent the states of DP.
‘i’ – The current index we are working on.
‘R’ – It contains the remaining capacity of each and every knapsack.
Now, how will a single variable store the remaining capacity of every knapsack?
For that, we will initialise ‘R’ as R = C + C*(C+1) + C*(C+1)^2 + C*(C+1)^3 ..+ C*(C+1)^(k-1)
This initialises all the ‘k’ knapsacks with capacity ‘C’.
Now, we need to perform two queries:
Reading remaining space of jth knapsack: (r/(c+1)^(j-1))%(c+1).
Decreasing remaining space of jth knapsack by x: set r = r – x*(c+1)^(j-1).
Now, at each step, we will have k+1 choices.
Reject index ‘i’.
Put item ‘i’ in knapsack 1.
Put item ‘i’ in knapsack 2.
Put item ‘i’ in knapsack 3.
We will choose the path that maximizes the result.



This round was conducted on google meet. The interviewer was very helpful and lead a discussion into thought processes/diff approaches. Both questions are online but both were framed differently.



Input: 'list' = [1, 2, 3, 4], 'k' = 2
Output: 2 1 4 3
Explanation:
We have to reverse the given list 'k' at a time, which is 2 in this case. So we reverse the first 2 elements then the next 2 elements, giving us 2->1->4->3.
All the node values will be distinct.
Create a dummy node and point it to the head of input i.e dummy->next = head.
Calculate the length of the linked list which takes O(N) time, where N is the length of the linked list.
Initialize three-pointers prev, curr, next to reverse k elements for every group.
Iterate over the linked lists till next!=NULL.
Points curr to the prev->next and next to the curr next.
Then, Using the inner for loop reverse the particular group using these four steps:\
curr->next = next->next
next->next = prev->next
prev->next = next
next = curr->next
This for loop runs for k-1 times for all groups except the last remaining element, for the last remaining element it runs for the remaining length of the linked list – 1.
Decrement count after for loop by k count -= k, to determine the length of the remaining linked list.
Change prev position to curr, prev = curr.



dfs all the nodes of the tree, each node return two number, int[] num, num[0] is the max value while rob this node, num[1] is max value while not rob this value. Current node return value only depend on its children's value. Transform function should be very easy to understand.
It was a system design round taken by a senior engineer on google meet
Design an Uber booking system where Uber drivers constantly update their location and app users can make a booking and get the closest drivers.
I was given around 25 minutes to identify the various entities involved in the system, establish the relationships between these entities and also identify the primary key - foreign key constraints. After 25 minutes, we had a good discussion on my findings and corrections with respect to certain attributes I may have missed out on in my design.
A few complex SQL queries were also asked related to the above schemas.
Unfortunately After this round i did not a get follow up from HR. so i assume that i was rejected.
Tip 1 : Requirements clarifications. ask the interviewer about the requirements before going to a solution
Tip 2 : Have justifications for the points you make
Tip 3 : Be aware of the current solutions and tech practices

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?