Compute World Poses From a Sensor Mount Transform Tree

Last updated: November 29, 2026

Quick Overview

Given a tree of 2D frames where each node stores its parent and a local offset (dx, dy, dtheta) in the parent's frame, compute every frame's world pose (x, y, theta).

Applied Intuition
Coding & Algorithms
Software Engineer
Applied Intuition
November 29, 2026
Software Engineer
Phone Screen
Coding & Algorithms
Easy

0

0

0 solved


Given a tree of 2D frames where each node stores its parent and a local offset (dx, dy, dtheta) in the parent's frame, compute every frame's world pose (x, y, theta).

Sensor simulation at Applied Intuition depends on transform trees like world to vehicle to lidar mount. This screen checks tree traversal and getting the rotation math right, since applying an offset in the wrong frame is the classic bug.

What the Interviewer Expects
  • Build a children map from parent pointers
  • Traverse from the root with DFS or BFS
  • Rotate the child offset by the parent heading before adding
  • Accumulate headings down the tree
  • Avoid recursion limits on deep chains
Key Topics to Cover
tree traversal
coordinate transforms
DFS
rotation math
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
  • How would you extend this to 3D with quaternions?
  • How would you answer the transform between any two frames, not only to world?
  • How would you handle transforms that change over time, like a steering wheel or a pan-tilt camera?
  • How would you detect a cycle in malformed 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

nodes maps frame name to (parent, dx, dy, dtheta); the root has parent None and its offset is its world pose. Angles in radians. Output maps each frame to (x, y, theta)....

High-Level Design

A child's world position is the parent's position plus the child's offset rotated by the parent's heading: xc=xp+dxcos⁡θp−dysin⁡θpx_c = x_p + dx\cos\theta_p - dy\sin\theta_p, yc=yp+dxsin⁡θp+dycos⁡θpy_c = y_p + dx\sin\theta_p + dy\cos\theta_p,...


Submit Your Answer
Markdown supported

Related Questions