Find Most Called Function in Stack Trace
Given a list representing a stack trace with functions and directional arrows ('->' for calls, '<-' for returns), determine which function is called the most frequently. The input is guaranteed to be valid.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
Early September, 2026
Multiple parts 1) Get max frequency path 2) Split tie with depth of the call 3) Get max frequency per thread specified in the call
Early September, 2026
Mid August, 2026
3 Steps. First step is the original question. Second step is tiebreaker based on stack depth. Third is the event stack includes different threads.
Hello Interview Premium
Your account is free and you can post anonymously if you choose.