Welcome to MindCipher, a social repository of the world's greatest brain teasers, logic puzzles and mental challenges.
15 12 Swap Variables in Place without XOR
Suppose you have two variables, a and b. How can you swap their values without using a temporary variable and also without using the bitwise operator XOR?
18 7 Going to the Track
The London racetrack needs to submit its top three horses to the Kentucky Derby next month in order to compete for a prize. However in a recent electrical storm, all the racetrack's previous race histo ...
logic mathematics Submitted by Nikhil
13 13 Bit Pair Swap
In one line of C or Java, how would you swap every pair of bits in a byte? That is, swap bits 0 and 1, 2 and 3, 4 and 5, 6 and 7. Example: 0110 1010 becomes 1001 0101.
19 5 Odd Pills
Your pharmacist gives you 5 jars filled with pills. The pills contained in each jar have an identical appearance and size (i.e. if you mixed all of the pills you wouldn't be able to tell them apart). ...
3 2 Brain Teaser 56
Answer Yes or No to this brain teaser
3 1 No if() no abs()!
This is inspired by the puzzle "No if() only abs()" : Given two variable a and b, construct a function f(a,b) which return the maximum one in {a,b}. You can only use +- ยท / (basic arithmetic operator ...
11 6 The double-square number problem
It's said that a number N with 4 digits is a double-square number when it equals the sum of the squares of two numbers: one formed by the first two digits of N, in the order they appear in N and the ot ...
Math mathematics Submitted by Guilherme
2 6 How many?
As I was going to St. Ives, I met a man with seven wives. Each wife had seven sacks. Each sack has seven cats. Each cat had seven kits. Kits, cats, sacks, and wives, How many were going to St. Ives? ...
Submitted by Gene
3 6 Death by drawing?
You are a prisoner in a strange foreign land, and a random drawing will decide your fate. You are given 2 bags, 10 white marbles, and 10 black marbles. You are to place the marbles in the bags in any a ...
probability Submitted by Gene
7 8 Survivor
There are 1500 people sitting around a circular table. They are numbered in a regular manner (1 to 1500 along the table). Now, the 1st person gets a sword and kills the 2nd person. He then gives the s ...
Submitted by Shaheen
10 16 3 Coins
Not sure what the answer is, ideas welcome! You have 3 coins, one always comes up heads, the second always comes up tails, and the third is a fair coin. You select a coin at random. After selecting ...
Math help Submitted by city_slick
11 4 Carpeting a Donut
Given two concentric circles and a chord of the outer circle, tangent to the inner circle, of length 25m, find the area between the two circles. See illustration. No other information needed, all you n ...
6 6 Binary 5 digits
What is the base 10 equivalent of the highest 5 digit binary number?
14 1 100 Light Bulbs
There are 100 light switches, all of them are off. First, you walk by them, turning all of them on. Next, you walk by them turning every other one off. Then, you walk by them changing every third on ...
mathematical logical Submitted by Aakash
9 9 Fork in the road
You are walking down a road and arrive at a fork that splits the road into two separate paths. When you reach, you meet two identical twins, each standing at the edge of one of the two paths. You h ...
Submitted by Aakash