System Design FAANG Prep Backend Architecture

System Design Fundamentals — What You Actually Need to Know

REST APIs, databases, caching, and scalability — explained the way engineers actually think about them

Sanskruti Varade · Interview Prep · ~9 min read

System design interviews are open-ended by design. There's no single correct answer — the interviewer wants to see how you think about tradeoffs, not whether you've memorized a template.

These notes cover the core concepts that appear in almost every system design interview, with focus on understanding why each decision exists, not just what to say.

REST API Design

A REST API is a contract between your backend and anything that consumes it. Good API design makes that contract clear, consistent, and resilient to change.

Resource-based URLs

URLs identify resources, not actions. Verbs belong in HTTP methods, not URLs.

# Wrong
GET /getUser?id=42
POST /createPost

# Right
GET /users/42
POST /posts

HTTP Methods → CRUD

Status Codes

Interview Signal

Always version your API from day one. /api/v1/users means you can introduce /api/v2/users later without breaking existing clients.

Database Modeling

The first decision in any system design: relational or non-relational?

SQL — PostgreSQL / MySQL
  • Clear structure & relationships
  • ACID transactions needed
  • Schema known upfront
  • Complex JOINs required
NoSQL — MongoDB / Redis
  • Unstructured / varying data
  • Horizontal scalability needed
  • Speed over strict consistency
  • Simple known access patterns

Most real systems use both. A social platform might use PostgreSQL for user accounts, Redis for session caching, and a document store for user-generated content.

Normalization vs Denormalization

Normalize for write-heavy systems where consistency matters. Denormalize for read-heavy systems where query speed dominates.

Indexing

An index makes lookups faster at the cost of slower writes and extra storage. Index columns you filter or sort by frequently. Never index everything — the overhead compounds.

Caching Strategies

Cache-Aside (Lazy Loading)

Check cache first. On miss, fetch from DB, populate cache, return result. Most common pattern. Simple to implement. Stale data possible between TTL refreshes.

Write-Through

Every write goes to cache and DB simultaneously. Cache always current. Higher write latency but reads are always fresh.

Write-Back (Write-Behind)

Writes go to cache immediately, DB updated asynchronously. Fastest writes but risk of data loss if cache goes down before async write completes.

Eviction Policies

Scalability Patterns

Vertical Scaling
  • More CPU/RAM on one server
  • Simple to implement
  • Hard ceiling exists
  • Single point of failure
Horizontal Scaling
  • Add more servers
  • Theoretically unlimited
  • Requires load balancer
  • More operational complexity

Load Balancing Strategies

Database Scaling

Read replicas: One primary handles writes, multiple replicas handle reads. Effective for read-heavy workloads. Replication lag means replicas may be slightly behind.

Sharding: Partition data across multiple DB instances. Dramatically increases write capacity. Adds significant operational complexity.

Message Queues

When two services need to communicate but don't need an immediate response — use a queue. Service A publishes, Service B processes asynchronously. Improves resilience and enables horizontal scaling of consumers. RabbitMQ and Apache Kafka are standard examples.

How to Structure a System Design Answer

The Real Evaluation

The interviewer is evaluating whether you think like an engineer who has shipped systems — not whether you've memorized a framework. Tradeoffs matter more than perfect answers.

← Interview Materials