Back to problems

Solve two interview coding problems

Algorithm · Uber · Hard

Problem 1 You are given a rectangular grid made of cells that are either '.' (empty) or '#' (blocked). A robot may be placed only on an empty cell. For a robot placed at (row, col), define a signature [left, up, right, down]. To compute one direction, look along the same row or same column until reaching the first #. The value stored for that direction is the number of moves needed to land on that obstacle. Moving into an adjacent obstacle counts as 1. Diagonal obstacles are…

Checking your access…