Bridge Crossing Puzzle (Interview Puzzle)

8 years ago Lalit Bhagtani 0
Bridge Crossing Puzzle :- Four people need to cross a rope bridge to get back to their camp at night. Unfortunately, they only have one flashlight and it only has enough light left for 17 minutes. The bridge is too dangerous to cross without a flashlight, and it’s only strong enough to support two people Read More

3 Ants and Triangle Puzzle (Interview Puzzle)

8 years ago Lalit Bhagtani 0
3 Ants and Triangle Puzzle :- There are 3 ants sitting at the three different corners of an equilateral triangle. Now each ant randomly picks a direction and starts moving along the edge of the triangle. What is the probability that none of the ants collide with each other? Now try to solve this on Read More

Rope Puzzle (Interview Puzzle)

8 years ago Lalit Bhagtani 0
Rope Puzzle :- You have given two ropes of varying thickness both are of different density, different width, and different length. Each rope burns in 60 minutes. You have to measure 45 minutes using only these two ropes. Note that you can not cut one rope in half because the ropes are non-homogeneous and you Read More

9 Balls Puzzle (Interview Puzzle)

8 years ago Lalit Bhagtani 0
9 Balls Puzzle :- You have given a two-arm balance scale and 9 identical looking balls. One of the ball is of different weight(heavier/lighter) than rest of the 8 balls, which all are of equal weight. You have to find out the different weight(heavier/lighter) ball and identify whether the ball is heavier or lighter by Read More

8 Balls Weight Puzzle (Interview Puzzle)

8 years ago Lalit Bhagtani 0
8 Balls Weight Puzzle :- You have given a two-arm balance scale and 8 identical looking balls. One of the ball is heavier than rest of the 7 balls, which all are of equal weight. You have to find out the heavier ball by using two arm balance scale a minimum number of times. Now Read More

Flyweight Design Pattern

8 years ago Lalit Bhagtani 0
According to GoF (Gang of Four), flyweight design pattern intent is: “Use sharing to support large numbers of fine-grained objects efficiently” Flyweight design pattern is used when a program need to create huge (usually in thousands or in millions) number of objects of a Class that share (similar) some state among them. By using this design Read More