InterviewLegend

Buffered Writers & Ring Buffers

Alex Chen30 min readUpdated 74 real interview reports

After the filesystem walk, the buffered writer is the Datadog coding shape that comes up the most. The prompt barely changes between rounds. You are handed a File (or some sink) whose write pushes bytes straight to disk. You wrap it in a BufferedFile that holds writes in memory and flushes only when its buffer fills up or someone calls flush. The warm-up takes five minutes. What you are graded on is the ladder of follow-ups that comes after it.

One reported round had the interviewer reject a candidate's dynamic-length buffer and insist on a fixed-length array with pointers tracking how full it was. Another pushed the buffer into a circular array the moment write changed to take a byte count. Neither steer is random. Both shapes are code Datadog ships: a buffer that batches writes, a ring buffer that keeps only the last N items. The interviewer already has one in mind and walks you toward it.

What's inside
  • 2 problems, worked step by step
  • about 30 min

Premium lessonDatadog interview guide

These took digging.

What candidates walked out with, from 20,000+ reports, forum threads behind logins and write-ups in Chinese. Then solved step by step.

100 companies. Checked every month.

Unlock all 100 companies

$49 a year · less than $1 a week · Cancel anytime

Had your Datadog interview?Tell us what they asked. Reviewed before it goes in, never with your name.
Datadog interview guide

Know what Datadog asks before you walk in.

11 coding · 4 system design · 30 behavioral questions

Get Premium$49 a year · Cancel anytime
Or start freeNo card.

Get their questions first.

InterviewLegend is independent and not affiliated with or endorsed by any company it covers.