Reported interview periodApr 2026–Aug 2026
Convert Sampled Call Stacks into Events
A profiler periodically records the active call stack. Convert these snapshots into the minimal sequence of call-start and call-end events.
Practice focusEach sample has an integer timestamp and a stack ordered from outermost to innermost. Each output event contains the sample timestamp, an event type ( start or end ), and a frame name. Rules - Compare each stack with the previous stack using the longest common prefix. - End removed frames from innermost to outermost. - Start added frames from outermost to innermost. - Adjacent identical stacks produce no events. - Equal names at different depths represent different invocations. - Do not invent end events for calls still active in the last sample.…