Decagon·AI Engineer·Technical Phone Screen
May 2026
Interviewed for an AI Engineer role at Decagon and got a coding problem involving function call logs and exclusive execution time. Pretty standard stack-based problem but the nested call tracking tripped me up a bit.
- Given a list of function call logs on a single-threaded CPU, where each log contains a function ID, whether it's a start or end event, and a timestamp, compute the exclusive execution time for each function. Nested calls should not count toward the caller's time. Return an array indexed by function ID.
“My first instinct was to just accumulate raw time per function and I completely forgot to subtract nested call durations.”