is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.
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.
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.
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.
Classic application of recursion + backtracking.
My solution assumes that you are given a starting position in the maze, and that getting out of the maze is equivalent to reach a free position in the borders. With that in mind, all you have to do is branch on every direction (left, right, up, down), recursively finding the path until a border position is reached, or until you have tried every possibility and none worked (meaning it is impossible to get out of the maze from that starting position).
Just be careful to keep track of visited positions in a given path search, so that you don't recurse infinitely. Also, as positions are added to the path, we can keep track of the current path in a vector (C++ jargon for growable array), so that we can print it when we reach one of the border positions.
C++ implementation, tested and (apparently) working:
- 010010.bin August 21, 2015