Round 1 Coding
Questions: Very abstract question statement on LeetCode - Capacity to Ship Packages Within D Days.
Candidate's Approach
The interviewer was really helpful. Overall, he was happy with the approach and solution.
Interviewer's Feedback
Overall positive feedback; the interviewer was happy with the approach and solution.
Round 2 Practical Coding
Questions: Implement a dynamic price sharing module which takes in calculates factors such as distance, surge pricing, night ride, etc.
Candidate's Approach
Was aware of the question and answered.
Interviewer's Feedback
No feedback provided.
Round 3 HLD
Questions: Given Entities as below:
- Client => A tenant on the system
- User => A user of a particular client
- Segment => A subset of users from all users of a client
Where total Clients = C
Where each Client has up to U Users
Where each Client has up to S UserSegments
Each User can belong to more than 1 UserSegment.
Design an API that satisfies the below requirements:
- Given multiple (ClientID, UserSegmentID, UserID) tuples per API request, return true/false based on if the UserId belongs to that UserSegmentId or not, for each tuple.
- Assume that queries are all valid (ClientId exists, UserSegmentId exists and belongs to the respective ClientId only).
Tip: Pick something that you are comfortable diving deep on, when it comes to storage.
- No of clients - 10,000
- No of users per client - 5 million
- Number of segments per client - 100
Candidate's Approach
Came up with precomputing everything and storing inside Redis with tuple as a key. Discussed about sharding based on client id, problem arising when more shards being added. Went with consistent hashing approach. The interviewer pointed out storage cache being used, went with segregating clientId:userSegmentId and userSegmentId:userId being a second key, and have two lookups. The interviewer was not giving any hints.
Interviewer's Feedback
No feedback provided.