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
GraphQL and Data Fetching
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

GraphQL and Data Fetching

Reading30 min

A job posting asking for "React plus GraphQL" is usually really asking whether you understand why a team would reach for GraphQL at all, not whether you know its syntax. This lesson covers what actually changes when you switch to it, the performance trap almost every new resolver falls into, and how a modern data-fetching library caches in a way plain Context never can.

Query versus mutation

Imagine ordering at a restaurant where instead of picking from a fixed menu, you tell the kitchen exactly which ingredients you want on your plate, no more, no less. That's what GraphQL does for data: the client states exactly which fields it needs in one request, instead of hitting several fixed REST endpoints and getting back whatever shape each one happens to return.

A query is a read: the client describes a shape, and the server returns data matching that shape exactly. A mutation is a write, create, update, or delete, and it's named mutation specifically so tooling and caching layers know this one has side effects.

graphql
query {
  user(id: "1") { name posts { title } }
}
mutation {
  createPost(title: "Hello", body: "...") { id title }
}

Remember: a query never changes anything on the server. A mutation always might, and it's named that way so caches know to treat it differently.

Sign in to try this knowledge check.

Resolvers: a graph of functions, not a list of routes

Every field in a GraphQL schema has a resolver, a function that knows how to produce that one field's value, from a database, another service, or a cache. The server walks the query, calls the resolver for each requested field, and assembles the response tree from the results. That's why people describe a GraphQL server as "a graph of resolvers" rather than a fixed list of routes.

The N+1 problem, and fixing it with batching

Picture asking a librarian for 20 books, one at a time, walking back to the front desk after each one. Resolving user.posts for a list of users, done naively, works the same way: one query fetches the users, then N separate queries, one per user, fetch each one's posts. That's the N+1 problem, GraphQL's single most common performance trap, because a nested query makes it easy to write a resolver with no idea it's being called in a loop.

DataLoader fixes it by batching. Within one tick of the event loop, it collects every .load(id) call, then fires exactly one query (WHERE user_id IN (...)) instead of N separate ones, and it caches results per request so the same ID is never fetched twice.

js
const postLoader = new DataLoader(async (userIds) => {
  const posts = await db.posts.findByUserIds(userIds); // one batched query
  return userIds.map(id => posts.filter(p => p.userId === id));
});

// resolver
posts: (user) => postLoader.load(user.id)

Say a query resolves posts for 20 users. Each call to posts: (user) => postLoader.load(user.id) doesn't hit the database right away, it registers that ID and returns a pending promise. Once the current tick finishes, DataLoader gathers all 20 IDs, runs the batch function exactly once with all of them, then slices the one result set back apart and resolves each of the 20 waiting promises with its own slice.

Remember: N+1 is one query for the parents, then one query per child. DataLoader collapses that second wave into exactly one batched query.

Sign in to try this knowledge check.

The real REST-versus-GraphQL trade-off

REST GraphQL
Over/under-fetching Common, each endpoint returns a fixed shape The client asks for exactly the fields it needs
Round trips Often several, roughly one per resource Usually just one, even for nested data
Caching Free, through normal HTTP caching, URLs act as cache keys Harder, everything is a POST to one endpoint, needs its own normalized client cache (Apollo, Relay)
Versioning Separate /v1/, /v2/ endpoints Evolve the schema instead: add fields, deprecate old ones
Server complexity Simple, routes map straight to handlers Higher: a resolver graph, N+1 handling, query cost limits

GraphQL isn't strictly "better." It trades away free HTTP-level caching and server simplicity for a client that can shape its own queries, and that trade earns its keep specifically when a frontend genuinely needs to pull together data from many nested or related resources in one round trip.

Remember: GraphQL wins when the frontend needs to compose lots of related data in one trip. REST wins when free HTTP caching matters more than that flexibility.

Sign in to try this knowledge check.

A query library: caching that Context structurally can't do

useQuery infers its type from the fetcher function's return type, so type the fetcher, not the hook call:

ts
type Policy = { id: number; title: string; version: number };
async function fetchPolicies(): Promise<Policy[]> {
  const res = await fetch('/api/policies');
  return res.json();
}

const { data, isLoading, error } = useQuery<Policy[]>({ queryKey: ['policies'], queryFn: fetchPolicies });
// data is Policy[] | undefined; TypeScript knows the shape before the request even resolves

Why reach for a query library over Context for server data: Context re-renders every single consumer on any update, and hands you nothing for caching, retries, or staleness, all of that would have to be built by hand. A query library dedupes identical in-flight requests fired from different components, caches by queryKey, retries failed requests automatically, and refetches on window focus or reconnect, all out of the box. Context is still the right tool for low-frequency global values like theme or the current user, just not for data that came from an API to begin with.

For a large, frequently polled list, pairing this with virtualization (the previous lesson) is standard: virtualize the rendering to keep the DOM small, and let the query cache's own deduplication stop several parts of a dashboard from independently re-fetching the same data.

Remember: Context re-renders every consumer and caches nothing. A query library dedupes, caches, and retries automatically, which is why it, not Context, is the right tool for server data.

Sign in to try this knowledge check.

Module Federation, tied to one concrete example

Micro-frontends get their own full lesson later, but it's worth seeing what a real Module Federation setup looks like once here, tied to an actual feature rather than abstract config.

js
// remote app's webpack config — exposes one component to whoever loads it
new ModuleFederationPlugin({
  name: 'policyApp',
  filename: 'remoteEntry.js',
  exposes: { './PolicyEditor': './src/PolicyEditor' },
  shared: { react: { singleton: true }, 'react-dom': { singleton: true } },
});

// host app — loads it exactly like any other code-split chunk
const PolicyEditor = React.lazy(() => import('policyApp/PolicyEditor'));

The detail interviewers listen for hardest is shared: { react: { singleton: true } }. Without marking react/react-dom as singletons, the host and the remote each bundle their own separate copy of React, which breaks hooks and Context outright: with two separate React instances, useContext inside the remote can't see a Provider rendered by the host, since each copy tracks its own internal state independently.

Remember: two copies of React in one page means two separate context systems that can't see each other. singleton: true is what prevents that.

PreviousVirtualizationNextWeb Security

Course progress

0%
0 of 177 modules complete

On this page

  • Query versus mutation
  • Resolvers: a graph of functions, not a list of routes
  • The N+1 problem, and fixing it with batching
  • The real REST-versus-GraphQL trade-off
  • A query library: caching that Context structurally can't do
  • Module Federation, tied to one concrete example