Skip to content

Instantly share code, notes, and snippets.

@adam-dev2
Created September 4, 2025 10:04
Show Gist options
  • Select an option

  • Save adam-dev2/08e762b0d4d23825ddfa9fbdbd4d4a4a to your computer and use it in GitHub Desktop.

Select an option

Save adam-dev2/08e762b0d4d23825ddfa9fbdbd4d4a4a to your computer and use it in GitHub Desktop.

Arrays & Hashing (must-know)

  1. Two Sum - DONE

  2. Best Time to Buy and Sell Stock - DONE

  3. Contains Duplicate - DONE

  4. Product of Array Except Self - DONE

    1. it is solved using prefix * suffix like it accumulates the the previous product like current element contains so far previous product and now this element is going to be multiplied with the such element who has the so far suffix product then the resultant array is the answer
  5. Maximum Subarray (Kadane’s) - DONE

    1. in this i truly understand about greedy approach whihc basically mean carrying forward the best / optimal solution of this current condition like making optimal decision at every decision brings up to the optimal final solution
  6. Maximum Product Subarray - DONE

    1. solved this by maintaining the min and max of the current descision and find the max of it
  7. Find Minimum in Rotated Sorted Array

  8. Search in Rotated Sorted Array

  9. 3Sum

  10. Merge Intervals


Two Pointers / Sliding Window

  1. Valid Palindrome

  2. 3Sum Closest

  3. Container With Most Water

  4. Trapping Rain Water

  5. Longest Substring Without Repeating Characters

  6. Minimum Window Substring

  7. Longest Repeating Character Replacement

  8. Permutation in String

  9. Subarray Product Less Than K

  10. Sliding Window Maximum


Stack / Monotonic Structures

  1. Valid Parentheses

  2. Min Stack

  3. Evaluate Reverse Polish Notation

  4. Daily Temperatures

  5. Next Greater Element I/II

  6. Largest Rectangle in Histogram


Binary Search

  1. Binary Search

  2. First Bad Version

  3. Search a 2D Matrix

  4. Koko Eating Bananas (classic BS on answer)

  5. Median of Two Sorted Arrays (advanced)


Linked List

  1. Reverse Linked List

  2. Merge Two Sorted Lists

  3. Linked List Cycle

  4. Remove Nth Node From End of List

  5. Reorder List


Trees / Graphs

  1. Maximum Depth of Binary Tree

  2. Same Tree

  3. Invert Binary Tree

  4. Subtree of Another Tree

  5. Lowest Common Ancestor of a BST

  6. Binary Tree Level Order Traversal

  7. Validate Binary Search Tree

  8. Diameter of Binary Tree

  9. Serialize and Deserialize Binary Tree (if advanced expected)

  10. Number of Islands (graph DFS/BFS classic)

  11. Clone Graph

  12. Course Schedule (topological sort)


Dynamic Programming (intro level)

  1. Climbing Stairs

  2. Coin Change

(If you get more time, add: Longest Increasing Subsequence, House Robber I & II, Unique Paths, Word Break.)


Why these 50?

  • Covers 90% of patterns interviewers like to test.

  • Balanced between easy/medium with a handful of hard (to show range).

  • Prepares you for array/string-heavy interviews (common for junior/associate roles).

  • Graph/DP included but only the high-yield ones.


I’d suggest studying in pattern buckets, not random problems. For example:

  • Do 5–6 sliding window in a row → pattern clicks.

  • Same for binary search on answer → once you get it, all similar questions feel easy.


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment