Design Software Systems Like a Senior Engineer – Complete Course

freeCodeCamp.org

Summary

The engineer provides a thorough, practical curriculum on software system design tailored for senior and staff engineering interviews. The course opens with a repeatable five-step framework covering requirement clarification, data and API design, high-level architecture, scalability bottlenecks, and trade-off summaries. Simonyan stresses that candidates are evaluated on communication, technical judgment, practical edge-case depth, and time management rather than purely drawing diagrams.

The course applies this framework across three complex production architectures: a Spotify-like audio streaming service utilizing signed URLs and CDNs, a Booking.com-scale hotel reservation system using row locking and change data capture pipelines, and a WhatsApp-scale messaging platform managing WebSockets, Kafka batch writes, and end-to-end encryption. Each design highlights concrete capacity calculations, failure recovery modes, and real-world distributed systems trade-offs.

How time-sensitive the topic is: Evergreen

By the numbers

  • 90 terabytes: Calculated raw audio storage for thirty million songs at three megabytes per track (Mentioned at 26:59)
  • 3 gigabytes: Estimated total metadata storage required for thirty million songs (Mentioned at 27:51)
  • 17 transactions per second: Calculated write transactions per second for Booking.com based on 1.1 billion room nights (Mentioned at 1:02:23)
  • 1,000 queries per second: Estimated search and availability read requests per second on Booking.com (Mentioned at 1:03:31)
  • 10 billion: Estimated daily chat messages sent across 500 million active users on WhatsApp (Mentioned at 1:56:58)
  • 115,000 writes per second: Average write operations per second required to support ten billion daily messages (Mentioned at 1:57:07)
  • 500,000 writes per second: Peak write throughput required for WhatsApp messaging database clusters (Mentioned at 1:57:23)
  • 100 times: Measured throughput acceleration achieved by executing batched database inserts rather than single records (Mentioned at 2:40:52)

Questions this video answers

How do you prevent double booking when two users book the same room simultaneously?

Standard database select-then-insert queries fail because concurrent transactions can both read available inventory before either commits. The solution uses read-committed isolation paired with explicit row-level locking via select-for-update, which serializes access to that specific room type while letting other bookings proceed in parallel.

1:33:05 to 1:37:45

From this keypoint: Mitigating Race Conditions with Row Locking

Why should media streaming systems avoid serving audio directly through API servers?

Routing large audio downloads through API nodes ties up server connection pools and saturates network bandwidth. The system should instead generate temporary pre-signed URLs from object storage or CDNs, allowing client applications to stream audio chunks directly without consuming application compute.

30:00 to 34:40

From this keypoint: Audio Delivery via Pre-Signed URLs

What is the recommended structure for navigating a 60-minute system design interview?

Spend the first 5-10 minutes clarifying functional and non-functional requirements to lock in scope. Dedicate 15-20 minutes to data modeling, API contracts, and high-level architecture, followed by 10-15 minutes addressing scale, edge cases, and failure modes before closing with tradeoffs.

9:14 to 13:54

From this keypoint: The Repeatable Five-Step Framework

How can Elasticsearch be kept in sync with a primary relational database without data drift?

Writing directly to both SQL and Elasticsearch from application code causes silent data drift when networks partition. Using Change Data Capture tools like Debezium to stream database write-ahead logs through Kafka ensures search indexes update asynchronously and remain eventually consistent with the single source of truth.

1:43:06 to 1:47:46

From this keypoint: Keeping Elasticsearch in Sync via CDC

How do chat applications like WhatsApp sync messages across multiple devices?

When a message is received, the server checks an in-memory session registry like Redis to locate all active sessions across a user's registered devices. Delivery packets are fanned out across those WebSocket connections, while an incremental sync protocol ensures newly connected devices only fetch recent history.

2:13:10 to 2:17:50

From this keypoint: Coordinating Multi-Device State Sync

Credible AI™ signals

Confidence: High Technical Rigor. The presenter delivers exhaustive, industry-standard system design methodologies, walking step-by-step through concrete architectural math, protocol trade-offs, and distributed systems failure recovery patterns without unsubstantiated claims.

