MindForge
MindForge
DashboardHelp & Support
Dashboard
MindForge

Interview Preparation Bootcamp

Course progress

0%
0 of 177 modules complete
Start Here0/1
  • How to Use This Course
Data Structures & Algorithms0/27
  • Arrays and Hashing
  • Two Pointers
  • Sliding Window
  • Sliding Window: Harder Problems
  • Binary Search
  • Stacks
  • Practice Test: Arrays, Pointers, Windows, Search and Stacks
  • Trees: Traversals and Core Patterns
  • Binary Search Trees and Rebuilding a Tree
  • Tries (Prefix Trees)
  • Heaps and Priority Queues
  • Graphs: BFS and DFS
  • Topological Sort and Cycle Detection
  • Union-Find (Disjoint Set Union)
  • Practice Test: Trees, Heaps and Graphs
  • Dynamic Programming Basics
  • Dynamic Programming: Two Dimensions
  • Dynamic Programming: Hard String Matching
  • Backtracking
  • Backtracking: Constraint Satisfaction
  • Greedy Algorithms
  • Interval Problems
  • Bit Manipulation
  • Math and Geometry
  • String Manipulation
  • Pattern Recall and Mock Coding Rounds
  • Practice Test: DP, Backtracking, Greedy and More

System Design

Foundations0/16
  • The System Design Interview Framework
  • Back-of-the-Envelope Estimation
  • Networking and Protocols for Design
  • API Design and Idempotency
  • Load Balancing, Proxies, and Scaling Out
  • Caching and CDNs
  • Choosing a Database: Storage, Indexes and Transactions
  • Replication, Partitioning, and Sharding
  • CAP, PACELC, and Levels of Consistency
  • Messaging, Queues, and Event-Driven Architecture
  • Distributed Transactions and Data Integrity
  • Coordination, Consensus, and Distributed Locks
  • Reliability, Resilience, and Rate Limiting
  • Observability, Security, and Cost
  • System Design Cheat Sheet
  • Practice Test: System Design Foundations
Case Studies0/23
  • Design a URL Shortener
  • Design a Rate Limiter
  • Design a Notification Service
  • Design a Job Queue System
  • Design a Chat App (WhatsApp)
  • Design an Analytics Pipeline
  • Design a Multi-tenant SaaS Architecture
  • Design a Social Media Feed (Twitter/X)
  • Design a Search Autocomplete System
  • Design a File Storage Service (Dropbox)
  • Design Google Docs
  • Design a Code Review System
  • Design Netflix
  • Design YouTube
  • Design Spotify
  • Design Uber/Lyft
  • Design Airbnb
  • Design Ticketmaster (Eventbrite)
  • Design an E-commerce Cart, Checkout, and Catalog
  • Design a Payment System
  • Design a Logging and Monitoring System
  • Mock Design Rounds
  • Practice Test: System Design Case Studies
Low-Level Design0/19
  • The LLD Interview Framework and UML
  • OOP Foundations for Design
  • SOLID Principles
  • Creational Patterns
  • Structural Patterns
  • Behavioral Patterns I — Strategy, Observer, Command, State, Template Method
  • Behavioral Patterns II and Anti-Patterns
  • Concurrency in Low-Level Design
  • Design a Parking Lot
  • Design an Elevator System
  • Design a Movie Ticket Booking System
  • Design an Expense-Sharing App (Splitwise)
  • Design a Vending Machine and an ATM
  • Design a Rate Limiter and a Logging Framework
  • Design a Notification Service and an In-Memory Cache
  • Design Games — Tic-Tac-Toe, Snake and Ladder, Chess
  • Database Design for LLD
  • LLD Cheat Sheet and Recall Drill
  • Practice Test: Low-Level Design

Backend

Python0/5
  • How Python Runs Your Code
  • Functions Deep Dive: Closures, Generators, Context Managers, Scope
  • Classes Deep Dive: Method Types, MRO, Metaclasses
  • Standard Library and Serialization
  • Practice Test: Python
Django0/6
  • Django Request Lifecycle
  • Lab: Django Middleware — Request ID & Response Time
  • Django ORM and Querysets
  • Django's Cache Framework
  • Practice Test: Django
  • Django in Production: Debugging Labs
FastAPI0/5
  • FastAPI, ASGI, and Async
  • FastAPI Dependency Injection
  • FastAPI Background Tasks
  • Lab: FastAPI Async — Concurrent Aggregation
  • Practice Test: FastAPI
Databases (PostgreSQL)0/6
  • Indexing
  • Query Optimization
  • Transactions and Isolation
  • Migrations and Schema Changes
  • Hierarchical Data and Safe Concurrent Updates
  • Practice Test: Databases
