Tag Archives: Algorithms

Finding loop in a singly linked-list

You can detect it by simply running two pointers through the list. Start the first pointer p1 on the first node and the second pointer p2 on the second node. Advance the first pointer by one every time through the loop, advance … Continue reading

Posted in Algorithms, Interview Puzzles | Tagged , , , | Leave a comment

100 floors with 2 eggs puzzle

Problem Statement: There is a building of 100 floors  If an egg drops from the Nth floor or above it will break. If it’s dropped from any floor below, it will not break. You’re given 2 eggs. Give an Algorithm to … Continue reading

Posted in Interview Puzzles | Tagged , , , | 1 Comment

The water jug problem

We have three water jugs, and each can hold 3oz., 5oz., and 8oz. of water, respectively. Without the possibility of water spilling when poured from one jug to another, and given that the jugs have no calibration, how do we … Continue reading

Posted in Interview Puzzles, Interview Questions | Tagged , , | 1 Comment