Anthropic

Verified interview challenge

Generate events from sampled call stacks

Reconstruct function events from stack samples, then filter out short-lived frames under a new rule.

Unlock with Full Access

The challenge

Each sample records a timestamp and a stack from outermost to innermost frame. Convert changes between samples into correctly ordered events and close the remaining work at the end. The second part adds a debounce requirement, so the output must account for persistence across samples as well as instantaneous changes.

What you'll practise

  • Nested event ordering

    Translate stack changes into consistent starts and ends.

  • Temporal filtering

    Track which frames satisfy the later persistence rule before emitting their events.

Your coding workspacePreview
Current partFurther parts unlock as you progress
solution.pyPython 3.13
# Build on your implementation

# Run checks for the current part

# Full starter code included
Current-part checks

Run your code to see results.

The complete sequence, starter code and checks are included with Full Access.