Banco público de perguntas reais para entrevistas: explore por empresa, categoria e tema
CodingMid-level

Help Mouse Find the Cheese

Given a mouse in a grid, determine if the mouse can reach the cheese. The only way to manipulate the mouse is via two functions, move() and isCheese(). The move() function returns true and moves the mouse if the move is possible, and returns false otherwise. The isCheese() function returns true if the mouse is currently at the cheese and false otherwise. You only have one instantiation of the mouse class. You cannot access the graph outside of the methods provided. The graph may have walls and isn’t guaranteed to be any particular shape. Exactly one cheese exists, and it’s always possible to reach it.

Empresas em que apareceu
MetaMeta
Contextos reais

Onde essa pergunta já apareceu

Use esses exemplos para entender em que contexto ela costuma cair e adaptar sua prática.

Metamidmar. de 2026

Given a mouse in a grid, determine if mouse can reach the cheese. The only way to manipulate the mouse is via two functions, move() and isCheese(). move() returns true and moves the mouse if the move is possible, and returns false otherwise. isCheese() returns true if the mouse is currently at the cheese and false otherwise. You only have one instantiation of the mouse class. You cannot access the graph outside of the methods provided. The graph may have walls and isn’t guaranteed to be any particular shape. Exactly one cheese exists, and it’s always possible to reach it.

Anexos públicos

Materiais associados

Nenhum anexo público associado a esta pergunta.

Sinais de resposta forte
Você deixa claro por que escolheu essa abordagem e o que descartou.
Seu código vem acompanhado de testes mentais e edge cases relevantes.
Sua explicação ajuda o entrevistador a acompanhar o raciocínio em tempo real.
O que costuma enfraquecer a resposta
Entrar direto no código sem alinhar interpretação do problema.
Passar tempo demais em silêncio e só explicar no fim.
Ignorar complexidade, invariantes e estratégia de teste.

Continue a preparação com o banco completo

No app você encontra perguntas parecidas, compara empresas e aprofunda essa busca com mais filtros.