Convert Stack Samples into Trace Events
Company: Anthropic
Role: Software Engineer
Category: Coding & Algorithms
Difficulty: hard
Interview Round: Onsite
Overview: Convert sampled root-to-leaf call stacks into a minimal sequence of start and end trace events. Use longest common prefixes between samples, close frames leaf-first, open frames root-first, and correctly handle shared timestamps and empty stacks.
Read the full Anthropic Software Engineer interview experience this question came from