Easy Collection Top Interview Questions

Total 49 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.

LeetCode recommends: 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

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.

  1. Merge Sorted Array  
  2. First Bad Version

Dynamic Programming

Here are some classic Dynamic Programming interview questions.

LeetCode recommends: Climbing Stairs, Best Time to Buy and Sell Stock and Maximum Subarray.

  1. Climbing Stairs
  2. Best Time to Buy and Sell Stock
  3. Maximum Subarray
  4. House Robber

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: Shuffle an Array and Min Stack.

  1. Shuffle an Array
  2. Min Stack

Math

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.

  1. Fizz Buzz
  2. Count Primes
  3. Power of Three
  4. Roman to Integer

Others

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

LeetCode recommends: Number of 1 Bits and Valid Parentheses.

  1. Number of 1 Bits
  2. Hamming Distance
  3. Reverse Bits
  4. Pascal’s Triangle
  5. Valid Parentheses
  6. Missing Number

One Thought to “Easy Collection Top Interview Questions”

Leave a Reply

Your email address will not be published.