Caching, Queues & Distributed Systems0/8
  • Redis Caching
  • Redis Advanced Patterns
  • Celery and Background Workers
  • Kafka and Message Queues
  • Async Pipelines
  • Distributed Systems Basics
  • Distributed Locks
  • Practice Test: Caching, Queues and Distributed Systems
APIs, Security & Deployment0/9
  • REST API Design
  • API Versioning and Error Handling
  • API Security and Authentication
  • WebSockets and Real-Time Systems
  • Docker and Containers
  • File Storage with S3
  • Testing Strategies
  • Mock Backend Round
  • Practice Test: APIs, Security and Deployment
Frontend0/38
  • HTML Document Structure and Semantics
  • CSS Box Model, Flexbox and Grid
  • CSS Architecture and Theming
  • CSS and Rendering Performance
  • Variables, Scope, Hoisting, and Truthiness
  • Functions, this, and Binding
  • Objects and Prototypal Inheritance
  • JavaScript Utility Patterns: Cloning, Caching, and Memory
  • Promises From Scratch
  • The Event Loop and Browser Rendering Pipeline
  • The DOM: Nodes, Events, and Traversal
  • Practice Test: HTML, CSS and JavaScript
  • React Rendering Fundamentals
  • React Hooks Internals
  • React Performance
  • Lab: React — Stateful Counter Component
  • State Management
  • State Machines in React
  • React Custom Hooks and Composition Patterns
  • TypeScript for React
  • React Testing
  • Practice Test: React
  • HTTP and Caching
  • Network Performance and Web Vitals
  • Code Splitting and Bundles
  • Virtualization
  • GraphQL and Data Fetching
  • Web Security
  • WebSockets and Real-time
  • SSR and Next.js
  • Micro-frontends
  • Build Tools and Bundling
  • Accessibility
  • Error Handling
  • Internationalization
  • Animation
  • Rapid Recall and Mock Frontend Rounds
  • Practice Test: Performance, Architecture and Production
Behavioral & Interview Day0/14
  • Resume and Project Walkthroughs
  • The STAR Method and Refining Your Stories
  • Conflict and Difficult Coworkers
  • Failures, Incidents, and Obstacles
  • Leadership, Mentorship, and Ownership
  • Teamwork, Communication, and Feedback
  • Growth and Handling Ambiguity
  • Career Goals, Why This Company, and Negotiation
  • Situational Questions
  • Company Research
  • Mock Behavioral Rounds
  • Interview Day
  • After the Interview
  • Practice Test: Behavioral and Interview Day
Networking and Protocols for Design
Course contents

Interview Preparation Bootcamp

Course progress

0%
0 of 177 modules complete
Start Here0/1
  • How to Use This Course
Data Structures & Algorithms0/27
  • Arrays and Hashing
  • Two Pointers
  • Sliding Window
  • Sliding Window: Harder Problems
  • Binary Search
  • Stacks
  • Practice Test: Arrays, Pointers, Windows, Search and Stacks
  • Trees: Traversals and Core Patterns
  • Binary Search Trees and Rebuilding a Tree
  • Tries (Prefix Trees)
  • Heaps and Priority Queues
  • Graphs: BFS and DFS
  • Topological Sort and Cycle Detection
  • Union-Find (Disjoint Set Union)
  • Practice Test: Trees, Heaps and Graphs
  • Dynamic Programming Basics
  • Dynamic Programming: Two Dimensions
  • Dynamic Programming: Hard String Matching
  • Backtracking
  • Backtracking: Constraint Satisfaction
  • Greedy Algorithms
  • Interval Problems
  • Bit Manipulation
  • Math and Geometry
  • String Manipulation
  • Pattern Recall and Mock Coding Rounds
  • Practice Test: DP, Backtracking, Greedy and More

System Design

Foundations0/16
  • The System Design Interview Framework
  • Back-of-the-Envelope Estimation
  • Networking and Protocols for Design
  • API Design and Idempotency
  • Load Balancing, Proxies, and Scaling Out
  • Caching and CDNs
  • Choosing a Database: Storage, Indexes and Transactions
  • Replication, Partitioning, and Sharding
  • CAP, PACELC, and Levels of Consistency
  • Messaging, Queues, and Event-Driven Architecture
  • Distributed Transactions and Data Integrity
  • Coordination, Consensus, and Distributed Locks
  • Reliability, Resilience, and Rate Limiting
  • Observability, Security, and Cost
  • System Design Cheat Sheet
  • Practice Test: System Design Foundations
