# Medium Collection Top Interview Questions

Total 51 questions.

## Array and Strings

Array and String type of questions were asked in interviews frequently. You will most likely encounter one during your interviews.

LeetCode recommends: Group Anagrams, Longest Substring Without Repeating Characters, Longest Palindromic Substring and Missing Ranges.

Linked List problems are relatively easy to master. Do not forget the Two-pointer technique, which not only applicable to Array problems but also Linked List problems as well.

Another technique to greatly simplify coding in linked list problems is the dummy node trick.

## Trees and Graphs

Tree is a special type of graphs, so the two usual techniques used to traverse a graph are also applicable to trees.

We recommend: Binary Tree Inorder Traversal, Populating Next Right Pointers in Each Node and Number of Islands.

Note that some of the tree problems can also be asked in n-ary tree format, so make sure you know what an n-ary tree is.

Note: Although Number of Islands is not a tree problem, it can be represented as a graph and therefore LeetCode categorize it as a graph problem.

## Backtracking

Here are some of the best backtracking interview questions.

Letter Combinations of a Phone Number and Generate Parentheses are both great interview questions. Also make sure you are able to write code to generate permutations / subsets (combinations), those are great backtracking exercises too.

## Sorting and Searching

These problems deal with sorting or searching in a sorted structure.

LeetCode recommend: Sort Colors, Search for a Range, Merge Intervals, Search in Rotated Sorted Array, Meeting Rooms II and Search a 2D Matrix II.

## Dynamic Programming

Here are some classic Dynamic Programming interview questions.

LeetCode recommends: Unique Paths, Coin Change and Longest Increasing Subsequence.

## Design

These problems may require you to implement a given interface of a class, and may involve using one or more data structures. These are great exercises to improve your data structure skills.

LeetCode recommends: Serialize and Deserialize Binary Tree and Insert Delete GetRandom O(1).

1. Flatten 2D Vector
2. Serialize and Deserialize Binary Tree
3. Insert Delete GetRandom O(1)
4. Design Tic-Tac-Toe

## Math

Most of the math questions asked in interviews do not require math knowledge beyond middle school level.

LeetCode recommends: Excel Sheet Column Number, Pow(x, n) and Divide Two Integers.

1. Happy Number
2. Factorial Trailing Zeroes
3. Excel Sheet Column Number
4. Pow(x, n)
5. Sqrt(x)
6. Divide Two Integers
7. Fraction to Recurring Decimal

## Others

Here are some other questions that do not fit in other categories.

LeetCode recommends: Majority Element, Find the Celebrity and Task Scheduler.

1. Sum of Two Integers
2. Evaluate Reverse Polish Notation
3. Majority Element
4. Find the Celebrity