Two software engineers from Google’s Pittsburgh office deliver a presentation on how to prepare for technical interviews in this Hangout on Air from October 9, 2012. The rundown menu is at the bottom. Head over to http://goo.gl/xSD7jo to learn more about how we hire and to find your role with us. 0:00 – Introductions 0:59… Read More »

I met three dragons. One always tells the truth, other one always lies and the last one alternates between lie and truth. Dragon 1: You may ask us one question, then you must guess which dragon is which Dragon 2: He’s lying. You may get three questions Dragon 3: Oh no. It’s definitely one question

## Right Rotate an array by k elements

An array of elements is given arr arr is of length n Right rotate array by k elements Time complexity O(n) and space complexity O(1) Sample Input: arr = {1,2 ,3,4,5} n = 5 k = 2 Output : arr = {4,5,1,2,3}

## Can you forecast weather?

It is raining at midnight – will we have sunny weather in 72 hours?

## Half full

A half is a third of it. What is it?

## Upside down years

When was the last year that looked the same upside down? (1961)

## Good (or really bad) icebreaker question

A book costs \$1 plus half its price. How much does it cost?

## How many floors can an egg be dropped without breaking?

Question: You have two identical eggs. Standing in front of a 100 floor building, you wonder what is the maximum number of floors from which the egg can be dropped without breaking it. What is the minimum number of tries needed to find out the solution?

## Building a Stack with a getMax() function

Suppose you had a Stack class. Write a new class MaxStack which, in addition to push() and pop(), has a method getMax() which returns the largest item in the stack. Use your existing Stack class to store the stack’s contents. Don’t just use pop() to “dig” through your stack to find the max—do something that… Read More »

## Getting a fair result with an unfair coin

How can you get a fair coin toss if someone hands you a coin that is weighted to come up heads more often than tails?