Case Studies0/23
  • Design a URL Shortener
  • Design a Rate Limiter
  • Design a Notification Service
  • Design a Job Queue System
  • Design a Chat App (WhatsApp)
  • Design an Analytics Pipeline
  • Design a Multi-tenant SaaS Architecture
  • Design a Social Media Feed (Twitter/X)
  • Design a Search Autocomplete System
  • Design a File Storage Service (Dropbox)
  • Design Google Docs
  • Design a Code Review System
  • Design Netflix
  • Design YouTube
  • Design Spotify
  • Design Uber/Lyft
  • Design Airbnb
  • Design Ticketmaster (Eventbrite)
  • Design an E-commerce Cart, Checkout, and Catalog
  • Design a Payment System
  • Design a Logging and Monitoring System
  • Mock Design Rounds
  • Practice Test: System Design Case Studies
Low-Level Design0/19
  • The LLD Interview Framework and UML
  • OOP Foundations for Design
  • SOLID Principles
  • Creational Patterns
  • Structural Patterns
  • Behavioral Patterns I — Strategy, Observer, Command, State, Template Method
  • Behavioral Patterns II and Anti-Patterns
  • Concurrency in Low-Level Design
  • Design a Parking Lot
  • Design an Elevator System
  • Design a Movie Ticket Booking System
  • Design an Expense-Sharing App (Splitwise)
  • Design a Vending Machine and an ATM
  • Design a Rate Limiter and a Logging Framework
  • Design a Notification Service and an In-Memory Cache
  • Design Games — Tic-Tac-Toe, Snake and Ladder, Chess
  • Database Design for LLD
  • LLD Cheat Sheet and Recall Drill
  • Practice Test: Low-Level Design

Backend

Python0/5
  • How Python Runs Your Code
  • Functions Deep Dive: Closures, Generators, Context Managers, Scope
  • Classes Deep Dive: Method Types, MRO, Metaclasses
  • Standard Library and Serialization
  • Practice Test: Python
Django0/6
  • Django Request Lifecycle
  • Lab: Django Middleware — Request ID & Response Time
  • Django ORM and Querysets
  • Django's Cache Framework
  • Practice Test: Django
  • Django in Production: Debugging Labs
FastAPI0/5
  • FastAPI, ASGI, and Async
  • FastAPI Dependency Injection
  • FastAPI Background Tasks
  • Lab: FastAPI Async — Concurrent Aggregation
  • Practice Test: FastAPI
Databases (PostgreSQL)0/6
  • Indexing
  • Query Optimization
  • Transactions and Isolation
  • Migrations and Schema Changes
  • Hierarchical Data and Safe Concurrent Updates
  • Practice Test: Databases
Caching, Queues & Distributed Systems0/8
  • Redis Caching
  • Redis Advanced Patterns
  • Celery and Background Workers
  • Kafka and Message Queues
  • Async Pipelines
  • Distributed Systems Basics
  • Distributed Locks
  • Practice Test: Caching, Queues and Distributed Systems
APIs, Security & Deployment0/9
  • REST API Design
  • API Versioning and Error Handling
  • API Security and Authentication
  • WebSockets and Real-Time Systems
  • Docker and Containers
  • File Storage with S3
  • Testing Strategies
  • Mock Backend Round
  • Practice Test: APIs, Security and Deployment
Frontend0/38
  • HTML Document Structure and Semantics
  • CSS Box Model, Flexbox and Grid
  • CSS Architecture and Theming
  • CSS and Rendering Performance
  • Variables, Scope, Hoisting, and Truthiness
  • Functions, this, and Binding
  • Objects and Prototypal Inheritance
  • JavaScript Utility Patterns: Cloning, Caching, and Memory
  • Promises From Scratch
  • The Event Loop and Browser Rendering Pipeline
  • The DOM: Nodes, Events, and Traversal
  • Practice Test: HTML, CSS and JavaScript
  • React Rendering Fundamentals
  • React Hooks Internals
  • React Performance
  • Lab: React — Stateful Counter Component
  • State Management
  • State Machines in React
  • React Custom Hooks and Composition Patterns
  • TypeScript for React
  • React Testing
  • Practice Test: React
  • HTTP and Caching
  • Network Performance and Web Vitals
  • Code Splitting and Bundles
  • Virtualization
  • GraphQL and Data Fetching
  • Web Security
  • WebSockets and Real-time
  • SSR and Next.js
  • Micro-frontends
  • Build Tools and Bundling
  • Accessibility
  • Error Handling
  • Internationalization
  • Animation
  • Rapid Recall and Mock Frontend Rounds
  • Practice Test: Performance, Architecture and Production
