I went through Roblox's Software Engineer interview process but ultimately did not receive an offer. One of the reported coding problems involved analyzing function execution traces to identify the most frequently occurring call path. The problem started with stack-based log processing and introduced variations involving tie-breaking rules, interleaved threads, and call stack analysis.
Interview Details
Phone Technical Screen — Coding: Most Frequent Function Call Path
You are given a sequence of execution logs generated by a program. Each log entry represents one of two events:
Function Entry: A function begins executing.
Function Exit: A function finishes and returns to its caller.
Your task is to process the logs and determine which complete function call path occurs most frequently. A call path represents the sequence of active functions from the root function to the currently executing function.
A path is counted whenever a function is entered. Function exit events update the active call stack but do not contribute additional path occurrences.
Part 1 — Find the Most Frequent Call Path
Implement a function that returns the full call path with the highest frequency. A path should include every function from the root to the currently entered function, separated by ->.