Background: 1.5 years of Experience at a customer based company, Btech+Ms in CS from Tier-1 college.
Level: SDE (Analyst)
Type: Online
Applied through refferal from one of my friend at the firm.
Round: 1 (HackerRank)
Two questions in 1.5 hrs:
1 easy (mathematical formula based)
1 medium (DP based): total increasing subsequence of size 'k'.
solved both in 15-20 mins.
Round: 2 (Coderpad + telephonic)
Two Questions in 1 hrs:
1. Maximum water trap (https://leetcode.com/problems/trapping-rain-water/), did this the tough way with stack, there was an easier method too which I came to know later.
2. Maximum tree size in a forest (Given a set of disjoint graphs, had to find the graph with the maximum number of nodes. Output: return the size of the maximum graph.) Did with BFS on all nodes, while keeping track which all are visited.
Cleared both with all the test cases, within the time allotted, discussed work-life and other things at GS.
Round: 3 (Face2Face over Zoom): 1 Hour
Two interviewers were there, both asked 2-2 questions
1. Sort an array with given 2 APIs
- to get the max of the array (index of the max)
- to reverse array from 0 to "i" (given input as i)
2. O(1) complexity method to get minimum in a stream of numbers, where push and pop are allowed. (used stack of pair to keep track of min at each point)
3. Creating K-stacks with using a single array of a specific given size. (took some time and hints from the interviewer to come up with the best solution)
4. Check if a tree is valid or not. (check for back-edge, cycle, and other simple checks)
Wasn't asked to code any of the questions, but a good discussion on all the question was there. With complexity (space/time) and other relevant data structures and their internal workings.
For me it went good, maybe a bit below good because of the 3rd question, but had another round in half an hour, so no time to think much.
Round: 4 (Face2Face over Zoom): 1 Hr
Two interviewers were there, they asked a total of 3 questions after a brief intro about the team they were from and about my current work.
Here I got to know which team I was kind of interviewing for.
1. A variation of a queue of limited size to process transactions in a given time limit. (discussed the best way and later he hinted circular queue will be a good option to use here, though he was satisfied by my normal queue approach too.)
2. LRU cache, it was asked quite differently, but with discussion, it came out to be an LRU only.
3. Search if an element is present in a sorted but rotated array. (I told him the standard binary search approach with a bit of tweaking such that at each call one half will be rejected based on the values of mid, he wasn't convinced this will work with rotated as well, I showed some test cases and dry run, he seemed impressed.)These all questions were discussed and wasn't asked to write code of any, but I was confident enough if asked I can write those easily.
This round went well above good, so overall I was positive till here for the process to proceed forward.
Loooonnggggg wait of 3 MONTHS :(
Round: 5 (Face2Face over Zoom) : 1 Hr
Two interviewers were there, after a brief intro about the team they were from and about my current work they started with coding questions:
1. Designing a data structure to do the below operations in O(1):
- Insert
- Remove
- getRandom(): to get a random entry from the array.
- I solved this with using a map to store number and it's index in an array. used "rand()%size_of_array" to get a random value from the array.
2. 1st unique character in a long string with only 26 chars, with any possible chars.
- follow-up: if the string is very long, using multithreading how can we do it.
- solved for both ways, simple and multithreaded.Here I was asked to write code and they did a quick dry-run of the code. the multithread part was limited to discussion only, wasn't asked to write it's code.
After these the other interviewer took over, he started questions from all CS subjects.
- Types of storage in c++.
- Integer vs int in Java.
- what do you understand by memory leak?
- Memory leak happens in which memory? stack or heap?
- TCP vs UDP
- Debuggers, and how they help.
- Garbage collection.
- My project discussion, and some in-depth development-related questions from my project.
Overall was good, just wasn't very confident in the CS questions. The interviewers were quite friendly and helpful though so that indeed helped.
Round: 6 (Face2Face over Zoom): 1 Hr.
This was with two interviewers from London and New York, (I thought this was kind of Hiring manager round, so naive me :p)
First I discussed my work and the tech have worked on, then he asked why from a research profile to an SDE/Analyst profile?
There were total of 2 questions asked, asked to code one of those.
1. Number of unique paths from top left to bottom right (down/right movement allowed), DP with mXn space, then space-optimized with only O(n)space (n: the size of a row)
Follow-up question: if diagonally down is also allowed. standard and then Space optimized approach.
Then he told about the global team he leads over different offices around the globe and the kind of work an analyst profile employee is expected to work on.
2. This was a tricky question: Find the XOR of all the bits of a number: I told O(n) complexity approach. "n: number of bits of a number".
- followup: can we optimize it, I tried many but I could not come up with anything less than O(n).
- then he told we can do this in O(lon(n)), so I thought it might be either binary search or Binary tree-based, turned out it was none.
The interview concluded with my tree approach as he seemed confused how tree approach is working in the first place, but later I realised it was O(n) only.
- There is some trick to solve this one, I never have read/seen before so I was not much worried about that.Special Round: 7: Offline exercise (3 Hrs)
It was a tiring and stretched interview process indeed took around 5-6 months. At last, everything feels worth it.