Bias: Pedagogical Focus. Content is objective engineering analysis focused on trade-offs between technologies (SQL vs NoSQL, polling vs WebSockets), with minor self-promotional mentions of the presenter's external courses and channel.

Originality (88%): In-Depth Architectural Synthesis. While system design interviews frequently use standard problems like Spotify, Booking.com, and WhatsApp, the depth of capacity math, low-level concurrency mechanisms, and detailed failure-mode mitigations provides unique practical value.

Depth (95%): Deep Systems Engineering. Examines architectural design from back-of-the-envelope capacity estimations through API schema design, database isolation levels, edge-case failure modes, CDC pipelines, and disaster recovery strategies.

Key points (25)

  • Short (37 min): key points 1, 2, 4, 5, 8, 14, 16 and 21
  • Medium (1h 19min): key points 1, 2, 4, 5, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 and 21
  • Relaxed (1h 58min): all 25 key points

1. System Design Evaluation Pillars

Timestamp: 00:00:19 to 00:05:04 (5 min)

The engineer explains that candidates are evaluated across five distinct pillars rather than merely the final diagram: communication, structured thinking, technical judgment, practical depth, and time management. Technical depth distinguishes candidates who have operated live production software from those who rely entirely on textbook theory. Interviewers primarily assess how engineers handle ambiguity and collaborative problem-solving.

Impact: High. Why it matters: Reframes the technical interview from a pure architectural quiz into a holistic behavioral assessment of senior engineering maturity.

“Most software engineering roles today require system design knowledge. Whether it's for the job itself or for interviews, you are expected to know how to design systems at scale.”

In the video, at 0:24

For: YouTube: freeCodeCamp.org

2. The Repeatable Five-Step Framework

Timestamp: 00:09:14 to 00:13:54 (5 min)

A structured five-step framework provides a blueprint for navigating forty-five to sixty-minute whiteboarding interviews without wandering off track. Engineers must dedicate the initial ten minutes exclusively to clarifying functional boundaries and non-functional constraints before attempting system design. Skipping immediate architectural sketching protects candidates from building the wrong system.

Impact: High. Why it matters: Prevents catastrophic interview failure caused by premature architecture drafting before constraints are defined.

“There are five steps for any system design problem. This is a repeatable structure you can apply to any whiteboarding system design interview.”

In the video, at 9:21

For: YouTube: freeCodeCamp.org

3. Summarizing System Tradeoffs Explicitly

Timestamp: 00:18:24 to 00:23:04 (5 min)

Every technical decision in distributed systems requires deliberate tradeoffs between performance, consistency, operational complexity, and infrastructure cost. Selecting components without justifying why competing alternatives were discarded signals junior or superficial knowledge. Candidates should conclude sessions by articulating what was prioritized and what would be improved given additional time.

Impact: Medium. Why it matters: Forces candidates to demonstrate balanced engineering reasoning rather than reciting idealized best practices.

“You usually wrap up by summarizing the key decisions you made, what you prioritized for this system, what you sacrificed because it's always about trade-offs in system design.”

In the video, at 18:57

For: YouTube: freeCodeCamp.org

4. Spotify Storage Capacity Planning

Timestamp: 00:23:55 to 00:28:35 (5 min)

Capacity calculations for a music platform managing thirty million tracks reveal that raw audio files completely dwarf metadata requirements. At an average compressed song size of three megabytes, storage demands ninety terabytes before replication, whereas metadata requires only three gigabytes. Capacity estimates must accurately project network egress and storage replication multipliers.

Impact: High. Why it matters: Demonstrates that back-of-the-envelope calculations dictate appropriate database selection and blob storage separation.

“Since we assumed that 3 megabytes is the average size of a song and we have 30 million songs that we are working with, this translates to 90 terabytes on average of raw audio data.”

In the video, at 26:50

For: YouTube: freeCodeCamp.org

5. Audio Delivery via Pre-Signed URLs

Timestamp: 00:30:00 to 00:34:40 (5 min)

Application servers must never stream bulk audio files directly to clients because large file transfers exhaust network bandwidth and connection pools. Application servers should instead generate time-limited signed URLs that allow client applications to stream audio chunks straight from object storage. Offloading large binaries preserves server availability for core business transactions.

