System design interview questionHard
Databricks

Design a Distributed File System

Design a GFS- or HDFS-style file system that stores petabytes of large files across thousands of servers in one data center for batch processing.

1. Problem Statement

Design a distributed file system for one data center. Thousands of commodity servers store petabytes of large files that are mostly written once by appending and then read sequentially by batch jobs, and disks and servers fail every day. How would you design it?

2. Architecture Discussion Map

Use this as one discussion aid, not a single correct answer. Your design should follow from the requirements, scale, and trade-offs you establish.

Rendering architecture diagram...
Mermaid Source (For AI Bots)
graph LR
    A["Design a Distributed File System"]
    A --> F1["Metadata master and client metadata caching"]
    A --> F2["Chunk size, leases, and the write pipeline"]
    A --> F3["Append semantics and the consistency model"]
    A --> F4["Rack-aware placement, heartbeats, re-replication, and rebalancing"]
    A --> F5["Master durability, failover, and the small-files problem"]

3. Key Focus Areas

  • 1
    Metadata master and client metadata caching
  • 2
    Chunk size, leases, and the write pipeline
  • 3
    Append semantics and the consistency model
  • 4
    Rack-aware placement, heartbeats, re-replication, and rebalancing
  • 5
    Master durability, failover, and the small-files problem

4. What the Interviewer Looks For

The interviewer probes these areas, and the report grades the interview against them.

  • Requirements and capacity model
  • Metadata master and client caching
  • Chunks, leases, and the write pipeline
  • Append semantics and consistency
  • Placement, failure detection, and re-replication
  • Master durability, failover, and metadata scale

5. What Strong Candidates Should Demonstrate

  • Decide what the metadata service owns and how clients reach data without it becoming a bottleneck.
  • Order and replicate concurrent writes and appends, and state what readers see after a partial failure.
  • Place, re-replicate, and rebalance replicas across racks as disks and servers fail.
  • Make master state durable and recoverable, and know when one master stops scaling.

Want interactive feedback?

Practice drawing this system component-by-component on a live whiteboard while the interviewer probes at your target level.

Continue to Dashboard

Core Concepts

Distributed StorageReplicationConsistency ModelsFault Tolerance

Continue preparing

Build a complete software engineer mock interview plan

Prepare by company

Related System Design

Design a Key-Value Store

Design a distributed key-value store like Dynamo or Cassandra with high availability.

Related System Design

Design a Cross-Product Tagging System

Design a shared tagging service that lets users apply tags to entities across multiple Atlassian products, with consistent search and deduplication.

Related System Design

Design a Distributed Message Queue

Design a high-throughput distributed message queue similar to Apache Kafka, with durable replay from stored offsets.