PracHub
QuestionsLearningGuidesInterview Prep
|Home/System Design/Databricks

Design a Durable Concurrent Event Writer

Last updated: Jul 28, 2026

Quick Overview

Design a thread-safe local event writer shared by thousands of producers appending opaque records to one file. Define ordering and return guarantees while addressing interleaving, bounded backpressure, batching, disk errors, torn writes, graceful shutdown, crash recovery, and operational metrics.

  • hard
  • Databricks
  • System Design
  • Software Engineer

Design a Durable Concurrent Event Writer

Company: Databricks

Role: Software Engineer

Category: System Design

Difficulty: hard

Interview Round: Onsite

# Design a Durable Concurrent Event Writer Design a thread-safe `DataWriter` used by one application process on one server: ```text DataWriter(file_path) push(data: bytes) -> None ``` Thousands of application threads share one instance and continuously append opaque records of at most 1 KB to a local file. The records must not interleave or become silently corrupted. Discuss ordering, durability, backpressure, failure reporting, shutdown, and crash recovery. State the exact guarantee provided when `push` returns. ### Constraints & Assumptions - There is one writer object and one target file. - Record contents are opaque and may contain arbitrary bytes. - The process may crash at any instruction and the disk may report write or flush errors. - You may batch physical writes, but must explain how batching affects acknowledgment semantics. ### Clarifying Questions to Ask - Must `push` wait for an `fsync`, or is acceptance into process memory sufficient? - Is ordering defined by call start, lock acquisition, or an assigned sequence number? - May producers block when the writer is overloaded? - How should a caller learn about an asynchronous disk failure? - What should graceful shutdown guarantee? ### What a Strong Answer Covers ```premium-lock What a Strong Answer Covers ``` ### Follow-up Questions - How would you support several independent files? - How would the design change if every acknowledged record had to survive power loss? - How would you rotate and compact files safely? - What changes if several processes append to the same file?

Quick Answer: Design a thread-safe local event writer shared by thousands of producers appending opaque records to one file. Define ordering and return guarantees while addressing interleaving, bounded backpressure, batching, disk errors, torn writes, graceful shutdown, crash recovery, and operational metrics.

Related Interview Questions

  • Design Chat Deletion Semantics Under Concurrent Sends - Databricks (medium)
  • Design a Collaborative Playlist Editor - Databricks (medium)
  • Design a Thread-Safe Buffered Writer with a Background Flush Thread - Databricks (medium)
  • Design a Chat Application with a Partitioned Cache - Databricks (medium)
|Home/System Design/Databricks

Design a Durable Concurrent Event Writer

Databricks logo
Databricks
Jul 7, 2026, 12:00 AM
hardSoftware EngineerOnsiteSystem Design
0
0

Design a Durable Concurrent Event Writer

Design a thread-safe DataWriter used by one application process on one server:

DataWriter(file_path)
push(data: bytes) -> None

Thousands of application threads share one instance and continuously append opaque records of at most 1 KB to a local file. The records must not interleave or become silently corrupted. Discuss ordering, durability, backpressure, failure reporting, shutdown, and crash recovery. State the exact guarantee provided when push returns.

Constraints & Assumptions

  • There is one writer object and one target file.
  • Record contents are opaque and may contain arbitrary bytes.
  • The process may crash at any instruction and the disk may report write or flush errors.
  • You may batch physical writes, but must explain how batching affects acknowledgment semantics.

Clarifying Questions to Ask Guidance

  • Must push wait for an fsync , or is acceptance into process memory sufficient?
  • Is ordering defined by call start, lock acquisition, or an assigned sequence number?
  • May producers block when the writer is overloaded?
  • How should a caller learn about an asynchronous disk failure?
  • What should graceful shutdown guarantee?

What a Strong Answer Covers Premium

Follow-up Questions Guidance

  • How would you support several independent files?
  • How would the design change if every acknowledged record had to survive power loss?
  • How would you rotate and compact files safely?
  • What changes if several processes append to the same file?

Submit Your Answer to Earn 20XP

Sign in to leave a comment

Loading comments...

Browse More Questions

More System Design•More Databricks•More Software Engineer•Databricks Software Engineer•Databricks System Design•Software Engineer System Design

Your design canvas — auto-saved

PracHub

Master your tech interviews with 8,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • AI Coding Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.