# MOST COMMON Airbnb CODING INTERVIEW QUESTIONS

###### The 15 most asked questions in a airbnb interview

###### ARRAYS

Move zeros to the left

__Problem statement__

Given an integer array, move all elements that are equal to 0 to the left while maintaining the order of other elements in the array.

###### ${title}

Merge overlapping intervals

__Problem statement__

Given a list of intervals, merge all the overlapping intervals to produce a list that has only mutually exclusive intervals.

###### LINKED LISTS

Add two integers

__Problem statement__

Given the head pointers of two linked lists where each linked list represents an integer number (each node is a digit), add them and return the resulting linked list.

###### ${title}

Merge two sorted linked lists

__Problem statement__

Given two sorted linked lists, merge them so that the resulting linked list is also sorted.

###### TREES

Convert binary tree to doubly linked list

__Problem statement__

Convert a binary tree to a doubly linked list so that the order of the doubly linked list is the same as an in-order traversal of the binary tree. After conversion, the left pointer of the node should be pointing to the previous node in the doubly linked list, and the right pointer should be pointing to the next node in the doubly linked list.

###### ${title}

Level order traversal of binary tree

__Problem statement__

Given a binary tree and a number ‘S’, find all paths from root-to-leaf such that the sum of all the node values of each path equals ‘S’.

###### STRINGS

Reverse words in a sentence

__Problem statement__

Reverse the order of words in a given sentence (an array of characters).

###### ${title}

String segmentation

__Problem statement__

Given a dictionary of words and an input string tell whether the input string can be completely segmented into dictionary words.

###### DYNAMIC PROGRAMMING

Find maximum single sell profit

__Problem statement__

Given a list of daily stock prices (integers for simplicity), return the buy and sell prices for making the maximum profit. We need to maximize the single buy/sell profit. If we can't make any profit, we'll try to minimize the loss.

###### MATH AND STATS

Calculate the power of a number

__Problem statement__

Given a double, 'x', and an integer, 'n', write a function to calculate 'x' raised to the power 'n'.

###### BACKTRACKING

Find all possible subsets

__Problem statement__

You are given a set of integers and you have to find all the possible subsets of this set of integers.

###### GRAPHS

Clone a directed graph

__Problem statement__

There is a dictionary containing words from an alien language for which we don’t know the ordering of the characters. Write a method to find the correct order of characters in the alien language.

###### DESIGN

Serialize / deserialize binary tree

__Problem statement__

Serialize a binary tree to a file and then deserialize it back to a tree so that the original and the deserialized trees are identical.

###### SORTING AND SEARCHING

Find the high and low index

__Problem statement__

Given a sorted array of integers, return the low and high index of the given key. Return -1 if not found. The array length can be in the millions with many duplicates.

###### ${title}

Search rotated array

__Problem statement__

Search for a given number in a sorted array that has been rotated by some arbitrary number.