Unity 3D Interview Question for Software Engineer / Developers

Country: United States
Interview Type: In-Person

Comment hidden because of low score. Click to expand.
of 0 vote

1) it's just the Manhattan distance, first move m-1 fields down, then n-1 left. Probably the original question had some fields in the matrix one couldn't touch. Then we would need some shortest path algorithm, simple to implement would be single source BFS, elegant and fast would be A*. In the middle is bi-source BFS (easier to implement, still quite stupid on a map)
2) There are infinite amount of paths, because there is no requirement that limits the path length or prohibits going in cycles, so, if there is one path, there are infinite many paths (you can cycle between any two fields as long as you want)
If you limit either the path length or set a constraint of not visiting a field twice, the problem has a DP solution.

- Chris November 04, 2017 | Flag Reply

Add a Comment

Writing Code? Surround your code with {{{ and }}} to preserve whitespace.


is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.

Learn More


CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.

Learn More

Resume Review

Most engineers make critical mistakes on their resumes -- we can fix your resume with our custom resume review service. And, we use fellow engineers as our resume reviewers, so you can be sure that we "get" what you're saying.

Learn More

Mock Interviews

Our Mock Interviews will be conducted "in character" just like a real interview, and can focus on whatever topics you want. All our interviewers have worked for Microsoft, Google or Amazon, you know you'll get a true-to-life experience.

Learn More