Tips for System Design Interview

참고 링크

책 - 가상 면접 사례로 배우는 대규모 시스템 설계 기초

책 - Cracking the Coding Interview

2 power n

2^n estimate name type
2^10 1,000 1천(thousand) 1KB
2^20 1,000,000 1백만(million) 1MB
2^30 100,000,000 10억(billion) 1GB
2^40 1,000,000,000,000 1조(trillion) 1TB
2^40 1,000,000,000,000,000 1000조(quadrillion) 1PB


4 Steps for interview

Step 1. 문제 이해 및 설계 범위 확정 (3 ~ 10min)

Good questions to ask

Step 2. 개략적인 설계안 제시 및 동의 구하기 (10 ~ 15min)

Step 3. 상세 설계 (10 ~ 25min)

Accomplished Goals

Step 4. 마무리 (3 ~ 5min)

Follow-up Questions

TODO



Key Concepts

system - Page 1 (1)


Single Server Setup

  1. Users - access -> websites (through domain names)
  2. Domain Name System (DNS): paid service provided by 3rd parties and not hosted by our servers
  3. Internet Protocol (IP) address - returned -> browser / mobile app
  4. Once IP obtained, Hypertext Transfer Protocol (HTTP) requests - are sent directly -> web server
  5. Web server - returns -> HTML pages or JSON response for rendering.
    • In Single Server design
      • users are connected to the web server directly
      • X access the website if the web server is offline
      • 🤔 if many users access the web server simultaneously
    • reaches the web server’s load limit
    • users generally experience slower response or fail to connect to the server * => ✨ load balancer is the best technique to address these problems


Horizontal vs Vertical Scaling

Horizontal = Scale Out

Vertical = Scale Up



Load Balancer



Database

Which DB to use?

Relational databases, Relational database management system (RDBMS), SQL database

Non-Relational databases, NoSQL databases


Database replication




Cache

Cash Tier

Considerations



CDN

Considerations



Stateless

Stateful Server vs Stateless Server



Data center

Technical challenges to achieve multi-data center



Message Queue, Asynchronous



Log, Metric, Automation

Logging

Metrics

Automation



Network

Bandwidth

Throughput

Latency

Example - Conveyor Belt; transfers items across a factory



Map Reduce