Behavioral & Interview Day0/14
  • Resume and Project Walkthroughs
  • The STAR Method and Refining Your Stories
  • Conflict and Difficult Coworkers
  • Failures, Incidents, and Obstacles
  • Leadership, Mentorship, and Ownership
  • Teamwork, Communication, and Feedback
  • Growth and Handling Ambiguity
  • Career Goals, Why This Company, and Negotiation
  • Situational Questions
  • Company Research
  • Mock Behavioral Rounds
  • Interview Day
  • After the Interview
  • Practice Test: Behavioral and Interview Day
Browsing without an account — progress is saved in this browser only.Sign in to save it

Networking and Protocols for Design

Reading45 min

Every arrow you draw between two boxes on a system design diagram is really a phone call between two computers. Interviewers like to poke at those arrows: how does the client find the right server, how does the server push an update to the browser, why pick one protocol over another. You don't need a networking degree for this. You need to know, for each arrow, which protocol carries it and what that choice costs you.

From URL to first byte

Learn this sequence well enough to explain it out loud. Interviewers ask it directly ("what happens when you type a URL and press enter?"), and it's the foundation for questions about CDNs, load balancers, and secure connections.

1. DNS resolve      browser cache → OS cache → resolver → root → TLD → authoritative
                    returns an IP (or a CDN edge IP via geo/latency routing)
2. TCP handshake    SYN → SYN-ACK → ACK                       (1 round trip)
3. TLS handshake    TLS 1.3: 1 round trip (1.2 was 2)         (0-RTT on resume)
4. HTTP request     GET / with headers, cookies
5. Server work      LB → app → cache/DB → response
6. Response         HTML → browser parses → more requests for CSS/JS/images

DNS (Domain Name System) is the phone book of the internet: it turns a name like "mindforge.test" into a numeric address. TCP is the connection-setup handshake computers use before sending data. TLS is the layer that encrypts the connection, so nobody in between can read it.

Three facts that pay off in interviews.

DNS is a routing tool, not just a phone book. Every DNS record has a TTL (time to live), a number of seconds saying how long a client may keep using the old answer before asking again. A short TTL, say 30 to 60 seconds, lets you redirect traffic to a different server quickly if something breaks, at the cost of clients asking DNS more often. DNS can also send users to the nearest region, or shift a small percentage of traffic to a new version gradually.

Setting up a connection is expensive. It takes roughly two round trips before a single byte of your actual data moves. Picture asking a favour from someone in another country by mail: two letters have to cross the ocean before you've even started the real conversation. Over a connection with a 150 millisecond round trip, that's 300 milliseconds spent on nothing. This is why keeping connections open (called keep-alive), reusing a pool of connections, and letting a CDN handle the connection close to the user all matter so much.

Anycast is a trick where one IP address is advertised from many physical locations at once, and the network automatically routes each user to whichever location is closest. It's how CDNs and DNS providers work, and it's also how a flood of attack traffic gets spread thin across many sites instead of overwhelming one.

Remember: DNS's TTL is a dial you control, not a fixed detail. A short TTL is what lets you redirect traffic away from a dead region within a minute.

Sign in to try this knowledge check.

TCP vs UDP, and what QUIC changed

TCP and UDP are the two basic ways computers send data to each other over a network.

TCP UDP
Delivery Reliable, in order, resends lost data Fire and forget, may drop or reorder
Setup A three-step handshake first None
Handling network congestion Built in You build it yourself, or go without
Head-of-line blocking (one lost piece stalling everything behind it) Yes No
Use for APIs, databases, anything that must be correct Live video or voice calls, games, DNS, metrics

Ask yourself one question to decide between them: is a late piece of data worth more than a missing one? For a bank transfer, yes: resend it until it arrives, so use TCP. For a video call, no: a video frame that arrives 400 milliseconds late is worse than one that's simply dropped and skipped, so use UDP and hide the gap.

HTTP/3 runs on top of QUIC, and QUIC runs on top of UDP. QUIC rebuilds reliability, ordering, and congestion handling itself, instead of relying on TCP to do it. That buys two things. First, independent streams: a lost piece of data only stalls its own stream, not the whole connection. Second, connection migration: if your phone switches from Wi-Fi to mobile data mid-call, the connection survives, because it's identified by a connection ID rather than by your IP address.

Version Key property
HTTP/1.1 Only one request in flight per connection, so browsers open about 6 connections per site
HTTP/2 Many requests share one TCP connection, headers are compressed, but it still suffers TCP's head-of-line blocking
HTTP/3 Same sharing, but over QUIC and UDP, so one lost piece of data no longer stalls every other stream; it also connects faster and survives a network switch