Impact: High. Why it matters: Decouples application compute nodes from heavy network I/O, preventing media downloads from taking down API servers.

“And these will be queried with generated signed URLs, which is a one-time URL that expires after some time.”

In the video, at 30:37

For: YouTube: freeCodeCamp.org

6. Immutable Media Storage Strategy

Timestamp: 00:38:00 to 00:42:40 (5 min)

Audio tracks uploaded to object storage should be treated as immutable entities organized under pseudo-hierarchical bucket paths. Whenever artists edit an audio track, the system must trigger a fresh upload and purge old files rather than mutating in-place. Immutability simplifies edge cache invalidation across distributed global networks.

Impact: Medium. Why it matters: Eliminates cache synchronization bugs and distributed locking complexity for static media assets.

“The audio files here are immutable meaning once you upload them you cannot change them. So if you need to make a change to the uploaded file, you need to re-upload it and remove the old one.”

In the video, at 40:24

For: YouTube: freeCodeCamp.org

7. Stateless Scaling and Database Sharding

Timestamp: 00:44:37 to 00:49:17 (5 min)

Scaling a streaming platform to tens of millions of users requires stateless API tiers paired with database read-write splitting. By keeping application instances completely stateless, horizontal autoscaling remains trivial across multi-zone infrastructure. Read replicas and geographic sharding distribute search queries away from the primary transactional database.

Impact: High. Why it matters: Establishes a resilient foundation for horizontal growth by isolating read traffic from transaction-heavy writes.

“Since we are not maintaining any type of user session or any storage, these are completely stateless meaning we can scale them as many as needed to handle the incoming traffic.”

In the video, at 46:21

For: YouTube: freeCodeCamp.org

8. Hotel Reservation Double-Booking Vulnerabilities

Timestamp: 00:50:52 to 00:55:32 (5 min)

Hotel booking platforms fail when developers treat inventory management like a standard CRUD application with simple database selects and inserts. When two users compete for the final room concurrently, naive logic checks availability, passes both requests, and executes conflicting reservations. Reliable reservation systems mandate transactional ACID guarantees to protect inventory integrity.

Impact: High. Why it matters: Identifies the core race condition that leads to costly refunds, unhappy customers, and untrusted reservation platforms.

“For instance, one of the problems that you might have is a moment when two users are trying to book the last room available at the same time and you try your simple select then insert approach which creates the double booking problem.”

In the video, at 51:38

For: YouTube: freeCodeCamp.org

9. Deriving Throughput via Traffic Funnels

Timestamp: 00:58:22 to 01:03:02 (5 min)

Traffic math for hotel reservations reveals an intensely read-heavy system where browsing queries dwarf completed booking transactions. Calculating bottom-up from 1.1 billion room nights annually yields seventeen transactions per second alongside roughly one thousand read queries per second. Engineering architectures must optimize aggressively for read caching while isolating write locks.

Impact: Medium. Why it matters: Clarifies that optimization efforts should focus on search and caching layers rather than write infrastructure.

“And that means that we are getting 17 bookings per second which is the transactions per second that we are going to support in the database.”

In the video, at 1:02:21

For: YouTube: freeCodeCamp.org

10. Integrating Elasticsearch for Complex Filters

Timestamp: 01:05:00 to 01:09:40 (5 min)

Relational databases degrade severely when executing multi-attribute queries using pattern matching and geographical distance calculations across millions of rows. Introducing an Elasticsearch service enables fast sub-second discovery using tokenized full-text indexing, fuzzy typo matching, and geographic coordinate bounding. Eventual consistency in the search cluster remains acceptable since transactional inventory checks occur downstream.

Impact: High. Why it matters: Unburdens relational databases from slow table scans while providing sub-500ms discovery response times.

“For such situations, tools like elastic search are a good solution for handling the massive scale for the search.”

In the video, at 1:07:18

For: YouTube: freeCodeCamp.org

11. Pragmatic Microservices and Local ACID Stores

Timestamp: 01:11:02 to 01:15:42 (5 min)

Adopting strict microservices where every domain owns an isolated database introduces distributed transactions, network latency, and complex two-phase commits. Colocating hotel inventory and reservation tables inside a single relational database allows systems to maintain local ACID transactions without coordination overhead. Microservices should be separated cleanly at the application tier while sharing tightly coupled data schemas.

Impact: High. Why it matters: Avoids the operational overhead of the saga pattern and distributed two-phase commits for core booking workflows.

“For admins who want to add a new hotel, they will need to make a post request to / hotels endpoint. And this is where we will insert it into the SQL first”

In the video, at 1:14:09

For: YouTube: freeCodeCamp.org

12. Client Idempotency Keys Prevent Resubmissions

Timestamp: 01:17:38 to 01:22:18 (5 min)

Users frequently double-click checkout buttons or experience network retries that duplicate booking submissions and trigger fraudulent multiple charges. Generating a unique idempotency key on the front end ensures that identical repeated payloads return the existing reservation record instead of creating duplicates. Enforcing idempotency keys safeguards transaction workflows against network anomalies.

Impact: High. Why it matters: Neutralizes client-side duplicate submissions before they can execute conflicting financial transactions.

“So if we have the hotel ID and the room ID that this user is trying to book, basically we generate a reservation ID once and then if they try to double book it like book it again, we will be able to catch it”

In the video, at 1:18:33

For: YouTube: freeCodeCamp.org

13. Abstracting Inventory by Room Type

Timestamp: 01:22:59 to 01:27:40 (5 min)

Hotel booking platforms should model inventory across aggregated room types and calendar dates rather than reserving physical room numbers upfront. Physical room assignment occurs upon check-in, enabling dynamic capacity management, bulk inventory adjustments, and structured overbooking buffers. Grouping inventory by room type simplifies date-range SQL queries.

Impact: High. Why it matters: Dramatically reduces relational locking contention by operating on aggregate room inventories rather than individual physical assets.

“One important thing here is that you book the room type and not the specific room. So you book a specific type of room like is it a double queen bed or something else and not a specific room”

In the video, at 1:23:03

For: YouTube: freeCodeCamp.org

14. Mitigating Race Conditions with Row Locking

Timestamp: 01:33:05 to 01:37:45 (5 min)

Default SQL read-committed isolation allows concurrent transactions to read the same inventory row before either commits, creating double-booking race conditions. While serializable isolation stops race conditions, it causes severe transaction blocking and deadlocks under heavy reservation loads. Employing read-committed isolation combined with explicit select-for-update row locking serializes conflicting rows while allowing unrelated transactions to execute in parallel.

Impact: High. Why it matters: Provides bulletproof inventory concurrency without incurring the throughput collapse of full serializable database transactions.

“So read committed by itself is unsafe for bookings because two transactions can both read valid data pass checks and then override each other and that's exactly how double bookings happen.”

In the video, at 1:34:49

For: YouTube: freeCodeCamp.org

15. Keeping Elasticsearch in Sync via CDC

Timestamp: 01:43:06 to 01:47:46 (5 min)

Dual-writing changes to PostgreSQL and Elasticsearch directly from application code causes silent data drift whenever network partitions or server crashes interrupt writes. Employing Change Data Capture with tools like Debezium streams PostgreSQL write-ahead logs into Apache Kafka to update Elasticsearch asynchronously. Decoupling search synchronization protects the relational database as the authoritative single source of truth.

Impact: High. Why it matters: Eliminates distributed data divergence and dual-write inconsistencies between transactional databases and search clusters.

“Instead, if we use elastic search, we have the full text search with relevance ranking.”

In the video, at 1:45:56

For: YouTube: freeCodeCamp.org

16. Messaging Scale and Mobile Constraints

Timestamp: 01:50:45 to 01:55:25 (5 min)

Designing a messaging system like WhatsApp requires handling stateful connections and volatile mobile networks across hundreds of millions of daily active users. Operating at ten billion daily messages translates to over 115,000 write operations per second with peak spikes reaching 500,000. Keeping server storage lean demands that delivered messages be purged rapidly from server memory.

