Bit Manipulation
Problems involving bitwise operations and binary representations.
Boolean String Value
Given a string consisting of only 0, 1, A, B, C where A = AND B = OR C =
Find The Depth of a Binary Tree
How will you find the depth of a binary tree?
Check If a Number is Power of Two
What code will you write to check if a number is power of two or not?
Serialize and Deserialize a Binary Tree
Write code to serialize and deserialize a given binary tree.
Storing 1 million phone numbers
What is the most efficient way, memory-wise, to store 1 million phone numbers? Apparently this is an interview question at
int atoi( char* pStr )
Problem: write the definition for this function without using any built-in functions. if pStr is null, return 0. if pStr
Daughters’ Ages
Two MIT math grads bump into each other at Fairway on the upper west side. They haven’t seen each other
Sum it Up
Problem: you are given a sequence of numbers from 1 to n-1 with one of the numbers repeating only once.
Fog Creek Programmers
100 fogcreek programmers are lined up in a row by an assassin. the assassin puts red and blue hats on them.
Bad King
A bad king has a cellar of 1000 bottles of delightful and very expensive wine. A neighbouring queen plots to
Card Trick Without the Trick
This is a card trick without the trick. there is no sleight of hand, no tricks up my sleeve, no
Hard River Crossing
a disfunctional family has to cross the river. on one side of the river are a mom and 2 daughters,
Clock
Part I: what is the angle between the minute hand and the hour hand at 3:15 on an analog clock?
Treasure Island
You find an old treasure map in your grandma’s attic. the map shows a cannon, a coconut tree, and a