← Databricks Interview Insights

Databricks·Software Engineer·Onsite - System Design / Architecture·Senior

SeniorPrefer not to say
Jul 2026

Summary

Databricks system design round, one big question about distributed file storage that branched into like four different topics. Felt okay on the storage layout stuff but the delete pipeline section got messy toward the end.

Questions Asked (4)

Q1

Design a distributed file system that supports basic file operations (create, read, update, delete) with an emphasis on making deletion efficient at scale.

System DesignTechnical Trade-offs
Author's notes

Started with chunked storage and replication, which felt solid.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements and scale, then design a distributed file system with a metadata service and data nodes, focusing on efficient deletion. Propose a lazy deletion mechanism using tombstones and background garbage collection, and discuss trade-offs with alternatives like eager deletion.

Pro tip: Emphasize that deletion efficiency at scale often means decoupling logical deletion from physical reclamation, and highlight how this affects consistency and performance. Mention that Databricks' Delta Lake uses a similar approach with deletion vectors and vacuuming.

1. Clarify Requirements and Scale

Ask about expected file sizes, number of files, deletion frequency, consistency requirements, and latency expectations. This shapes the design and trade-offs.

2. High-Level Architecture

Propose a distributed architecture with a metadata service (e.g., master nodes) and data nodes storing file chunks. Discuss partitioning and replication for scalability and fault tolerance.

3. Efficient Deletion Mechanism

Design deletion as a two-phase process: mark files as deleted in metadata (tombstones) and asynchronously reclaim space via background garbage collection. Explain how this avoids costly synchronous operations.

4. Trade-offs and Alternatives

Compare lazy deletion with eager deletion, discussing impacts on latency, consistency, storage overhead, and complexity. Mention how to handle concurrent reads/writes during deletion.

5. Scalability and Fault Tolerance

Explain how the design scales with metadata sharding, data partitioning, and replication. Discuss failure recovery for deletion operations and garbage collection.

Key Points to Mention

  • Tombstones and lazy deletion to decouple logical deletion from physical space reclamation
  • Background garbage collection and its scheduling to avoid performance impact
  • Metadata service design: scalability, consistency, and fault tolerance
  • Data partitioning and replication strategies for distributed storage
  • Trade-offs between deletion latency, storage overhead, and consistency
  • Handling concurrent operations and ensuring read-after-delete consistency

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q2

How do you handle CAP theorem tradeoffs in this system, specifically around metadata consistency versus data availability?

System DesignTechnical Trade-offs
Author's notes

This is where I felt most comfortable.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by acknowledging that CAP theorem forces a choice between consistency and availability during network partitions, and that the right tradeoff depends on the specific data and operations. Then, differentiate metadata (which typically requires strong consistency for correctness) from data (where availability and eventual consistency may be acceptable), and propose a hybrid approach using appropriate technologies and patterns.

Pro tip: Emphasize that in real systems, the choice is not binary: you can achieve strong consistency for critical metadata while maintaining high availability for data by using consensus protocols for metadata and eventual consistency for data, and by carefully defining consistency boundaries.

1. Clarify CAP and system requirements

Define what CAP means in the context of the system: during a network partition, you must choose between consistency (linearizability) and availability. Ask clarifying questions about the system's SLAs, user expectations, and the cost of inconsistency for metadata vs. data.

2. Differentiate metadata and data

Explain that metadata (e.g., schema, permissions, table locations) often requires strong consistency to avoid corruption or security issues, while data (e.g., table contents) can tolerate eventual consistency for higher availability.

3. Propose a hybrid consistency model

Suggest using a CP system (e.g., Raft, Paxos, or ZooKeeper) for metadata to ensure strong consistency, and an AP system (e.g., eventually consistent storage like S3 or Cassandra) for data to ensure availability. Highlight that this separation allows optimizing each independently.

4. Discuss tradeoffs and mitigations

Acknowledge that even metadata may need availability in some cases; discuss techniques like quorum reads/writes, read-your-writes consistency, or conflict-free replicated data types (CRDTs) for metadata where possible. Also mention monitoring and alerting for consistency violations.

5. Relate to Databricks and real-world examples

Tie the answer to Databricks' architecture: for example, the Databricks Lakehouse uses a metadata layer (e.g., Unity Catalog) that may require strong consistency, while data storage on cloud object stores is eventually consistent. Mention how Delta Lake provides ACID transactions on top of eventually consistent storage.

