AI & Technical question

Write an algorithm for a robot that has to get from point A to point B in a room.

Practice this question out loud. An AI interviewer asks it, follows up like a real interviewer would, and scores your answer. Type or speak.

Start a mock interview on this question · Mock interview from a job description

What this question tests

Tests basic algorithmic and technical reasoning for a classic pathfinding problem, expected at a conceptual rather than full-code level for a PM.

How to approach it

  1. Represent the room as a grid or graph, where each cell or node represents a traversable space and obstacles are marked as blocked.
  2. Use a pathfinding algorithm like A-star or Dijkstra's, which finds the shortest path from point A to point B while avoiding blocked cells.
  3. Explain A-star's key idea at a high level: it combines the actual distance traveled so far with an estimated distance remaining to prioritize which paths to explore first.
  4. Address real-world complications: the robot needs live sensor input to detect unexpected obstacles not on the original map, and must recompute the path dynamically.
  5. Mention practical constraints, like a minimum turning radius or the robot's physical size, which a simple grid model would need to account for to avoid unrealistic paths.

What a strong answer includes

Common mistakes

Likely follow-up questions

More ai & technical questions

More questions from Microsoft

Learn the skill behind it

Chapters of the AI PM course that teach what this question tests.

Preparing for a specific role?

Book summaries for this kind of question

Browse all 4,000+ questions in the bank