Software Engineer Software Developer Interview Questions

466,387 software engineer software developer 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

Viewing 131 - 140 interview questions

See Interview Questions for Similar Jobs

Glassdoor has 466,387 interview questions and reports from Software engineer software developer interviews. Prepare for your interview. Get hired. Love your job.