Round 1
Questions:
The interviewer asked about databases, covering topics such as:
- SQL vs NoSQL
- Indexing: Why is it done? Is it needed for read-heavy systems or write-heavy?
- Sharding and Partitioning: Why is sharding needed?
- Concurrency handling: Mentioned locks on DB rows.
- More questions about indexing and the data structure that helps it.
- Connecting an application to two databases.
Candidate's Approach
The candidate was close on the logic for the first problem but required hints from the interviewer. They moved on to the second problem, which they solved quickly and explained the logic, running the requested test cases.
Interviewer's Feedback
No feedback provided.
Round 2
Questions:
- Majority Element
- Sort 0, 1, and 2
The interviewer was interested in the details of the code, including alternative data structures for storing values. There was a counter question on the majority element, and the candidate shared an O(N) storage approach for frequency calculation.
Candidate's Approach
The candidate explained their project and the use case. They coded the second approach for the majority element question after discussing sorting logic.
Interviewer's Feedback
No feedback provided.
Round 3
Questions:
- HLD question for inventory management of an e-commerce website, focusing on:
- Adding new products
- Removing products
- Searching products
The candidate wrote down functional and non-functional requirements, assumptions, and discussed the database entities and their interactions. They chose a SQL database for its structured nature and relationships.
Candidate's Approach
The candidate approached the problem by:
- Writing functional and non-functional requirements.
- Mentioning entities and attributes in the database.
- Writing APIs for adding, updating, deleting, and searching products.
- Discussing scaling solutions like caching, replicas, and sharding.
- Addressing counter questions about sharding keys and handling hot keys through shard balancing.
Interviewer's Feedback
No feedback provided.