What questions were you asked in the programming interview for Google, Amazon, Facebook, or Microsoft?

What questions were you asked in the programming interview for Google, Amazon, Facebook, or Microsoft?

Jordan Bishop · September 16 Conducted dozens of technical interviews.

Here are a few examples of questions you can expect to see during an interview with Google, Amazon, Facebook, and Microsoft.

#1 GOOGLE

BEHAVIORAL QUESTIONS

  1. Tell me about a time you were under a lot of pressure. What was going on, and how did you get through it?
  2. Was there a time when you had to work closely with someone whose personality was very different from yours?
  3. Describe a time when it was especially important to make a good impression on a client. How did you go about doing so?
  4. Was there a time where you had to be very strategic to meet all your top priorities?
  5. Do you have an example of a time when you were able to successfully persuade someone to see things your way at work?

TECHNICAL QUESTIONS

  1. Write a function to generate a random number without using any library functions
  2. Given a set of horizontal and vertical line segments, find the number of squares formed by them
  3. Write a function that takes a list L and returns a random sublist of size N of that list. Assume that the indexes must be in increasing order (That is, you cannot go backward)
  4. Given various subsequences of an array, print the overall array
  5. Given 2 strings that are nearly identical except for one extra character, write a function that finds said character

#2 AMAZON

BEHAVIORAL QUESTIONS

  1. Has there ever been a time where you had to handle conflict while working on a team? How did you handle it?
  2. Show me an example of a time when you did not meet a client’s expectations. What happened, and how did you attempt to rectify the situation?
  3. Describe a time when your team or company was undergoing some change. How did that impact you, and how did you adapt?
  4. Describe a long-term project that you managed. How did you keep everything moving along in a timely manner?
  5. Has there ever been a time where you’ve had to rely on written communication to get your ideas across to your team?

TECHNICAL QUESTIONS

  1. Find the minimum number of jumps it will take to reach to the top in a Snake & Ladders game using a recursive function
  2. Multiply two numbers without using the * operator. You are only allowed to use bitwise operations
  3. Given an entire dictionary of English words, what data structures would you use to efficiently store and match a custom regex string like “D*sk”, where * represents any single alphabet letter, and return the list of matched words?
  4. Design a system that will keep track of a product and its inventory count. The service will have two APIs: incrCnt(intProdId, int cnt) and decrCnt(intProdId, int cnt). Which database would you use?
  5. Create a function that gets the sum of all prime numbers up to N

#3 FACEBOOK

BEHAVIORAL QUESTIONS

  1. Tell me about a time you failed. How did you deal with the situation?
  2. Has there ever been a time where you saw a problem and took the initiative to correct it rather than waiting for someone else to do it?
  3. Describe a time when you struggled to build a relationship with someone important. How did you eventually overcome that?
  4. Has there ever been a time where you wish you’d handled a situation differently with a colleague?
  5. Was there ever a time where you made sure a customer was pleased with your service?

TECHNICAL QUESTIONS

  1. Given an array of objects A and an array of indexes B, reorder objects in array A with the indexes given on array B. Do not change array A’s length
  2. Given an integer array and an integer K, find the number of subarrays in which all elements are less than K
  3. Given an integer N, create an array such that each value is repeated twice (For example: n = 3 → [1,1,2,2,3,3])
  4. Given a list of arrays with time intervals, write a function that calculates the total amount of time covered by the intervals
  5. Given the root of a binary tree, print the nodes column-wise and row-wise

#4 MICROSOFT

BEHAVIORAL QUESTIONS

  1. Tell me about a time you set a goal for yourself. How did you go about ensuring that you would meet your objective?
  2. Give me an example of a time when you had to explain something fairly complex to a frustrated client. How did you handle this delicate situation?
  3. Give me an example of a time you were able to be creative with your work. What was exciting or difficult about it?
  4. Give me an example of a time you managed numerous responsibilities. How did you handle that?
  5. Tell me about the first job you’ve ever had. What did you do to learn the ropes?

TECHNICAL QUESTIONS

  1. Design a database schema to store the family tree of a person
  2. Given a list of sorted lists, each of the maximum size M, implement an iterator to maintain the order of items as in the original list of lists
  3. Write a word processor that can do left and right justification for a string sample input
  4. Given a string, find an algorithm that successfully reverses it
  5. Given a number, check if its a super-prime (a number in which both its prefix and suffix numbers are prime numbers)

Since you didn’t quite specify what kind of questions we’re talking about here, I decided to add both behavioral and technical questions, since both aspects are important to grasp in these interviews. As you can see, some of the questions featured are easy, but most of them are moderately difficult and require a pretty solid knowledge of both data structures & algorithms and systems design to be solved.

It’s also important to note that Google pays special attention to skills like communication and leadership skills, so you should study the behavioral aspect just as much as you hone your coding if you’re aiming to have a good performance during your interview with them.


Links to this note