Easy Collection Top Interview Questions

Array

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.

  1. Remove Duplicates from Sorted Array
  2. Best Time to Buy and Sell Stock II  
  3. Rotate Array  
  4. Contains Duplicate  
  5. Single Number
  6. Intersection of Two Arrays II  
  7. Plus One  
  8. Move Zeroes  
  9. Two Sum  
  10. Valid Sudoku  
  11. Rotate Image

Strings

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().

  1. Reverse String
  2. Reverse Integer
  3. First Unique Character in a String  
  4. Valid Anagram  
  5. Valid Palindrome  
  6. String to Integer (atoi)  
  7. Implement strStr()  
  8. Count and Say  
  9. Longest Common Prefix

Linked List

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.

  1. Delete Node in a Linked List
  2. Remove Nth Node From End of List
  3. Reverse Linked List
  4. Merge Two Sorted Lists  
  5. Palindrome Linked List
  6. Linked List Cycle

Trees

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.

We recommend: Maximum Depth of Binary Tree, Validate Binary Search Tree, Binary Tree Level Order Traversal and Convert Sorted Array to Binary Search Tree.

  1. Maximum Depth of Binary Tree
  2. Validate Binary Search Tree
  3. Symmetric Tree
  4. Binary Tree Level Order Traversal
  5. Convert Sorted Array to Binary Search Tree

Leave a Reply

Your email address will not be published. Required fields are marked *