Leaving out the very simple and basic Interview Questions, at what questions do the fresh web developers get stuck ? Here is a list :
download a short and sweet PDF
3. Step-by-step solution for step counting using recursion
For example, if you wanted to climb 4 steps, you can take the following distinct number of steps:
4. Determine overlapping numbers in ranges
5. Find all duplicates in an array
This is a common interview question where you need to write a program to find all duplicates in an array. The elements in the array have no restrictions, but in this algorithm we’ll work specifically with integers. Finding duplicates in an array can be solved in linear time by using a hash table to store each element as we pass through the array. The general algorithm is:
6. Two sum problem
The two sum problem is a common interview question, and it is a variation of the subset sum problem. There is a popular dynamic programming solution for the subset sum problem, but for the two sum problem we can actually write an algorithm that runs in O(n) time.
7. Stock maximum profit
You will be given a list of stock prices for a given day and your goal is to return the maximum profit that could have been made by buying a stock at the given price and then selling the stock later on. For example if the input is: [45, 24, 35, 31, 40, 38, 11] then your program should return 16 because if you bought the stock at $24 and sold it at $40, a profit of $16 was made and this is the largest profit that could be made. If no profit could have been made, return -1.