Find Most Frequent Function Call Path in Stack Trace
Given a list representing a stack trace with function calls and returns (indicated by '->' and '<-'), find the function call path that occurs most frequently. If multiple paths have the same frequency, return the one that occurred first.
Asked at:
Roblox
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
Late January, 2026
Roblox
Senior
The list (example) is similar to the following: " -> main" " -> clickHandler" " -> clickExecutor" " <- clickExecutor" " <- clickHandler" " -> clickHandler" " <- clickHandler" " -> mouseHandler" " <- mouseHandler" " <- main" The expected result would be "main -> clickHandler" which is a path that occured twice. While "main -> clickHandler -> clickExecutor" and "main -> mouseHandler" occured once. In the event that more than one stack trace has the same frequency, return the one that occurred first.
Hello Interview Premium
Your account is free and you can post anonymously if you choose.