Overall experience with the interview process was smooth and no delays from recruiters in relaying the information.
Took about a month from The first recruiter call to Onsite interview, having 2 weeks prep for each interview.
a. Generate a monarchy tree, given a person with their children, create a tree which represents the current monarchy, people die and are born at anytime, the tree should be printed correctly after each addition of a person implement the following methods
- personBorn(name, parentName)
- personDied(name) // if a person dies, they are removed from monarchy but their children are still considered monarchs.
A. (45 Mins Technical) Completely write Html and JS for creating a stopwatch on web. Exactly how google has it on its homepage.
Here I wrote the JS and HTML and used React as a framework to write this logic, this was fairly simple and completed this within 30 mins.
B. (45 mins Technical) Given an array , find the max sum of subarray of size N,
This was also fairly simple completed this with O(N) time solution within 30 Mins
eg: [1,14,4,5,2,5,77,12] , n = 3 , Ans = [5+77+12]
C. (45 Mins Technical) Given a set of intervals find if any intervals overlap.
eg: [[10:00,10:30],[10:45, 11:15],[11:00, 12:00]]
I solved this one with brute force , but was not optimum, the interviewer wanted to use a datastructue other than an array to represent the intervals which I could not come up with at the time.
Follow up question, how to properly insert a new interval to the array.
D. (45 mins Design) , Design a Friends of friend function for A image sharing social network with 500M users.
this question was way to open ended without any intial information, the interviewer did try to guide me and made me ask correct questions. But I felt I had made sufficient asumptions and justification to come up with my design.
I made a simple server architecture with redis cache layer and relational db
The interviewer wanted more details like, how much server load or request can be handled by each server and are DB / Caching capable of handling so many requests, he wanted exact numbers so I just gave him some assumptions from my experience architecting similar infrastructure before.
E. (45 min technical) There was one more question about sorted array and finding something in sorted array,can’t remember this one.
I solved this using Binary search of the sorted array, this was also very simple and took me about 30 mins.
F. (45 Min behaviour) Asked question about conflicts in teams and resolving conflicts in team, The interviewer didnt seem interested and after a while we started a tangent discussion on the experiences I had and similar experiences he also had with the conflict questions. This seemed like a friendly chat.
In all truth the interview went very well and I was excited that I nailed it, but unfortunately looking at things retroactively I feel the interviewers didnt look for a solution but an elegant solution.
I feel like I might have messed up 2 interviews , this was also relayed to me by the recruiter.
My brute force method for the Intervals question (Question C above) was something the interviewer didnt like.
The open endedness of the design question threw me off, it was very open ended and the interviewer wanted exact numbers to be calculated on the spot.
I opted for writing my code on white board and did most of the coding on white board, now the problem with white boarding is there is no cut copy paste, so the code afterawhile will start to look jumbled and some asumptions you made earlier could not be clear to the interviewer.
The interviewers where writing in the chrome book what I was writing on the white board, and so obviously it wont compile because I am just writing my approach as much as syntactically correct as possible.
The interviewers were paying attention to the undeclared variables and unused variables in my code.
I would suggest don’t hurry up and write clean and organised code even if on white board.