Mock Interview
Questions: I was asked a Maximal Square (DP) question.
Candidate's Approach
I was able to solve the question easily as I had solved it on Leetcode before.
Interviewer's Feedback
The interviewer gave positive feedback during the mock interview, stating that I did very well and was ready for the Phone Screen and Onsites. She suggested covering edge cases and improving variable and function names.
Phone Screen
Questions: I was asked a Binary Tree question where there are weights on edges between nodes, and I was supposed to find the minimum cost to cut all the leaf nodes from the root.
Candidate's Approach
I was able to solve the DP question successfully.
Interviewer's Feedback
The feedback was positive.
Onsite-1
Questions: I was given a List of Booking Records from last year.
class Records { int id; int startTime; int endTime; }
I was supposed to return a List of Assignments of cars such that I use a minimum number of cars to fulfill all the booking requests.
class Assignment { int carID; int recordID; }
Candidate's Approach
I sorted the records on startTime and used a min-heap to find the earliest car that would be able to finish the request based on endTime.
Interviewer's Feedback
The feedback was positive. The interviewer followed up by asking to return the minimum number of cars instead of assignments.
Onsite-2
Questions: I was given a list of messages.
class Message { String content; int receivedTime; }
I should return a list of messages which shouldn’t contain any duplicate messages within 10 seconds after the first message is received (the first message can be present in the list).
Candidate's Approach
I used a HashMap to keep track of the lastTimeReceived for any message and used that to compare the next messages.
Interviewer's Feedback
The feedback was positive. The interviewer followed up by asking to remove all duplicates within 10 seconds, including the first message.
Onsite-3
Questions: Interviewer asked me this question: Number of Closed Islands. The only difference was that he used '.' & 'x' instead of 0 and 1 to denote water and land.
Candidate's Approach
I was able to solve it using BFS, as I had seen the question before. I explained the entire code with a dry run.
Interviewer's Feedback
The feedback was negative, stating that I didn’t cover all the cases, which led to losing the offer.