← All videos

Engineering video

51:57 · 12 November 2026

System Design Mock Interview: Build Amazon (Load Balancing, Microservices, CAP Theorem, etc)

Chapters 17 sections

  1. 0:00Designing Amazon.com
  2. 0:32Interview Structure & Requirements
  3. 4:38High Level Design: Load Balancing & Database Replication
  4. 10:54Latency & Caching: CDN + Redis

Key concepts in this video:

1. System Design Interview Structure

The speaker outlines a structured approach to system design interviews, moving from requirements and high-level design to API and data modeling, and finally to deep dives and future scaling.

Watch section from 0:30 →

2. Functional and Non-Functional Requirements

The speaker defines the scope for the catalog and product pages, and establishes non-functional requirements such as loading speed under 200 milliseconds, core web vitals, and five-nines availability.

Watch section from 1:18 →

3. Junior-Level Monolith Architecture

A basic system design is presented featuring a client-side rendered frontend using a modern JavaScript framework, a Node.js backend monolith with a REST API, static storage for product images, and a PostgreSQL database.

Watch section from 4:29 →

4. Load Balancing and Stateless Backends

To handle variable traffic and avoid costly vertical scaling, a load balancer distributes traffic across multiple stateless backend instances using algorithms like round robin or least connections.

Watch section from 5:36 →

5. Database Replication and the CAP Theorem

To handle read-heavy workloads, the database is scaled using a primary-replica architecture, introducing eventual consistency trade-offs governed by the CAP theorem.

Watch section from 6:56 →

6. Database Indexing

To avoid slow full-table scans over millions of rows, PostgreSQL indexes using B-trees are introduced to reduce lookup time complexity.

Watch section from 9:03 →

7. Content Delivery Network (CDN)

Static assets like images, fonts, and JavaScript are distributed to edge locations using a CDN to reduce latency and improve frontend performance.

Watch section from 10:56 →

8. Server-Side Caching with Redis

A Redis cache is introduced close to the backend servers to store query results, protecting the database against traffic spikes, managed via Time-to-Live (TTL).

Watch section from 12:30 →

9. REST API Design

RESTful endpoints are designed around plural nouns representing entities, using HTTP verbs (GET, POST, PATCH, PUT) and nested resources.

Watch section from 15:10 →

10. Data Modeling and Product Variations

Entities like products, brands, and SKUs are modeled with relational foreign keys and structured JSON B for variant options.

Watch section from 16:48 →

11. Pagination: Offset vs. Cursor

The trade-offs between offset pagination (prone to inconsistency when items are added) and cursor pagination (better for infinite scrolling and consistency) are analyzed.

Watch section from 18:38 →

12. Database Sharding and Consistent Hashing

Database sharding splits data across instances via a router component, while consistent hashing mitigates the complexity of adding new shards.

Watch section from 21:35 →

13. Frontend Performance and Rendering Strategies

The performance limitations of client-side rendering are addressed by adopting server-side rendering, incremental static regeneration, and pre-rendering top products onto a CDN.

Watch section from 23:44 →

14. Microservices and API Gateways

The backend monolith is split into independent microservices with dedicated databases, fronted by an API gateway that handles security, TLS termination, and rate limiting.

Watch section from 28:44 →

15. Search Autocomplete and ElasticSearch

Search suggestions are optimized using debouncing, CDN caching for common queries, and ElasticSearch for fast read-heavy search operations.

Watch section from 34:52 →

Transcript

Now today we're going to system design Amazon.com and we will focus on the catalog page and the product page. And so this is for you if you're a mid or senior level engineer that is worried about AI getting a job and knows that you definitely need to upskill in terms of system design. In this video, I'll touch upon all the essential system design mental models like load balancing microservices eventdriven architectures, and we'll also go deeper in very concepts like the captorium and consistent hashing. So, let's get started. Now, the most important thing about the system design interview is that you are expected to lead it and in order to do so effectively, you need a mental structure. In general, we want to first focus on requirements and then jump into the highle design. The reason for that