I got a referral from a friend at GS. After clearing the online assessment, there was an initial / screening round on Coderpad.
After more than a week of that, they scheduled the Superday wherein I was told that there would be 4 rounds back-to-back.
R1:
R2:
Given a list of 2n size. Let's say that the first half (0 to n-1 elements) of the array is a subarray A and the second half (n to 2n-1 elements) of the array is a subarray B. Shuffle the array such that it becomes like this: [A1, B1, A2, B2, A3, B3, ..., An-1, Bn-1]
I gave a solution which was using an extra array. The interviewer asked me to optimize it by using O(1) space.
Given a BST, find the Kth largest element from it.
I traversed the tree in this fashion: right -> root -> left and maintained a counter counting the no. of elements visited.When the counter hits K, current element will be returned.
As a follow-up, the interviewer asked me what if the tree is just a binary tree and not a BST. By the time, I could provide an optimized solution, the time was up.
R3:
This round was mostly revolved around my past experience and fundamentals. They asked me 1-2 questions regarding some common problems in system design:
R4:
This was the last round and was scheduled after I successfully cleared the previous rounds. All the questions were typical behavioral in nature and related to learnings from my current job.
After half an hour, I got a call from HR that I was selected.