Software Engineers Interview Questions

419,507 software engineers interview questions shared by candidates

Provide a set of positive integers (an array of integers). Each integer represent number of nights user request on Airbnb.com. If you are a host, you need to design and implement an algorithm to find out the maximum number a nights you can accommodate. The constrain is that you have to reserve at least one day between each request, so that you have time to clean the room. Example: 1) Input: [1, 2, 3] ===> output: 4, because you will pick 1 and 3 2) input: [5, 1, 2, 6] ===> output: 11, because you will pick 5 and 6 3) input: [5, 1, 2, 6, 20, 2] ===> output: 27, because you will pick 5, 2, 20
avatar

Software Engineer

Interviewed at Airbnb

4
May 3, 2015

Provide a set of positive integers (an array of integers). Each integer represent number of nights user request on Airbnb.com. If you are a host, you need to design and implement an algorithm to find out the maximum number a nights you can accommodate. The constrain is that you have to reserve at least one day between each request, so that you have time to clean the room. Example: 1) Input: [1, 2, 3] ===> output: 4, because you will pick 1 and 3 2) input: [5, 1, 2, 6] ===> output: 11, because you will pick 5 and 6 3) input: [5, 1, 2, 6, 20, 2] ===> output: 27, because you will pick 5, 2, 20

The question was the following. I'm rephrasing the question to make it clear for everyone to understand: - You are going on a one-way flight trip that includes billions of layovers. - You have 1 ticket for each part of your trip (i.e: if your trip is from city A to city C with a layover in city B, then you will have 1 flight ticket from city A to city B, and 1 flight ticket from city B to city C. - Each layover is unique. You are not stopping twice in the same city. - You forgot the original departure city. - You forgot the final destination city. - All the tickets you have are randomly sorted. Question are: - Design an algorithm to reconstruct your trip with minimum complexity. - How would you improve your algorithm. Example: - randomly sorted: New York->London San Francisco-> Hong Kong Paris->New York London->San Francisco - sorted: Paris->New York New York->London London->San Francisco San Francisco-> Hong Kong
avatar

Software Engineer

Interviewed at Google

4.4
Aug 9, 2009

The question was the following. I'm rephrasing the question to make it clear for everyone to understand: - You are going on a one-way flight trip that includes billions of layovers. - You have 1 ticket for each part of your trip (i.e: if your trip is from city A to city C with a layover in city B, then you will have 1 flight ticket from city A to city B, and 1 flight ticket from city B to city C. - Each layover is unique. You are not stopping twice in the same city. - You forgot the original departure city. - You forgot the final destination city. - All the tickets you have are randomly sorted. Question are: - Design an algorithm to reconstruct your trip with minimum complexity. - How would you improve your algorithm. Example: - randomly sorted: New York->London San Francisco-> Hong Kong Paris->New York London->San Francisco - sorted: Paris->New York New York->London London->San Francisco San Francisco-> Hong Kong

Given a sequence of numbers (34128) and an input map such as a dial pad on a phone (2->[a,b,c], 3->[d,e,f], 4->[g,h,i]) write an algorithm to return all possible words from the sequence. E.g. Input: 232 Output: [ada, adb, adc, aea, aeb, aec, afa, afb, afc, bda, bdb, bdc, bea, beb, bec, bfa, bfb, bfc, cda, cdb, cdc, cea, ceb, cec, cfa, cfb, cfc]
avatar

Software Engineer

Interviewed at Meta

3.6
May 5, 2015

Given a sequence of numbers (34128) and an input map such as a dial pad on a phone (2->[a,b,c], 3->[d,e,f], 4->[g,h,i]) write an algorithm to return all possible words from the sequence. E.g. Input: 232 Output: [ada, adb, adc, aea, aeb, aec, afa, afb, afc, bda, bdb, bdc, bea, beb, bec, bfa, bfb, bfc, cda, cdb, cdc, cea, ceb, cec, cfa, cfb, cfc]

+-----------+ | 1 | 2 | 3 | +-----------+ | 4 | 5 | 6 | +-----------+ | 7 | 8 | 9 | +-----------+ | * | 0 | # | +-----------+ +---+ | U | +---+ +---+ +---+ +---+ | L | | S | | R | +---+ +---+ +---+ +---+ | D | +—+ Input String: "180*", output is the number of minimum operations needed to dial the input */ 2)How do you test login page?
avatar

Software Development Engineer In Test

Interviewed at Amazon

3.5
Oct 11, 2017

+-----------+ | 1 | 2 | 3 | +-----------+ | 4 | 5 | 6 | +-----------+ | 7 | 8 | 9 | +-----------+ | * | 0 | # | +-----------+ +---+ | U | +---+ +---+ +---+ +---+ | L | | S | | R | +---+ +---+ +---+ +---+ | D | +—+ Input String: "180*", output is the number of minimum operations needed to dial the input */ 2)How do you test login page?

Viewing 151 - 160 interview questions

Glassdoor has 419,507 interview questions and reports from Software engineers interviews. Prepare for your interview. Get hired. Love your job.