Phone Interview
Questions:
- Design LRU Cache: I used Ordered Dictionary in Python to do the implementations. The feedback was good.
Candidate's Approach
I implemented the LRU Cache using an Ordered Dictionary in Python, which allowed me to efficiently manage the cache's order and access.
Interviewer's Feedback
The feedback was positive.
Round 1
Questions: Given a list of people each with a preference of activities from the set [A, B, C, D, E], I had to divide them into teams of 5 people such that the maximum number of people got their preferences. Getting preference was not a requirement but a good situation to be in.
Candidate's Approach
I divided people into 5 buckets and assigned them to each team for each activity.
Interviewer's Feedback
The interviewer noted that I need to be more logical, improve code readability, and cover edge cases better, despite having dry run on the edge cases and examples shared.
Round 2
Questions: Given a list of cafes and the starting point for each friend and the list of adjacent points, we need to return the cafe that minimizes the maximum distance any friend has to travel to reach the cafe.
Candidate's Approach
I worked on a multi-source BFS approach, coded it, shared the output, and dry ran on the examples and edge cases.
Interviewer's Feedback
The feedback for this round was good.
Round 3
Questions: You are given a dump of logs with timestamps and names of people who became friends:
timestamp1, p1, p2 timestamp2, p2, p3 timestamp3, p3, p4 timestamp4, p5, p1
You need to tell the timestamp when everyone became friends.
Candidate's Approach
I treated the logs as edges for a graph with timestamps as weights and ran a union-find algorithm to determine the timestamp when everyone became friends. I wasn't able to optimize it beyond the usual implementation of union-find. I dry ran the solution on the example shared and offered the interviewer the opportunity to ask follow-up questions.
Interviewer's Feedback
The interviewer provided negative feedback, stating that I need to be more structured and logical, and mentioned that there was no time for the follow-up question.