Round 1
Questions:
The interviewer was fine with using Word Doc or IDE.
Candidate's Approach
I approached these problems by explaining the approach that I was going to follow. When the interviewer was satisfied with the approach, I coded them and dry ran on a couple of test cases. Running the code was not necessary.
Interviewer's Feedback
No feedback provided.
Round 2
Questions: Design the feeds section of Instagram/Facebook. The interview went as follows:
- Gathered the exact requirements and asked a lot of questions to narrow down the scope.
- Can the posts be only texts or do they have to be images only?
- What information needs to be stored along with the post, to help with data modeling?
- Discussed about the consistency of the problem, took an assumption that it should be eventually consistent.
- Do we want the users to reply to the comments?
- What are the ways in which we want the users to interact with the post (likes, comments, replying to comments, should the replies be nested, is sharing or saving a post required)?
- Discussed a little about the database design for the same. What kind of database and what kind of data? Listed out the attributes of the table.
- Discussed scaling and landed on caching, covering various caching strategies and eviction policies.
- Wrote the caching logic for LFU strategy.
- I wrote the classes, interfaces, and caching logic for LFU. Thankfully, I had recently studied about it and the following video explained it beautifully: LFU Caching Strategy.
- The LLD logic was written on a Word Doc, but it depends from interviewer to interviewer. They are more interested in knowing what design patterns can be used and if the SOLID principles are followed when creating a structure of the classes.
- Recommended using a whiteboard to map out classes. In this case, I was aware of what I wanted to do, so did not spend too much time there.
Candidate's Approach
No approach provided.
Interviewer's Feedback
No feedback provided.
Round 3
Questions: This round was heavily focused on the resume. I was asked questions on each line that I had mentioned and in-depth questions about every tech that I had mentioned. This round lasted for about 1 hour 40 minutes.
- A good amount of time went into project discussions, explaining the problem statement and expecting a "why" for every answer given.
- In-depth questions about Microservices and monolithic architectures, including:
- What kind of systems are suited for both types?
- What are the ways to transition from a monolith to microservice?
- Why do we need to adopt the microservice architecture?
- Questions about Kafka and its internals, including:
- Topics, partitions, consumers, and consumer groups.
- Why do partitions exist?
- Factors affecting throughput when using Kafka, including the role of the number of consumers and partitions.
- What happens when the partitions are more than consumers and vice versa?
- Questions focused on GraphQL, as I had used it in previous projects:
- Why do we use GraphQL? What are the advantages, queries, mutations, resolvers, etc.?
- Given a design problem to create a system that picks tasks from the database and schedules them to run at a specific time.
- Asked to identify all bottlenecks in the system, including:
- How many queues would be needed?
- How many partitions?
- Concurrent connections to the database?
- Network issues?
- Discussed performance testing in previous projects, including various kinds of testing that need to be done before the project goes live.
This last round was pretty heavy, and I was not able to answer all the questions, so I was not selected after the HM round, but it really helped my prep for next interviews.
Candidate's Approach
No approach provided.
Interviewer's Feedback
No feedback provided.