A set of solutions to LeetCode and HackerRank questions that I solved in preparation for software engineering interviews at tech companies. All of these questions are available on LeetCode or HackerRank, and some of them require a subscription to LeetCode Premium.
Having recently graduated from Georgia Tech's OMSCS program, I finished my last semester with an algorithms course, which provided the necessary theoretical background for me start practicing with LeetCode problems almost immediately upon starting my job search. Additionally, I reviewed the following resources concurrently with online practice:
- Cracking the Coding Interview, 6th Edition
- Elements of Programming Interviews in Python
I used Anki to track and review the questions that I completed throughout the process. These are organized by specific subcategories, where a set of questions in one subcategory can and should be solved by applying a common pattern or set of patterns.
Arrays
- Best Time to Buy and Sell Stock
- Best Time to Buy and Sell Stock II
- Contains Duplicate
- Find All Numbers Disappeared in an Array
- Jewels and Stones
- Majority Element
- Merge Sorted Array
- Move Zeroes
- Pascal's Triangle
- Plus One
- Remove Duplicates from Sorted Array
- Rotate Array
- Shortest Distance to a Character
- Single Number
- Two Sum
Backtracking
Bitwise Operations
Dynamic Programming
- House Robber II
- Coin Change
- Maximum Product Subarray
- Longest Increasing Subsequence
- Longest Palindromic Substring
- Word Break
- Combination Sum IV
- Decode Ways
- Unique Paths
- Palindromic Substrings
- Number of Longest Increasing Subsequence
- Partition Equal Subset Sum
- Best Time to Buy and Sell Stock with Cooldown
Fast and Slow Pointers
Graphs
Intervals
Linked Lists
Math
Matrices
Sliding Window
Top K Elements
Topological Sort
Tree: BFS
Tree: Binary Search
- Binary Search
- Find Smallest Letter Greater Than Target
- Peak Index in a Mountain Array
- First Bad Version
Tree: DFS
- Diameter of Binary Tree
- Find Leaves of Binary Tree
- Invert Binary Tree
- Lowest Common Ancestor of a Binary Search Tree
- Maximum Depth of Binary Tree
- Merge Two Binary Trees
- Path Sum
- Same Tree
- Subtree of Another Tree
Two Pointers
The questions were almost exclusively sourced from the following resources: