PracHub
QuestionsPremiumCoachesLearningGuidesInterview Prep
|Home/Software Engineering Fundamentals/Databricks

Design a multi-threaded synchronous log writer

Last updated: Apr 24, 2026

Quick Overview

This question evaluates a candidate's understanding of concurrent programming, durable I/O, synchronization primitives, ordering guarantees, and system reliability under contention.

  • hard
  • Databricks
  • Software Engineering Fundamentals
  • Software Engineer

Design a multi-threaded synchronous log writer

Company: Databricks

Role: Software Engineer

Category: Software Engineering Fundamentals

Difficulty: hard

Interview Round: Technical Screen

### Problem Design a log writer component that is called from **multiple application threads** and writes logs to a **single file on disk**. Requirements: - Callers can log concurrently: `log(message)` may be invoked by many threads. - Writes must be **synchronous/durable**: once `log()` returns, the message must be persisted such that it survives a process crash (assume you must `fsync`/flush). - Preserve a well-defined ordering (e.g., FIFO based on call time, or per-thread order—state your choice). - High throughput: avoid doing an `fsync` per message if possible. ### Tasks - Propose an implementation approach (data structures, threading model). - Explain how you ensure durability, ordering, and performance. - Discuss failure modes (disk full, partial writes, crash during write) and how to handle them.

Quick Answer: This question evaluates a candidate's understanding of concurrent programming, durable I/O, synchronization primitives, ordering guarantees, and system reliability under contention.

Related Interview Questions

  • Build a Durable Key-Value Cache - Databricks (medium)
  • Design a Cache with Hit Counts - Databricks (hard)
  • Optimize least-k revenue queries for read/write load - Databricks (medium)
  • Design a multithreaded event logger - Databricks (medium)
  • Explain storing files to disk with concurrency - Databricks (medium)
Databricks logo
Databricks
Feb 12, 2026, 12:00 AM
Software Engineer
Technical Screen
Software Engineering Fundamentals
24
0
Loading...

Problem

Design a log writer component that is called from multiple application threads and writes logs to a single file on disk.

Requirements:

  • Callers can log concurrently: log(message) may be invoked by many threads.
  • Writes must be synchronous/durable : once log() returns, the message must be persisted such that it survives a process crash (assume you must fsync /flush).
  • Preserve a well-defined ordering (e.g., FIFO based on call time, or per-thread order—state your choice).
  • High throughput: avoid doing an fsync per message if possible.

Tasks

  • Propose an implementation approach (data structures, threading model).
  • Explain how you ensure durability, ordering, and performance.
  • Discuss failure modes (disk full, partial writes, crash during write) and how to handle them.

Solution

Show

Submit Your Answer to Earn 20XP

Sign in to leave a comment

Loading comments...

Browse More Questions

More Software Engineering Fundamentals•More Databricks•More Software Engineer•Databricks Software Engineer•Databricks Software Engineering Fundamentals•Software Engineer Software Engineering Fundamentals
PracHub

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

Product

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

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL 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.