Reconstruct Process Ancestry Chain From Endpoint Creation Events
Last updated: November 29, 2026
Quick Overview
Given a list of process creation events from one endpoint, each with a unique process ID, a parent ID and an image name, return the ancestry chain of a target process from the oldest known ancestor down to the target. Stop cleanly when a parent is missing or the data contains a cycle.
CrowdStrike
November 29, 20260
0
0 solved
Given a list of process creation events from one endpoint, each with a unique process ID, a parent ID and an image name, return the ancestry chain of a target process from the oldest known ancestor down to the target. Stop cleanly when a parent is missing or the data contains a cycle.
Falcon detections are explained to analysts as process trees (for example winword.exe spawning powershell.exe spawning rundll32.exe), so walking parent links is a natural phone screen warm-up for cloud backend roles. The interviewer checks that you pick a hash map, handle dirty telemetry (missing parents, corrupted cycles) and keep the loop bounded.
What the Interviewer Expects
- Index events by process ID in a dictionary for O(1) parent lookup
- Walk parent links iteratively, not with unbounded recursion
- Terminate on a missing parent and detect cycles with a visited set
- Return the chain root-first as specified
- State time and space complexity clearly
Key Topics to Cover
How to Approach This
- Clarify input constraints and edge cases before writing code.
- Walk through your approach verbally and confirm with the interviewer before coding.
- Start with a brute force solution, then optimize. Mention time and space complexity.
- Test your solution with examples, including edge cases like empty input or duplicates.
- Consider common patterns: sliding window, two pointers, hash map, BFS/DFS, dynamic programming.
Possible Follow-up Questions
- Operating systems reuse PIDs. How would you disambiguate using timestamps or a sensor-assigned unique ID?
- How would you return the full subtree of descendants for a process instead of the ancestors?
- If events for one host arrive out of order over a stream, how do you answer the query once the parent arrives later?
- How would you cap the chain length to protect a shared service from malicious input?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice DSA ProblemsSample Answer
Requirements
Input: a list of events {process_id, parent_id, image} and a target ID. Output: list of image names from the oldest ancestor we have data for down to the target. If the target is unknown, return a...
High-Level Design
Build a dictionary from process_id to event. Start at the target and repeatedly follow parent_id, appending each image. Stop when the current ID is not in the map (root or missing parent) or when ...