Questions
-
Swap pairs of a linked list ( 1 -> 2 -> 3 -> 4 -> 5 to 2 -> 1 -> 4 -> 3 -> 5) Took me way too long, I think I got a correct solution in the end but my interviewer was NOT impressed
-
Given a 2D array, a start point, and end point, devise an algorithm to traverse from the start to end given that there are obstacles in the way. Assume you can only traverse up, down, left and right.
Totally screwed up on this. Approached it using a depth first search instead of a breadth first, didn't realize that either one was that (despite hearing about both before). Also, pseudo code is crap.