Code Room
CodingHardcod-g747
Subject Grid traversalLevel Senior–Staff~40 minCommon in Algorithms & data structures interviewsIndustries Software development, Computer games

Question

A warehouse robot moves on a grid: 'S' start, 'T' target, '.' floor, '#' wall, and conveyor cells '^','v','<','>'. A normal step into an adjacent non-wall cell costs 1 move. When the robot lands on a conveyor cell it is immediately and freely pushed in the arrow's direction, repeatedly, until it reaches a non-conveyor cell. If a conveyor pushes the robot into a wall, off the grid, or into an infinite loop of conveyors, that landing is invalid. Return the minimum number of moves to reach 'T', or -1 if impossible. Exactly one 'S' and one 'T' (both on non-conveyor cells).

Implement
warehouse_min_steps(grid: list[list[str]]) → int
Examples
in[[["S",">","T"]]]out1
What a strong answer looks like

State your approach and its time/space complexity out loud before you optimize. Handle the edge cases (empty input, duplicates, overflow), and say why you chose this over the brute force. Green tests are the floor, not the grade.

Vibe coding: describe the solution in plain language (or narrate it) and the coach grades your approach. Generating runnable code from your description is coming next.

Run or narrate your approach, then ask the coach.