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
Coding & Algorithms
Software Engineer
CrowdStrike
November 29, 2026
Software Engineer
Phone Screen
Coding & Algorithms
Easy

0

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
Hash maps
Tree traversal
Cycle detection
Process trees
Dirty telemetry
How to Approach This
  1. Clarify input constraints and edge cases before writing code.
  2. Walk through your approach verbally and confirm with the interviewer before coding.
  3. Start with a brute force solution, then optimize. Mention time and space complexity.
  4. Test your solution with examples, including edge cases like empty input or duplicates.
  5. 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 Problems
Sample 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 ...


Submit Your Answer
Markdown supported

Related Questions