Impact: High. Why it matters: Sets the rigorous throughput, connection concurrency, and data retention parameters needed to scale real-time chat.

“So in a short interview, you need to show that you understand not just the happy path but also all the things that can go wrong in messages when they are flying around”

In the video, at 1:53:45

For: YouTube: freeCodeCamp.org

17. Choosing NoSQL for High Write Throughput

Timestamp: 01:58:00 to 02:02:40 (5 min)

Relational databases fail under messaging workloads because sustained write loads of hundreds of thousands of operations per second overwhelm B-tree indexing and replication locks. Distributed NoSQL stores such as Apache Cassandra or DynamoDB handle massive append-only write throughput by partitioning data cleanly across clusters. Predictable key lookups by conversation and timestamp fit Cassandra table structures naturally.

Impact: High. Why it matters: Ensures message ingestion keeps pace with massive write throughput without database degradation.

“NoSQL will work better here something like Cassandra or Dynamo DB because we need high write throughput as you saw in the estimations and our query patterns are mostly straightforward.”

In the video, at 2:00:49

For: YouTube: freeCodeCamp.org

18. Service Discovery for Stateful Chat Servers

Timestamp: 02:07:04 to 02:11:44 (5 min)

Unlike stateless web tiers, real-time chat nodes maintain long-lived stateful WebSocket connections that make traditional round-robin load balancing ineffective. Implementing service discovery clusters with tools like Consul allows infrastructure to conduct automated health checks and track available nodes. Routing tables update dynamically so that incoming client connections navigate around degraded chat instances.

Impact: Medium. Why it matters: Maintains persistent gateway routing without breaking established WebSocket sessions or sending traffic to dead instances.

“The load balancer needs some way to know which servers are available like chat server one and two are available at this moment and chat server 3 is unhealthy.”

In the video, at 2:08:00

For: YouTube: freeCodeCamp.org

19. Coordinating Multi-Device State Sync

Timestamp: 02:13:10 to 02:17:50 (5 min)

Modern messaging platforms must mirror message delivery, acknowledgments, and read receipts seamlessly across phones, tablets, and desktop apps. When a message arrives, the server queries a Redis registry to locate every active session across a user's registered devices and dispatches parallel delivery packets. Incremental synchronization ensures newly connected devices fetch only recent message history rather than downloading entire archives.

Impact: High. Why it matters: Enables responsive cross-platform device experiences while capping synchronization bandwidth and server fanout costs.

“And then radius responds that user B has two devices and it is connected on server B and server E each of these devices”

In the video, at 2:16:31

For: YouTube: freeCodeCamp.org

20. Group Fanout and Single Write Persistence

Timestamp: 02:22:37 to 02:27:17 (5 min)

Broadcasting group chat messages to dozens of participants can overwhelm backend systems if each recipient triggers an independent database write. The optimal architecture performs a single message write to the persistent store while broadcasting delivery packets in-memory via Redis publish-subscribe to connected instances. Offline group members receive push notifications and retrieve unread inbox items upon reconnecting.

Impact: High. Why it matters: Prevents combinatorial write amplification during active group conversations while guaranteeing delivery to offline members.

“The chat server first request it will make to the group service is to check who's in this group which is ID of 789 as an example and it will retrieve the list of users”

In the video, at 2:25:46

For: YouTube: freeCodeCamp.org

21. Batch Ingestion with Dead-Letter Queues

Timestamp: 02:31:44 to 02:36:24 (5 min)

Individual database inserts take roughly five milliseconds each, meaning one thousand individual writes consume five full seconds of processing time. Accumulating messages into memory buffers and executing batch inserts of one thousand records slashes latency down to fifty milliseconds, yielding a hundredfold throughput gain. Messages that fail validation or exceed retry limits are redirected into dead-letter queues to prevent data loss.

Impact: High. Why it matters: Provides a massive hundredfold throughput acceleration while protecting pipeline stability through isolated error queues.

“And if for any reason this still fails, we make sure that we don't delete the message from the message Q so that we don't end up losing the messages or we can use something which is called dead letter Q.”

In the video, at 2:35:48

For: YouTube: freeCodeCamp.org

