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.
What means that the door "opens towards the fire exit"? I think that it must to a room which is closer to the fire exit than the previous room.
- rustam2890 November 23, 2014So, the data structure is the list of graph nodes, where each node has list of all egdes that are incident to it (that is, doors of that room with the direction of each door).
To determine correctness of all doors' directions we can use BFS which uses rooms with fire exits as starting points. Whenever we process a door to an unvisited room, this door must towards the current room. If this rule is violated, then the design is not fire safe.
The complexity of an algorithm is O(V * E), since we visit all rooms and check all the doors once.