# 100 Must attempt Problems for Coding Interview: Checklist

Powered by OpenGenus IQ because we want you ❤️ to succeed. (How to use this?)
Bookmark this page now (press `CTRL` + `D`) to easily use this masterpiece tomorrow

Only Problems that you need to practice to get prepared for your Coding Interview.
Nothing more, Nothing less.

0/X

## Array problems

• Move Negative elements to front
Move Negative elements to front is a simple problem that tests your knowledge of how to move elements across an array. These involve partition algorithms like Lomuto and Hoare Partition Scheme and has direct application in algorithms like QuickSort.
• 2 Sum Problem
2 Sum problem is a standard problem where you need to find two elements that add up to a given number. The advanced form is to find 2 numbers whose sum to closest to the target.
• 3 Sum Problem
In Interviews, you need to build on problems. 3 Sum problem tests your knowledge from the previous problem.
• 3 Sum Closest Problem
You have attempted the 2 Sum Closest problem variant but can you use similar ideas to solve 3 Sum Closest problem as well.
• 4 Sum Problem
4 Sum problem brings in new ideas and puts your knowledge from previous problems to test. If you are able to solve it, try the 4 Sum Closest problem on your own.

## Stack problems

• 2 Stacks in one Array
This problem of implementing 2 Stacks in 1 array is a simple problem. The main challenge is with the next problem.
• N Stacks in one Array
This problem is much more challenging problem. Understand the solution carefully as this is a HOT interview question now. Similar problem is N Queues in one Array.
• Monotonic Stack
Monotonic Stack is a core technique which exploits the properties of Stack to solve several challenging problems. Go through some example problems to hone your skills.
• Merge Intervals
The problem of Merge Intervals is a HOT interview problem. It is, often formulate as Time interval or duration of an event.

## Binary Tree

• Diameter and Height
Finding the Diameter and Height of a Binary Tree is a simple yet core problem that everyone should be fluent in. Every few students know that the average height of a random Binary Tree is O(N^0.5) (see how?).
• No NULL implementation
Implementing Binary Tree with no NULLs is an approach that sets you apart from other candidates. Avoiding NULLs is Industry standard.
• Largest Independent Set
Finding the Largest Independent Set in Binary Tree is a problem that requires the application of Dynamic Programming. This is an important interview problem.
• Copy Binary Tree
Copying a Binary Tree with random pointers is a challenging problem. The trick is to handle the random pointers efficiently as the destination node may not have been processed. A related concept is Threaded Binary Tree.
• Traversal of Binary Tree
Zig Zag traversal and Level Order traversal of a Binary Tree is a problem that tests your Binary Tree handling skills. Different types of view of a Binary Tree is equally important problem.
• Self-balancing Trees
Self-balancing Trees are important concepts. Interviewers usually ask to list a few self-balancing binary trees. Some advanced levels may ask to explain the idea behind Red Black Tree.
A HOT interview question is to design a spreadsheet / Excel sheet. This ivolve the idea of using Binary Tree.

## Trie problems

• Maximum XOR of two numbers
This problem of finding the Maximum XOR of two numbers involve the use of Trie data structure which is not obvious from the problem statement.
• Longest Common Suffix
This is a HOT interview problem. Finding the Longest Common Suffix cannot be done efficiently using Trie. Similarly, you can solve the Longest Common Prefix problem.
• All Valid Word Breaks of a Sentence
Word Break Problem is a standard problem that involve the use of DP and Greedy algorithms. This variant: All Valid Word Breaks of a Sentence use Trie to solve it optimally.
• Autocomplete feature
Autocomplete feature is the most common feature of True data structure and Interviews revolve around this specific application.

## Greedy Algorithms

• Activity Selection Problem
Activity Selection Problem is one of the important problems where Greedy Algorithm is the direct solution. A variant of this: Scheduling tasks to Minimize Lateness is a critical Interview problem.
• Egyptian Fraction Problem
Egyptian Fraction Problem is an important Interview problem that lies at the intersection of Mathematical and Greedy Algorithms.
• Fractional Knapsack Problem
Fractional Knapsack Problem is a variant of Knapsack Problems that can be solved using Greedy Algorithms.
• Largest Cube Formed
The problem of Largest Cube Formed by deleting digits is interesting because of Time Complexity Analysis which many may get wrong in Interviews. It is O(N1/3 logN logN).
• Maximal Clique
Greedy Algorithms are also applied on Graph based problems. Finding Single Maximal Clique is a challenging Interview problem that is asked.
• Fitting Shelves Problem
This problem of Fitting Shelves is HOT interview problem requiring Greedy Algorithm.

## Backtracking problems

• Backtracking Algorithm for Sudoku
Solving Sudoku using Backtracking is a standard technique though the implementation strategy is challenging in an Interview setting.
• 8 Queens Problem
Solving 8 Queens Problem using Backtracking is yet another important Interview problem. In similar chess setting, MCQs on number of possibilities of a given condition are asked frequently.
• Subset Sum Problem
Subset Sum Problem is a very common problem and many try to solve it using DP. Very few practice a variant where Backtracking is applied on Subset Sum Problem.
• Knight's Tour Problem
In case of problems dealing with Chess, Backtracking is a potential technique. Solving Knight's Tour Problem is important for Interviews and involve Backtracking and Warnsdorff's algorithm.
• Word Break Problem
Word Break Problem is an important Interview problem that involve concepts like Backtracking and Dynamic Programming.

## Divide and Conquer

• Closest Pair of Points
Closest Pair of Points is the most important Interview Problem based on Geometry and uses the concept of Divide and Conquer to solve it.
• Karatsuba Algorithm
Very few realize that there are algorithms that optimized fundamental operations like Multiplication. Karatsuba Algorithm uses the concept of Divide and Conquer to multiply two number efficiently.
• Floor in sorted array
Finding floor in sorted array is an easy problem that is asked in Interviews. Having a good hold on Binary Search is a must.
• Elements with difference K
Finding 2 elements with difference K in a sorted array is a fundamental problem that many get wrong.
• Peak Element in an Array
The problem of finding Peak Element in an Array tests your understanding of Divide and Conquer technique.

## Decrease and Conquer

• Fake Coin Problem
Fake Coin Problem is the most frequently asked Interview Problem that involve the concept of Decrease and Conquer. Very few use this technique.
• Basics of Decrease & Conquer
Revise the basics of Decrease and Conquer along with overview of fundamental problems.