15 Mind-Bending Interview Questions That Every Google Engineer Can Answer

googlers 5

Photo: Flickr / Marcin Wichary

You hear a lot about some of the crazy interview questions Google has for all their employees.But engineers are also a class of their own, and have to prove that they know how to code as well as Google expects them to if they want to work there.

So they have to answer even harder, more computational and logic-based questions. We’ve found a bunch of interesting ones on Glassdoor.com, a place where you can rate your interviewing experience,¬†and assembled a list.

We’ve gone through the list with our tech team to try and create a plain English translation for each problem, too.

1. Write an algorithm for integer multiplication

The challenge: This is a more open-ended question designed to coax the engineer to define parameters.

Is the language in Assembly? If so, you have to build basic operations from scratch.

Otherwise, it's easy -- just plug the numbers in, since most languages support arithmetic operations.

2. Merge two sorted linked lists

The challenge: Here's the start to a common trend with Google's interview questions: find an efficient way to solve a problem.

When you merge two 'linked' lists, there tend to be problems with 'conflicts' between the lists (because they have a specific order to them and you are messing with the order).

You have to find an algorithm to quickly eliminate those conflicts.

3. Given a set of intervals (time in seconds) find the set of intervals that overlap

The challenge: Google will also ask you to solve a bunch of maths problems.

They're designed to challenge engineers to think efficiently for problems, not just know how to code each problem.

This one will ask you to implement a clever maths trick.

4. If we had a list of n nodes, what are the maximum number of edges there can be for a directed acyclic graph?

The challenge: This is a variation of the travelling salesman problem, a famous maths problem.

It's a maths problem that's asking you to stretch your brain, not find a clever trick.

You have to draw lines between nodes, but never have a clear path of returning to the original node regardless of where you're starting.

5. What's the difference between finally, final and finalise in Java?

The challenge: The response from our tech team was 'screw Java.' In reality, each term has a very specific meaning.

Google is checking if you know the terminology. For example, finalise has to deal with 'garbage collection', while Finally refers to a specific kind of error.

6. Remove duplicate lines from a large text

The challenge: This is essentially question of whether you can estimate if the problem is solvable in a finite period of time.

You can usually attack a problem with brute force, but it could take forever to solve.

7. Given a string, find the minimum window containing a given set of characters

The challenge: There are a bunch of ways to solve this problem, and it all depends on what algorithm you choose.

Google is looking for the engineer to pick the fastest algorithm.

8. Write a program to compute if one string is a rotation of another

The challenge: This is a question of whether you can bend your knowledge of existing tropes in computing.

For example, 'strings' usually refer to lines of letters, words or something that is meant to be printed and seen. But they can also refer to matrices (a two-dimensional object) and other kinds of objects.

You have to check if you can rotate them and check them against existing strings.

9. How many balloons fit inside of San Francisco?

The challenge: This is the kind of problem a Google interviewer will ask to check what kind of 'boundary conditions' you are setting.

There are a ton of ways to attack this problem, and simplifying it by placing limits on it -- like the square mileage of San Francisco -- is important when it comes to programs.

10. What is the sticky bit and why is it used?

The challenge: A sticky bit is a system administrator term related to settings and permissions.

Google is testing to see if you know some of the finer points of administration -- not just coding.

11. Given a list of integers that fall within a known short but unknown range of values, how to find the median value?

The challenge: This is another problem asking you to implement a clever maths trick that you'd learn in a discrete maths class.

They're not easy problems.

12. Given a set of intervals, find the interval which has the maximum number of intersections.

The challenge: Now Google is asking you to make sure you know you're checking the right parts of the problem and ignoring the fluff in order to run algorithms more efficiently.

13. Array of 100 integers from 1 to 100, shuffled. One integer is taken out, find that integer.

The challenge: This is a problem that can be solved in a few lines of code using another maths trick.

It's testing you to not only know which tricks to use, but how you implement them as code.

14. Judge if a Sudoku solution is right

The challenge: This one is asking you to come up with a way to check a solution arithmetically and quickly with another maths trick.

15. Given the daily values of a stock, find how you can lose the most with one buy-sell trading.

The challenge: This one's a doozie and it's asking you to put everything together.

Check boundary conditions (meaning single out stocks that typically have big moves) and then efficiently compute the biggest swing.

The only decent approach we could think of is to calculate it by brute force, going through each stock.

Those are the technical questions...

NOW WATCH: Tech Insider videos

Want to read a more in-depth view on the trends influencing Australian business and the global economy? BI / Research is designed to help executives and industry leaders understand the major challenges and opportunities for industry, technology, strategy and the economy in the future. Sign up for free at research.businessinsider.com.au.