Round 1: DSA
I was asked two medium leetcode problems.
- https://leetcode.com/problems/house-robber-ii/description/
- https://leetcode.com/problems/subarray-sum-equals-k/description/
The interviewer was fine with using Word Doc or IDE.
I approached these problems by explaining the approach that I was going to follow and 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.
Round 2: LLD HLD Round
I was asked to design the feeds section of Instagram/ Facebook. The interview went as follows
- Gathered the exact requirements and aked a lot of qustions to narrow down the scope.
- Can the posts be only texts or dot hey have to be images only.
- What are information needs to be stored along with the post, to help with data modeling.
- Discussed about the concistency of the problem, took an assumption that it should be eventually conceistent.
- 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, (Just likes, comments, replying to comments, should the replies be nested, is sharing or saving a post required)
- Then dicussed a little about the database design for the same. What kind of database of what kind of data. Listed out the attributes of the table.
- Next question was regarding scaling and after some discussion we landed on caching and discussed the various caching strategies and eviction policies.
- Then interviewer wanted me to write the caching logic for LFU strategy. I wrote the classes, interfaces and caching logic for the LFU. Thankfully I had recently studied about it and the following video explained it beautifully ()
- The LLD logic was written on a word doc, but it depends from interviewer to interviewer. They are ore interested in knowing waht design patterns can be used, are the solid principles followed when creating a structure of the classes.
- I would also recommend using a whiteboard to map out classes. In this cases I was aware what all I wanted to do, so did not spend too much of my time there.
ROUND 3 : Hiring Manager
This round was heavily focused on the resume. I was asked questions on each and every line that I had mentioned and in depth questions about every tech that I had mentioned. This round went on for 1 hour 40 min or so.
- A good amount of time went into my project discussions. Explaining the problem starement and just expect a why for every answer you give.
- A lot of in depth questions about Microservices and monolithic architectures. What kind of systems are suited for both types.
- What are the ways in which a transition can be done from a monolith to microservice.
- Why do we even need to adopt the micoservice architecture.
- A lot of questions were about Kafka and the internals. Topics, partitions, consumers and consumer groups.
- Why do partitions exist.
- When using Kafka, what are the factors that affect the throughput. What role do the number of consumers and partions play in affceting the throughput.
- What happens when the paritions are more than consumers and vice versa.
- Next set of questions were focused on graphQL as I had used it to some extent in my provious projects.
- Why do we use graph QL? how and why are the advantageous, queries , mutations, resolvers etc.
- Then I was given a design problem to create a system that picks tasks from the database and schedules them to run at a specific time.
- Then he asked me to indetify all the bottlenecks in the system. How many ques would be needed, how many partitons, concurrent connections to the database, network issues. He wanted to test the debugging capabilities end to end.
- I had done performance testing in my previous prjects, so he wanted to know how that was done and what are the 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 really helped my prerp for next interviews.
Hope it helps!!