In the previous note: System Design Interview Tips, I mentioned how to perform better in a system design interview from the candidate’s perspective. In this note, we will use “Twitter” as an example to walk you through a complete system design interview.
After some intro, the interviewer will kick start the interview with the definitions of some key features that Twitter is capable of:
Then, the interviewer will leave the candidate(TC) to drive the whole designing discussion.
This stage is neglected by in-experienced candidates quite often. However, the information collected at this stage typically has substantial impact on the architecture.
To gain that crystal clarity, the candidate needs to remind him/herself to ask questions around the Scale & User Behavior. For Twitter’s example:
These data points to a clear direction: Read latency optimization impacts the user experience most.
In most cases, drawing DB table schema is 1st step of the solution.
Here, TC needs to design at least 3 tables: User, Tweet and Home Timeline. User and Tweet table are obvious, either SQL or NoSQL works.
But, the design of HT table differentiate candidate’s design capability and set the foundation of entire solution.
Ideally, to minimize the reading latency at the scale of 10M DAU. The system that TC come up with should consist of:
If we try to match these requirements with the existing solutions we have in the market, No-SQL in-memory DB like Redis stands out.
#twitter #system-design-interview #software-development #computer-science #data science