Product system to check and learn
- google search infra
- instagram feed
- uber scheduling
- twitter timeline
- spotify
- payment system
General component to think about:
- the front end the users use,
- application servers that processes requests,
- caching mechanism to speed up response time
- dedicated databases for storing
- distributed object store, that hosts billion scale data
Common design patterns to understand
- load balancing,
- cdn
- database sharding
- data caching
- etc…
4-step framework
- understand the problem and establish design scope
- propose high-level design and get buy-in
- design deep dive
- wrap up
step 1
ask the right questions,
- clarify the non-functional requirements, which focuses on:
- scale,
- performance
- bottleneck calculations → this is to determine the scales and requirement performance. by end of step 1, we should have
- features to design for,
- non-functional requirements to satisfy.
step 2
Reach agreement for interviews. Adopt a top-down approach.
- Start with apis:
- api establish a contract between the user and the end systems
- once we have the the api design, start the high level diagram
- typically start with a load balancer
- then, mention what to store persistently (db)
- Then, data model and schema.
For each feature:
- pass through the load balancer,
- what does it send and retrieve? and to where?
- this is where we specify the service (i.e. location service)
- designing a location data store, that the service can write to.
Data model and schema:
- data access patterns,
- read/write ratio then if situation permits,
- database to choose,
- indexing options.
maintaining discussion points for later:
- database scaling,
- high concurrency
- failure scenarios
step 3
deep dive: collaborate and talk to the interviewers to determine what to discuss in depth.
- clearly articulate the problem
- come up with at least two solutions
- discuss trade offs
- pick a solution based on above, and discuss the choice.