Total 49 Questions.
Array type of questions were asked in interviews frequently. You will most likely encounter one during your interviews.
LeetCode recommends: Single Number, Rotate Array, Intersection of Two Arrays II and Two Sum.
- Remove Duplicates from Sorted Array
- Best Time to Buy and Sell Stock II
- Rotate Array
- Contains Duplicate
- Single Number
- Intersection of Two Arrays II
- Plus One
- Move Zeroes
- Two Sum
- Valid Sudoku
- Rotate Image
String type of questions were asked in interviews frequently. You will most likely encounter one during your interviews.
LeetCode recommends: Reverse String, First Unique Character in a String, String to Integer (atoi) and Implement strStr().
- Reverse String
- Reverse Integer
- First Unique Character in a String
- Valid Anagram
- Valid Palindrome
- String to Integer (atoi)
- Implement strStr()
- Count and Say
- Longest Common Prefix
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.
LeetCode recommends: Reverse Linked List, Merge Two Sorted Lists and Linked List Cycle.
For additional challenge, solve these problems recursively: Reverse Linked List, Palindrome Linked List and Merge Two Sorted Lists.
- Delete Node in a Linked List
- Remove Nth Node From End of List
- Reverse Linked List
- Merge Two Sorted Lists
- Palindrome Linked List
- Linked List Cycle
Tree is slightly more complex than linked list, because the latter is a linear data structure while the former is not. Tree problems can be solved either breadth-first or depth-first. We have one problem here which is great for practicing breadth-first traversal.
LeetCode recommends: Maximum Depth of Binary Tree, Validate Binary Search Tree, Binary Tree Level Order Traversal and Convert Sorted Array to Binary Search Tree.
- Maximum Depth of Binary Tree
- Validate Binary Search Tree
- Symmetric Tree
- Binary Tree Level Order Traversal
- Convert Sorted Array to Binary Search Tree
Sorting and Searching
These problems deal with sorting or searching in a sorted structure.
LeetCode recommends First Bad Version as a great introduction to a very important algorithm.
Here are some classic Dynamic Programming interview questions.
LeetCode recommends: Climbing Stairs, Best Time to Buy and Sell Stock and Maximum Subarray.
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: Shuffle an Array and Min Stack.
Most of the math questions asked in interviews do not require math knowledge beyond middle school level.
LeetCode recommends: Count Primes and Power of Three.
Here are some other questions that do not fit in other categories.
LeetCode recommends: Number of 1 Bits and Valid Parentheses.