Remember: TCP guarantees every byte arrives in order, so one lost piece of data stalls everything behind it. UDP drops that guarantee, which is exactly why live video prefers it.

Sign in to try this knowledge check.

Client-server communication styles

The single most common question interviewers ask about protocols is: "how does the client find out something changed?" There are four answers, each more powerful and more expensive than the last.

Style How it works Delay Cost to the server Use when
Short polling Client asks again every few seconds Up to that many seconds Wasteful, since most answers are "nothing changed" Simple is fine, updates are rare, some staleness is okay
Long polling The request stays open until there's data or it times out, then the client asks again Near real-time One open connection per client Real-time-ish, without support for WebSockets
SSE (Server-Sent Events) One long-lived response that the server streams events into; the browser reconnects on its own if it drops Real-time One connection per client Server to client only: feeds, notifications, live scores
WebSocket A regular HTTP request that "upgrades" into a two-way connection Real-time One connection per client, and the server has to remember who's connected Both directions: chat, shared editing, multiplayer games, trading

Two consequences interviewers like to push on.

WebSocket and SSE make your servers stateful. Stateful means the server remembers something between requests, in this case, which client is connected to which machine. That connection is pinned to one specific server, so you need "sticky routing" (always sending that client back to the same server), a shared messaging layer like Redis, NATS, or Kafka to deliver a message to whichever server actually holds the connection, and a careful way of closing connections gradually during a deploy. Saying "just use WebSockets" without mentioning any of that is an incomplete answer.

The number of connections becomes a real capacity number you have to plan for. One million people connected over WebSockets means one million open connections at once. If one server can comfortably hold 50,000 to 100,000 of them, that's 10 to 20 servers whose only job is holding connections open.

If you only need the server pushing to the client, prefer SSE. It's plain HTTP, it works through most existing infrastructure without special handling, it reconnects automatically, and it's roughly half the complexity of a WebSocket.

Remember: ask which direction the data needs to flow. Server-to-client only means SSE. Both sides talking means WebSocket, and WebSocket makes your servers stateful.

Sign in to try this knowledge check.

Service-to-service: REST, gRPC, GraphQL, and message queues

REST/JSON gRPC/protobuf GraphQL Message queue
Shape A resource with actions on it A remote call with a typed contract One endpoint, the client asks for exactly the fields it wants Publish now, someone else reads it later
Payload Plain text, human-readable Binary, compact and fast JSON Anything
Contract An optional description (OpenAPI) A .proto file, checked and code-generated An enforced schema A loosely-defined event shape
Streaming Via SSE or chunked responses Built in, both directions Via subscriptions Built in
Works in a browser Natively Needs an extra proxy layer Natively No
Best for Public APIs, simple internal calls High-volume calls between your own services Many clients that each want different data Decoupling services, buffering spikes, broadcasting to several listeners

A few rules of thumb that hold up well.

Public or partner-facing calls: use REST. Anyone can call it with a basic tool like curl, caching works the normal HTTP way, and no special toolchain is required.

High-volume calls between your own internal services: use gRPC. Its binary format and the way it shares connections cut latency and CPU cost, and the generated code keeps two teams' services from drifting out of sync with each other.

Many different clients each needing different data: use GraphQL. It solves the problem of a client getting too much data or too little in one response. It costs you extra work controlling how expensive a single query can be, makes normal HTTP caching harder, and introduces the "N+1" problem, where fetching a list quietly triggers one extra database query per item; that's fixed with request batching.

The caller doesn't need the answer right now: use a queue, not a direct call. Chaining calls together multiplies your chance of failure. Five services in a row, each working 99.9% of the time, only work together about 99.5% of the time.

Remember: public and simple calls for REST. Internal and high-volume for gRPC. Many different kinds of clients for GraphQL. No need for an answer right now for a queue.

Sign in to try this knowledge check.

Quick recap

Question Answer
Client needs updates, server to client only SSE
Client and server both need to push WebSocket, plus sticky routing and a shared messaging layer
Updates are rare, staleness is fine Short polling
Public API REST/JSON over HTTP
Internal, high volume, typed gRPC
Many client shapes, one round trip GraphQL, plus depth limits and batching
Caller doesn't need the result right now Message queue
Loss-tolerant, latency-critical media UDP or WebRTC
Fast regional failover Short DNS TTL plus health checks
Static assets, worldwide audience CDN at the edge, anycast
PreviousBack-of-the-Envelope EstimationNextAPI Design and Idempotency

Course progress

0%
0 of 177 modules complete

On this page

  • From URL to first byte
  • TCP vs UDP, and what QUIC changed
  • Client-server communication styles
  • Service-to-service: REST, gRPC, GraphQL, and message queues
  • Quick recap