geekological

metonym.in

Your friend for GRE words and Vocabulary. Find here

geekological

/Debjyoti

About Debjyoti

This author has not yet filled in any details.
So far has created 76 blog entries.

Central Point (April 2011)

By |October 14th, 2012|

Given a set of N integer points on the Cartesian plane. Your task is to find an integer point satisfying its sum of distances to N given points (S) is minimum.
Input
There are several test cases (fifteen at most), each formed as follows:

The first line contains a positive integer N (N ≤ 2,000).
N lines follow, each […]

Call by address vs Call by reference in C++ (Most Relevant answer)

By |October 13th, 2012|

Call by Address
In call by address, instead of passing the actual values of the actual argument we pass addresses of actual values. Whenever we deal with addresses, we must know how to handle them. That’s why before discussing call by address, we will briefly discuss pointers that handle addresses.
Introduction to Pointers
We all know that the […]

IEEE 754 analyzer

By |October 12th, 2012|

Nice tool to clear your doubts regarding IEEE 754 representation

http://babbage.cs.qc.cuny.edu/IEEE-754/

Four People on a Rickety Bridge

By |October 9th, 2012|

Question: Four people need to cross a rickety bridge at night. Unfortunately, they have only one torch and the bridge is too dangerous to cross without one. The bridge is only strong enough to support two people at a time. Not all people take the same time to cross the bridge. Times for each person:  1 min, 2 mins, 7 mins and 10 mins. What is the shortest time needed for all four of them to cross the bridge?

[…]

Globe Walker puzzle

By |October 9th, 2012|

Question: How many points are there on the globe where, by walking one mile south, then one mile east and then one mile north, you would reach the place where you started?
[…]

Gold for 7 Days of Work

By |October 9th, 2012|

Question: You’ve got someone working for you for seven days and a gold bar to pay them. You must pay the worker for their work at the end of every day. If you are only allowed to make two breaks in the gold bar, how do you pay your worker? (Assuming equal amount of work is done during each day thus requiring equal amount of pay for each day)

[…]

100 Prisoners in Solitary Cells

By |October 9th, 2012|

100 prisoners are stuck in the prison in solitary cells. The warden of the prison got bored one day and offered them a challenge. He will put one prisoner per day, selected at random (a prisoner can be selected more than once), into a special room with a light bulb and a switch which controls the bulb. No other prisoners can see or control the light bulb. The prisoner in the special room can either turn on the bulb, turn off the bulb or do nothing. On any day, the prisoners can stop this process and say “Every prisoner has been in the special room at least once”. If that happens to be true, all the prisoners will be set free. If it is false, then all the prisoners will be executed. The prisoners are given some time to discuss and figure out a solution. How do they ensure they all go free?

[…]

“Is Your Husband a Cheat?” Puzzle

By |October 9th, 2012|

A certain town comprises of 100 married couples. Everyone in the town lives by the following rule: If a husband cheats on his wife, the husband is executed as soon as his wife finds out about him. All the women in the town only gossip about the husbands of other women. No woman ever tells another woman if her husband is cheating on her.  So every woman in the town knows about all the cheating husbands in the town except her own. It can also be assumed that a husband remains silent about his infidelity. One day, the mayor of the town announces to the whole town that there is at least 1 cheating husband in the town. What do you think happens?

[…]

Clock Hands

By |October 9th, 2012|

How many times a day do the minute and hour hands of a clock overlap?

[…]

BumbleBee Puzzle

By |October 9th, 2012|

Two trains enter a tunnel 200 miles long (yeah, its a big tunnel) travelling at 100 mph at the same time from opposite directions. as soon as they enter the tunnel a supersonic bee flying at 1000 mph starts from one train and heads toward the other one. as soon as it reaches the other one it turns around and heads back toward the first, going back and forth between the trains until the trains collide in a fiery explosion in the middle of the tunnel (the bee survives). how far did the bee travel? […]

Bucket Puzzle

By |October 9th, 2012|

You have two buckets one with capacity of 5 Liters and the other with a capacity of 3 Liters. You have to measure 4 Liters using the two buckets.How will you do it??

[…]

Rope Puzzle

By |October 9th, 2012|

Well this puzzle is asked in most of the interview questions. You are given two ropes of same width and length.The two ropes will burn completely in 1 hour.
You have to estimate 1.5 hours using the ropes.Please note that the ropes are not of uniform cross section. So it may happen that 60% of rope burns in 0.5 hour and the remaining in 0.5 hour.

[…]

1000 Bottle Puzzle

By |October 9th, 2012|

A king has 1000 bottles of wine of same type.His rival king decides to kill him and send his secret killer to poison one of this wine bottle.The killer poison one of his bottle but was caught by the guards.The King came to know about this and he decides to check which bottle is poisonous. The king is very clever so he decides to take 10 prisoners from his jail to check which bottle is poisonous or not. Can you explain how it is possible?

[…]

Bridge Crossing Puzzle I

By |October 9th, 2012|

This is a classic puzzle asked in most of the interview questions. Well there are four persons A,B,C and D. All the four persons takes different times to cross the bridge.
person A :1 minute
person B :2 minutes
person C :5 minutes
person D :10 minutes
There is only one Torch available and it is required in crossing the bridge.Two persons can cross the bridge at the same time but will take the time the of the slower one.For Example : if A and C wants to cross the bridge first they will take 5 minutes. All the four persons can come to the other side in 17 minutes. Can you Explain how?

[…]

Ants on a Triangle Puzzle

By |October 9th, 2012|

This is one of the good probability puzzle asked in interview questions. There are 3 ants on each corner of a triangle. At a given point of time they all start together for a different corner at random.What is the probability that they will not collide.

[…]