PracHub
QuestionsPremiumCoachesLearningGuidesInterview Prep
|Home/Coding & Algorithms/Datadog

Design log queries and a buffered writer

Last updated: Mar 29, 2026

Quick Overview

This question evaluates understanding of time-indexed data structures and timestamp granularity handling for range queries, along with buffered I/O mechanics including partial-write semantics, error handling, ordering guarantees, and concurrency control.

  • Medium
  • Datadog
  • Coding & Algorithms
  • Software Engineer

Design log queries and a buffered writer

Company: Datadog

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: Medium

Interview Round: Technical Screen

Part A — Log store with time-range queries: Implement a data structure that ingests log entries with ISO-8601 timestamps (e.g., YYYY-MM-DD HH:MM:SS) and unique IDs. Support add(id, timestamp) and query(start, end, granularity) where granularity ∈ {Year, Month, Day, Hour, Minute, Second}; query returns IDs whose timestamps fall within [start, end] at the specified granularity. Describe your data structures, update/query time and space complexities, and how you maintain ordering and memory usage. Part B — Buffered writer: Implement a BufferedWriter over an abstract sink write(bytes) that may accept partial writes. Support write(data), flush(), and close(); preserve ordering, chunk large inputs into fixed-size buffers, minimize system calls, and handle errors/partial writes. Discuss thread-safety options and complexity trade-offs.

Quick Answer: This question evaluates understanding of time-indexed data structures and timestamp granularity handling for range queries, along with buffered I/O mechanics including partial-write semantics, error handling, ordering guarantees, and concurrency control.

Related Interview Questions

  • Implement a Snowflake Query Client - Datadog (medium)
  • Implement Prefix Match Filter - Datadog (hard)
  • Build span trees from unordered trace spans - Datadog (medium)
  • Implement buffered file writer with concurrency support - Datadog (easy)
  • Implement write with internal buffer - Datadog (Medium)
Datadog logo
Datadog
Sep 6, 2025, 12:00 AM
Software Engineer
Technical Screen
Coding & Algorithms
41
0

Part A — Log store with time-range queries: Implement a data structure that ingests log entries with ISO-8601 timestamps (e.g., YYYY-MM-DD HH:MM:SS) and unique IDs. Support add(id, timestamp) and query(start, end, granularity) where granularity ∈ {Year, Month, Day, Hour, Minute, Second}; query returns IDs whose timestamps fall within [start, end] at the specified granularity. Describe your data structures, update/query time and space complexities, and how you maintain ordering and memory usage. Part B — Buffered writer: Implement a BufferedWriter over an abstract sink write(bytes) that may accept partial writes. Support write(data), flush(), and close(); preserve ordering, chunk large inputs into fixed-size buffers, minimize system calls, and handle errors/partial writes. Discuss thread-safety options and complexity trade-offs.

Submit Your Answer

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More Datadog•More Software Engineer•Datadog Software Engineer•Datadog Coding & Algorithms•Software Engineer Coding & Algorithms
PracHub

Master your tech interviews with 8,500+ 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.