A spinning disc is painted black on one half and white on the other (i.e., the line forming the border between the black and white regions of the disc is a diameter of the disc). The disk is spinning on a turntable in an unknown direction at an unknown speed. You have special video cameras that can observe the color of a single point on the disc. How many cameras do you need to determine the direction the disc is spinning?

# Interview Questions

Together with logical puzzles and interview puzzles, an interviewee needs to prepare well for other interview questions as well. We created this section with the aim to share quality interview questions with answers with the goal to represent the questions in easy to read format. We will be sharing interview question which are generally asked in top notch companies like Google, Amazon, Yahoo, Microsoft etc.

## Collection of Interview Questions

## Three blue and two red hats puzzle

At a party, four people played a game. Three of them sat one behind the other, so that Abe saw Bill and Cal, and Bill only saw Cal, who sat in front and saw nobody else.

Dave had 5 hats which he showed to his three friends. Three of the hats were blue and two were red.

Now Dave placed a hat on the head of each of his three friends, putting aside the remaining two hats.

Then he asked Abe what color his hat was.

Abe said he couldn’t tell.

Bill was asked the color of his own hat, but he didn’t know for certain either.

Cal, though he couldn’t see any hat at all, gave the right answer when asked what color his hat was.

Do you know what color Cal’s hat was and how he reasoned to find out the correct answer?

[Read more…]

## 2nd smallest number from 32 numbers

**You have 32 numbers. What is the least number of comparison needed to find the 2nd smallest out of them?**

## Find Number present only once

**Write an algorithm to find out a number from an ****array of numbers where only one number occurs once and rest ****all occurs twice.**

**Note: Without using extra O(n) space and in O(n).**

[Read more…]

## Average speed of train

**A train is going at a speed of 60kmph towards Delhi ****and returned back at a speed of 30kmph. What is its average ****speed?**

[Read more…]

## Output of the recursive program

**what will be the output of this program**

void print (int n) { if (n>0) { printf(“hello”); print(n-1); } printf(“world”); }

## Full Binary Tree Solution – Google Code Jam

This is the second problem in Google Code Jam 2014, Round 1A

This problem is based on all time favorite of interviewers Binary Tree, you need to find out the minimum number of node to delete to make the given binary tree(in graph form, for any connection in X and Y, you can consider X as child of Y or vice verse) as Full Binary Tree.

[Read more…]

## Charging Chaos Solution – Google CodeJam

**First problem in Google CodeJam 2014, Round 1A**

Its about getting the minimum number of switch you need to do to get the desired electric flow.

[Read more…]

## Deceitful War Solution – Google Code Jam 2014

4th problem in google code jam qualification round 2014

### Problem

Naomi and Ken sometimes play games together. Before they play, each of them gets **N**identical-looking blocks of wood with masses between 0.0kg and 1.0kg (exclusive). All of the blocks have different weights. There are lots of games they could play with those blocks, but they usually play something they call War.

## Minesweeper Master Solution – Google Code jam 2014

This is the third problem of google code jam qualification round 2014. This problem is based on very famous old game Minesweeper, i am pretty much sure you must have played it, its now time to create the board yourself, such that you know the position to click on, to win the game in just one click.

### Problem

*Minesweeper* is a computer game that became popular in the 1980s, and is still included in some versions of the *Microsoft Windows* operating system. This problem has a similar idea, but it does not assume you have played *Minesweeper*.

[Read more…]

- 1
- 2
- 3
- …
- 5
- Next Page »