Scalability Interview Questions - Easy

Easy-level scalability interview questions covering fundamental scaling concepts.

Q1: What is scalability and why does it matter?

Answer:

Definition: System's ability to handle increased load by adding resources.

Why It Matters:

  • Handle growth without rewriting
  • Maintain performance under load
  • Cost-effective resource usage
  • Better user experience

Q2: Explain vertical vs. horizontal scaling.

Answer:

Vertical Scaling:

  • Add more power to existing machine
  • Simple (no code changes)
  • Limited by hardware
  • Single point of failure
  • Use for: Databases, monoliths

Horizontal Scaling:

  • Add more machines
  • Nearly unlimited scaling
  • Requires load balancing
  • Better fault tolerance
  • Use for: Web servers, microservices

Q3: What is a load balancer and how does it work?

Answer:

Purpose: Distribute traffic across multiple servers

Algorithms:

Benefits:

  • Distribute load evenly
  • Remove single point of failure
  • Enable rolling updates
  • Health checks

Q4: What is database replication?

Answer:

Purpose: Copy data from master to replicas

Benefits:

  • Read scaling: Distribute read queries
  • High availability: Failover if master fails
  • Backup: Real-time backup
  • Geographic distribution: Replicas in different regions

Replication Types:


Q5: What is database sharding?

Answer:

Purpose: Partition data across multiple databases

Sharding Strategies:

Benefits:

  • Horizontal scaling for writes
  • Distribute load
  • Smaller indexes (faster queries)

Challenges:

  • Complex queries across shards
  • Rebalancing when adding shards
  • Transactions across shards

Q6: What is caching and where to use it?

Answer:

Cache Layers:

When to Cache:

  • Frequently accessed data
  • Expensive computations
  • Rarely changing data
  • Database query results

Cache Strategies:

  • Cache-Aside: App checks cache, loads from DB if miss
  • Write-Through: Write to cache and DB simultaneously
  • Write-Behind: Write to cache, async write to DB

Q7: What is a CDN (Content Delivery Network)?

Answer:

Purpose: Distribute static content globally

How It Works:

Benefits:

  • Reduced latency (serve from nearby edge)
  • Reduced origin server load
  • Better availability
  • DDoS protection

What to Cache:

  • Images, videos
  • CSS, JavaScript
  • Static HTML
  • Downloads

Q8: What is database indexing?

Answer:

Index Structure (B-Tree):

When to Index:

  • Columns in WHERE clauses
  • Columns in JOIN conditions
  • Columns in ORDER BY
  • Foreign keys

Trade-offs:

  • ✅ Faster reads
  • ❌ Slower writes (update index)
  • ❌ Extra storage

Q9: What is connection pooling?

Answer:

Purpose: Reuse database connections instead of creating new ones

How It Works:

Benefits:

  • Faster (no connection overhead)
  • Limited connections (prevent DB overload)
  • Better resource management

Configuration:

  • Min connections: Keep alive
  • Max connections: Upper limit
  • Timeout: How long to wait for connection

Q10: What is rate limiting?

Answer:

Algorithms:

Token Bucket Example:

Why Rate Limit:

  • Prevent abuse
  • Protect from DDoS
  • Ensure fair usage
  • Control costs

Summary

Key scalability concepts:

  • Vertical vs. Horizontal: Scale up vs. scale out
  • Load Balancing: Distribute traffic
  • Database Replication: Scale reads
  • Database Sharding: Scale writes
  • Caching: Reduce latency
  • CDN: Global content delivery
  • Indexing: Fast queries
  • Connection Pooling: Reuse connections
  • Rate Limiting: Prevent abuse

These fundamentals enable building scalable systems.

Related Snippets