Key Points to Mention

  • CAP theorem: consistency, availability, partition tolerance; tradeoff only during partitions.
  • Metadata often requires strong consistency (CP) for correctness, security, and coordination.
  • Data can often be eventually consistent (AP) to ensure high availability and partition tolerance.
  • Use consensus protocols (Raft, Paxos) for metadata and eventually consistent stores for data.
  • Delta Lake and Unity Catalog as examples of handling these tradeoffs in Databricks.
  • Consider consistency models beyond CAP: e.g., PACELC, read-your-writes, monotonic reads.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q3

Walk through your delete pipeline. What happens from the moment a delete API call is made to when storage is actually reclaimed?

System DesignAPI & Integrations
Author's notes

Tombstones and async GC, pretty standard.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Structure your answer as a chronological walkthrough of the delete pipeline, from API request to storage reclamation, highlighting key stages and design considerations. Emphasize how the system ensures correctness, durability, and efficiency, and mention trade-offs and failure handling.

Pro tip: Show awareness of real-world constraints like eventual consistency, garbage collection delays, and the importance of idempotency and auditability. Discuss how you balance immediate user expectations with backend efficiency.

1. API Request Handling

Describe how the delete API call is received, authenticated, validated, and translated into an internal delete operation. Mention idempotency and request tracking.

2. Metadata Update and Soft Delete

Explain how metadata is updated to mark the object as deleted (e.g., tombstone) and how this affects subsequent reads. Discuss transactional guarantees and consistency.

3. Asynchronous Processing and Queuing

Detail how the delete request is queued for asynchronous processing, possibly via a message queue or job scheduler, to decouple from the API response and handle retries.

4. Storage Reclamation and Garbage Collection

Describe the process of physically deleting data from storage, including any background garbage collection, compaction, or vacuuming. Mention how storage is actually reclaimed and any delays.

5. Monitoring, Auditing, and Failure Handling

Explain how the pipeline is monitored, how failures are handled and retried, and how audit logs are maintained for compliance and debugging.

Key Points to Mention

  • Idempotency of delete operations to handle retries safely
  • Soft delete vs. hard delete and their implications on read consistency
  • Asynchronous processing to avoid blocking API calls and improve scalability
  • Garbage collection mechanisms and eventual storage reclamation
  • Transactional guarantees and consistency models (e.g., ACID, eventual consistency)
  • Monitoring, alerting, and audit trails for delete operations

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q4

How does your delete and garbage collection approach interact with snapshots and ongoing replication?

System DesignTechnical Trade-offsData Modeling
Author's notes

Genuinely the hardest part of the whole interview.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by defining the core tension: deletes and garbage collection (GC) must respect snapshot isolation and replication consistency. Then walk through how you would design the system to handle deletes without breaking snapshots or replication, using mechanisms like tombstones, versioning, and coordinated GC. Conclude by discussing trade-offs and how you would validate correctness.

Pro tip: Emphasize that GC should be delayed until all snapshots and replicas that might need the deleted data are no longer active, and mention using a low-watermark mechanism to track this safely.

1. Clarify requirements and constraints

Restate the problem: ensure deletes are propagated correctly, snapshots remain consistent, and replication doesn't resurrect deleted data. Identify key constraints like snapshot retention, replication lag, and consistency models.

2. Design delete handling

Explain how deletes are represented (e.g., tombstones, delete markers) and how they are versioned. Discuss how snapshots see a consistent view (e.g., snapshot isolation) and how deletes are applied relative to snapshot creation.

3. Coordinate garbage collection

Describe GC strategy: only reclaim data when no snapshot or replica needs it. Introduce a low-watermark based on the oldest active snapshot and replication checkpoint. Discuss how GC interacts with compaction and storage layers.

4. Ensure replication consistency

Detail how deletes and GC are replicated: either replicate tombstones and let replicas GC independently, or coordinate GC across replicas. Address idempotency, ordering, and handling of replica lag.

5. Discuss trade-offs and failure scenarios

Cover trade-offs: storage overhead vs. GC aggressiveness, latency vs. consistency. Mention failure cases like replica down during GC, and how to recover (e.g., re-replication, snapshot restore).

Key Points to Mention

  • Tombstones and delete markers for representing deletes
  • Snapshot isolation and versioning (e.g., MVCC)
  • Low-watermark for safe garbage collection
  • Replication of deletes and GC coordination
  • Trade-offs between storage cost and GC frequency
  • Handling replica lag and ensuring idempotent deletes

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.