Steps to answer system design questions
Requirement Gathering
- Functional
- Core features
- Critical features
- Users of system (internal, cust, etc.)
- How will user interact (API, web, mobile...)
- What actions user allowed to perform
- Non-Functional
- Scale of system in term of users and requests
- Data volume we expect
- read to write ratio
- Availability of how many 9's
Capacity estimation
It wont be needed in depth in each so ask intervieewer beforehand.
- Daily users count we can expect
- Traffic (peak read/write scenarios)
- Storage (Type of data to be stored) and estimation of total amount of storage required
- Memory (will caching we helpful)
High Level design
- break down into smaller pieces like LB, FE, BE, Cache, DB, Queues etc.
DB design
- Choose between SQL vs NOsql based on Data modeling needed.
- Design DB schema
- Define Data access patterns, and add index and caching based on that
API Design
- Indentify the API requirements, based on the functionalities,
- Choose api style (REST, Graphql, gRPC) based on client need
- Define Endpoints
- Specify data formats (JSON, xml)
Deep dive into Key components
- Deep dive into high level of business logic like each service , what will it do
- Also explain LB, caching, Authentication etc.
Address Key issues
- Address Scalability, performance concerns
- Reliability