InterviewDB Experience

Grid Guessing: Minimum Queries to Locate a Hidden Cell in a Matrix

Interview Experience

Problem A hidden cell is placed uniformly at random in an N x M grid. You can query a row or a column; the oracle tells you whether the cell is in that row/column. Devise a strategy to locate the cell using the minimum worst-case number of queries, then implement it. Follow-ups Prove that binary search on rows then columns is optimal in terms of worst-case query count. If the oracle is noisy (lies with probability p), how would you adapt the strategy? How many expected queries does random probin…

Full Details

🔒

Unlock all Decagon questions

Full insider details, leaked discussions, and candidate experiences.

Get full access — $100 a year, unlimited access

About This Question

This is a candidate experience report from a decagon interview during the phone round.

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