This question evaluates a candidate's skills in parsing and string processing, hierarchical data structure construction for call-tree reconstruction, and robustness handling of nested causes, abbreviated frames, and malformed input while requiring analysis of time and space complexity.

Given a multi-line stack trace string from a single thread (e.g., each frame is in the form 'at Module::Function(file:line)'), design and implement a parser that: (