InterviewDB Question

Sneaky Snack Run: Minimum Cost Path Through a Grid with Obstacles

Question Details

Round 1 - Coding Problem A character wants to reach a snack at the far corner of a grid without being seen. Each cell has a detection cost (0 means safe, higher means riskier). Find the path from top-left (0,0) to bottom-right (M-1,N-1) that minimizes total detection cost. You can only move right or down. Example Follow-ups Now allow movement in all 4 directions. What algorithm would you use and why? Some cells are completely blocked (cost = -1) — how do you handle that? Return the actual path,…

Full Details

🔒

Unlock all Glean questions

Full insider details, leaked discussions, and candidate experiences.

Get full access — $100 a year, unlimited access

About This Question

This is a reported interview question from a glean interview during the phone round.

It covers the following topics: Coding, Phone, Onsite, Matrix .