22. Signal Protocol End-to-End Encryption

Timestamp: 02:40:00 to 02:44:40 (5 min)

Deploying end-to-end encryption ensures that message contents remain completely illegible to transit routers, cloud providers, and intermediate chat servers. Implementing the Signal protocol requires client devices to register public identity keys and pools of signed one-time prekeys with a centralized key server. Senders fetch these public keys to initiate an encrypted session, ratcheting cryptographic keys per message for forward secrecy.

Impact: High. Why it matters: Guarantees strict user privacy and cryptographic forward secrecy across all transmitted conversational data.

“Typically on WhatsApp, messages are encrypted on the sender's device and only decrypted on the recipient's device. Even WhatsApp servers can't read the content.”

In the video, at 2:41:52

For: YouTube: freeCodeCamp.org

23. Distributed Token Bucket Rate Limiting

Timestamp: 02:46:12 to 02:50:52 (5 min)

Protecting distributed messaging systems from denial-of-service floods and automated scraping requires applying multi-tier token bucket rate limiters. Enforcing thresholds across distinct actions such as message dispatches, media uploads, and group creation blocks malicious actors before resources degrade. Tracking token counters inside centralized Redis clusters prevents attackers from bypassing quotas by hopping across different chat servers.

Impact: Medium. Why it matters: Shields backend infrastructure from connection exhaustion and resource starvation caused by coordinated bot attacks.

“So we will initialize with the capacity and with the refill rate which can be different for each action and then we can have something like tokens which show the capacity.”

In the video, at 2:48:56

For: YouTube: freeCodeCamp.org

24. User-Based Sharding Tradeoffs

Timestamp: 02:54:14 to 02:58:54 (5 min)

Sharding chat databases by user identifier ensures all conversations for a specific individual reside on a single database partition, keeping reads fast. A major drawback is that hyperactive users create hot partitions, while sharding by message identifier distributes writes evenly but turns conversation reads into slow cross-shard fanouts. Systems often choose user-based sharding combined with asynchronous read replicas to balance storage and query speed.

Impact: High. Why it matters: Illuminates the unavoidable structural tensions between write distribution and single-partition query efficiency.

“So typically when it comes to keeping the data available we usually shard for right scalability.”

In the video, at 2:56:18

For: YouTube: freeCodeCamp.org

25. Gradual Rollouts via Dynamic Feature Flags

Timestamp: 03:09:08 to 03:15:12 (6 min)

The engineer notes that deploying major architectural changes and protocol updates directly to entire user populations risks catastrophic global outages. Senior engineering organizations utilize centralized feature flag platforms to rollout new functionality to internal staging environments before enabling it for small canary percentages. Evaluating error metrics during progressive canary deployments ensures systems can rollback instantly without service disruptions.

Impact: High. Why it matters: Protects global uptime by decoupling software deployments from runtime feature releases across millions of client devices.

“You don't usually release new features for all users. You usually do gradual rollout. In such cases, we usually use feature flux store.”

In the video, at 3:11:40

For: YouTube: freeCodeCamp.org

Conflicts of interest (1)

Instructor Career Accelerator Promotion

Commercial conflict, Medium severity

The engineer operates a proprietary commercial career coaching platform with job placement guarantees linked directly in the published video description.

Significance: The open-access lecture serves as promotional lead generation for his high-ticket mentorship service.

Key sources

  • YouTube: freeCodeCamp.org: Technical Education Publisher

Who's in this

  • Spotify
  • Booking.com
  • WhatsApp
  • Apache Kafka
  • Redis
  • Elasticsearch
  • Apache Cassandra
  • Amazon Web Services

Also mentioned

  • PostgreSQL (First mentioned at 14:47)
  • Amazon S3 (First mentioned at 30:52)
  • Debezium (First mentioned at 1:49:10)
  • Signal Protocol (First mentioned at 2:42:26)
  • Consul (First mentioned at 2:08:21)
  • LaunchDarkly (First mentioned at 3:12:02)

This analysis was generated by skim (skim.plus), an AI-powered content analysis platform by Credible AI. Scores and classifications represent the platform's AI-generated assessment and should be considered alongside other sources.