Reported September 2026
Anthropicsimulation

Confirmed Profiling Events with First-Observed Starts

Reported by candidates from Anthropic's online assessment. Pattern, common pitfall, and the honest play if you blank under the timer.

Get StealthCoderRuns invisibly during the live Anthropic OA. Under 2s to a working solution.
Founder's read

The trap in this Anthropic OA, reported in September 2026, is that a call's start event gets emitted late but stamped early. A solution that logs the confirmation sample's timestamp will fail Example 1 right away. The problem is simulation over stack samples with run tracking. Calls are identified by full stack prefix, so recursive names at different depths are separate calls. If you blank on the event ordering rules while the clock runs, StealthCoder is the invisible safety net on your screen. Know the shape of the trick before you sit down.

The problem

Related interpretation: Profiling Events from Consecutive Stack Samples uses the confirmation sample itself as the start timestamp.
A sampling profiler records the active call stack at strictly increasing timestamps. You are given parallel arrays:
timestamps[i] is the time of sample i.
stacks[i] lists active function names from outermost to innermost.
A call is identified by its full stack prefix, so recursive calls with the same function name at different depths are distinct calls.
Confirmation and Start Times
A call's current run begins at the first sample in which its exact stack prefix appears. The run continues only while that prefix appears in every consecutive sample.
A call becomes confirmed when its current run reaches n consecutive samples. Emit its start event only when this confirmation occurs, but use the timestamp of the first sample in that run: ["start", firstObservedTimestamp, functionName].
If a call disappears before reaching n samples, it emits no events. If the same prefix appears again later, that appearance begins a new run.
End Times and Event Order
If a confirmed call is absent from a later sample, emit ["end", currentTimestamp, functionName]. At each processed sample, emit endings from innermost to outermost before emitting newly confirmed starts from outermost to innermost.
Return events in emission order; do not sort them afterward by their stored timestamps. Do not synthesize end events after the final sample, so calls in the final sampled stack remain active.
Output Format
Return all events as strings. Convert each integer timestamp to its decimal string representation.

Function
generateProfilingEvents(timestamps: int[], stacks: String[][], n: int) → String[][]

Examples
Example 1
timestamps = [10,20,30,40,50]
stacks = [["main"],["main","parse"],["main","parse"],["main"],["main"]]
n = 2
return = [["start","10","main"],["start","20","parse"],["end","40","parse"]]
main becomes confirmed at timestamp 20, but its run began at 10, so its start event stores 10. parse becomes confirmed at 30 and stores its first-observed time, 20. It ends when absent at 40. No final end is synthesized for main.
Example 2
timestamps = [1,2,3,4,5,6]
stacks = [["a"],["a","a"],["a","a"],["a","tmp"],["a","b"],["a","b"]]
n = 2
return = [["start","1","a"],["start","2","a"],["end","4","a"],["start","5","b"]]
The outer and recursive a calls confirm separately, with first-observed start times 1 and 2. The recursive call ends at 4. tmp appears only once and is suppressed, while b confirms at 6 but stores its first-observed time, 5.

Constraints
1 <= timestamps.length == stacks.length <= 1000
1 <= n <= timestamps.length
Timestamps are strictly increasing signed 32-bit integers.
0 <= stacks[i].length <= 100
Every function name is non-empty.

Reported by candidates. Source: FastPrep

Pattern and pitfall

Track each prefix as a key, built by joining the stack from index 0 to depth d. For every sample, compute the set of prefixes present. Keep a map from prefix to first-observed timestamp, run length, and confirmed flag. Prefixes missing from the current sample get dropped. If they were confirmed, emit an end event with the current timestamp. Do those ends innermost to outermost, meaning deepest prefix first. Then walk the current stack outermost to innermost, increment runs, and emit a start when a run hits exactly n, using the stored first timestamp. The pitfalls are using the confirmation time, sorting events afterward, adding final ends, and treating a reappearing prefix as a continuation. Reset it as a new run. Use a delimiter-safe key, like the depth plus joined names. StealthCoder is your hedge if the ordering rules tangle during the live OA.

If this hits your live OA and you blank, StealthCoder solves it in seconds, invisible to the proctor.

If this hits your live OA

You can drill Confirmed Profiling Events with First-Observed Starts cold, or you can hedge it. StealthCoder runs invisibly during screen share and surfaces a working solution in under 2 seconds. The proctor sees the IDE. They don't see what's behind it. Built by an Amazon engineer who would have shipped this the night before his JPMorgan OA if he'd had it.

Get StealthCoder

Related leaked OAs

⏵ The honest play

You've seen the question. Make sure you actually pass Anthropic's OA.

Anthropic reuses patterns across OAs. Built by an Amazon engineer who would have shipped this the night before his JPMorgan OA if he'd had it. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Confirmed Profiling Events with First-Observed Starts FAQ

What's the core trick in this Anthropic profiling problem?+

Store the first sample timestamp of each prefix's current run, but emit the start event only when the run length reaches n. The event order is emission order, so start events can carry earlier timestamps than the end events before them. Don't sort.

How do I handle recursive calls with the same function name?+

Identify a call by its full prefix, not its name. In Example 2, [a] and [a,a] are distinct calls with separate runs. Build keys from the whole prefix up to each depth, using a separator or JSON encoding so names can't collide.

What order do events come out in at each sample?+

First emit ends for confirmed calls that vanished, innermost to outermost, so deepest prefix first. Then emit newly confirmed starts from outermost to innermost. Both happen at the current sample, and the ends use the current timestamp.

Do I emit end events after the last sample?+

No. The problem says not to synthesize them, so calls in the final stack stay active. In Example 1, main has a start event but no end. Just stop after processing the last sample.

How do I prepare for this in 48 hours?+

Hand-trace both examples until you can predict every event. Then code the per-sample loop with a map of prefix to start time and run count. Test edge cases: n equals 1, empty stacks, a prefix reappearing after a gap, and deep recursion. Constraints are small, so simple is fine.

Problem reported by candidates from a real Online Assessment. Sourced from a publicly-available candidate-aggregated repository. Not affiliated with Anthropic.

OA at Anthropic?
Invisible during screen share
Get it