Google Interview Puzzle

Prove that p^2 – 1 is Divisible by 24

Problem: Prove that p2 – 1 is divisible by 24 if p is a prime number greater than 3? Solution: The most elementary proof , without explicitly mentioning any number theory: out of the three consecutive numbers p–1, p, p+1, one of them must be divisible by 3; also, since the neighbors of p are Read More →

Possible Paths across a Rectangular Grid

Rectangular Grid

Problem: Consider a rectangular grid of 4×3 with lower  left corner named as A and upper right corner named B. Suppose that starting point is A and you can move one step up(U) or one step right(R) only. This is continued until B is reached. How many different paths from A to B possible ? Now let’s Read More →

10 Coins Puzzle

Problem: You are blindfolded and 10 coins are place in front of you on table. You are allowed to touch the coins, but can’t tell which way up they are by feel. You are told that there are 5 coins head up, and 5 coins tails up but not which ones are which. How do Read More →

13 Caves And A Thief Puzzle


Problem: There are 13 caves arranged in a circle. There is a thief  in one of the caves. Each day the the thief can move to any one of adjacent cave or can stay in smae cave in which he was staying the previous day. And each day, cops are allowed to enter any two Read More →

Prisoners and Hats Puzzle


Problem: Four prisoners are arrested for a crime, but the jail is full and the jailer has nowhere to put them. He eventually comes up with the solution of giving them a puzzle so if they succeed they can go free but if they fail they are executed. The jailer puts three of the men Read More →

Age of 3 children – Mathematical Puzzle

Problem: Two old friends, Jack and Bill, meet after a long time. Jack: Hey, how are you man? Bill: Not bad, got married and I have three kids now. Jack: That’s awesome. How old are they? Bill: The product of their ages is 72 and the sum of their ages is the same as your Read More →

100 Doors Puzzle

100 doors toggle puzzle

Puzzle: : You have 100 doors in a row that are all initially closed. you make 100 passes by the doors starting with the first door every time. the first time through you visit every door and toggle the door (if the door is closed, you open it, if its open, you close it). the Read More →

IIT Students and Hats Puzzle

Puzzle: The riddle is Nine IIT students were sitting in a classroom. Their professor wanted them to test. Next day the professor told all of his 9 students that he has 9 hats, The hats either red or black color. He also added that he has at least one hat with red color and the Read More →