# 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

## 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…]

## Cookie Clicker Alpha Solution – Google Code Jam 2014

This is the second problem for Google Code Jam Qualification round 2014, if you are able to solve this problem with the first one(which is very easy) you will be eligible for the next round.

### Problem

In this problem, you start with 0 cookies. You gain cookies at a rate of 2 cookies per second, by clicking on a giant cookie. Any time you have at least **C** cookies, you can buy a cookie farm. Every time you buy a cookie farm, it costs you **C** cookies and gives you an extra **F** cookies per second.

Once you have **X** cookies that you haven’t spent on farms, you win! Figure out how long it will take you to win if you use the best possible strategy.

[Read more…]

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