Skip to content

benjiwright/Blind75CSharp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Blind Top 75 LeetCode Problems - in CSharp

Originally posted New Year Gift - Curated List of Top 75 LeetCode Questions to Save Your Time as a curated list of the top 75 questions to understand when preparing for a FAANGMULA+ interview.

Approach

5 weeks of LeetCode questions broken into categories: sequences, data structures, non-linear data structures, more data structures, and finally dynamic programming as organized here.

Week 1 - Sequences

In week 1, we will warm up by doing a mix of easy and medium questions on arrays and strings. Arrays and strings are the most common types of questions to be found in interviews; gaining familiarity with them will help in building strong fundamentals to better handle tougher questions.

Question Difficulty NeetCode Solution Category Revisit
Two Sum Easy πŸš€ TwoSummer Arrays & Hashing
Contains Duplicate Easy πŸš€ ContainsDuplicater Arrays & Hashing
Best Time to Buy and Sell Stock Easy πŸš€ BuySellStock Sliding Window
Valid Anagram Easy πŸš€ Anagram Strings
Valid Parentheses Easy πŸš€ ValidParentheses Strings
Maximum Subarray Easy πŸš€ MaxSubArrayFinder Sliding Window Y
Product of Array Except Self Medium πŸš€ ProductExceptSelf Arrays & Hashing Y
3Sum Medium πŸš€ 3Summer Arrays & Hashing
Merge Intervals Medium πŸš€ Intervals Intervals
Group Anagrams Medium πŸš€ GroupAnagram Strings
BONUS --- πŸ™ŒπŸ» --- --- ---
Maximum Product Subarray Medium πŸš€ MaxSubArrayFinder DP YES!!!
Search in Rotated Sorted Array Medium πŸš€ SearchRotatedArray Binary Search Y
Two Sum II - Sorted Medium πŸš€ TwoSummer Double Pointers
Insert Interval Medium πŸš€ Intervals Intervals Y

Week 2 - Data structures

The focus of week 2 is on linked lists, strings and matrix-based questions. The goal is to learn the common routines dealing with linked lists, traversing matrices and sequence analysis (arrays/strings) techniques such as sliding window, linked list traversal and matrix traversal.

Question Difficulty NeetCode Solution Category Revisit
Detect Cycle in a Linked List Easy πŸ€·πŸ»β€β™‚οΈ HasCycle Linked Lists
Find Minimum in Rotated Sorted Array Medium πŸ€·πŸ»β€β™‚οΈ SearchRotatedArray Double Pointers
Container With Most Water Medium πŸš€ MaxArea Double Pointers
Longest Repeating Character Replacement Medium πŸš€ CharacterReplacement Double Pointers
Longest Substring Without Repeating Characters Medium πŸ€·πŸ»β€β™‚οΈ LengthOfLongestSubstring Double Pointers
Number of Islands Medium πŸ€·πŸ»β€β™‚οΈ NumIslands Graph
Remove Nth Node From End Of List Medium πŸš€ RemoveNthFromEnd Linked Lists
Palindromic Substrings Medium πŸš€ CountSubstrings Double Pointers
Pacific Atlantic Water Flow Medium πŸš€ PacificAtlantic Graph
Minimum Window Substring Hard πŸš€ MinWindow Sliding Window
BONUS --- πŸ™ŒπŸ» --- --- ---
Find Median from Data Stream Hard πŸš€ MedianFinder.cs Data Structures
Implement Trie (Prefix Tree) Medium πŸš€ Trie.cs Data Structures

Week 3 - Non-linear data structures

The focus of week 3 is on non-linear data structures like trees, graphs and heaps. You should be familiar with the various tree traversal (in-order, pre-order, post-order) algorithms and graph traversal algorithms such as breadth-first search and depth-first search. In my experience, using more advanced graph algorithms (Dijkstra's and Floyd-Warshall) is quite rare and usually not necessary.

Question Difficulty NeetCode Solution Category Revisit
Invert/Flip Binary Tree Easy πŸ€·πŸ»β€β™‚οΈ InvertTree
Validate Binary Search Tree Medium πŸ€·πŸ»β€β™‚οΈ IsValidBST
Non-overlapping Intervals Medium πŸ€·πŸ»β€β™‚οΈ EraseOverlapIntervals
Construct Binary Tree from Preorder and Inorder Traversal Medium πŸ€·πŸ»β€β™‚οΈ TODO
Top K Frequent Elements Medium πŸ€·πŸ»β€β™‚οΈ TopKFrequentUsingHeap
Clone Graph Medium πŸ€·πŸ»β€β™‚οΈ CloneGraph.cs
Course Schedule Medium πŸ€·πŸ»β€β™‚οΈ CourseSchedule.cs
Serialize and Deserialize Binary Tree Hard πŸ€·πŸ»β€β™‚οΈ
Binary Tree Maximum Path Sum Hard πŸ€·πŸ»β€β™‚οΈ
BONUS --- πŸ™ŒπŸ» --- --- ---
Graph Valid Tree Medium πŸš€ ValidTree Graph
Partition Equal Subset Sum Medium πŸš€ CanPartition Meta

Week 4 - More data structures

Week 4 builds up on knowledge from previous weeks but questions are of increased difficulty. Expect to see such level of questions during interviews. You get more practice on more advanced data structures such as (but not exclusively limited to) heaps and tries which are less common but are still asked.

Question Difficulty NeetCode Solution Category Revisit
Subtree of Another Tree Easy πŸ€·πŸ»β€β™‚οΈ IsSubtree BST
Lowest Common Ancestor of BST Easy πŸ€·πŸ»β€β™‚οΈ Leetcode BST
Implement Trie (Prefix Tree) Medium πŸš€ Trie.cs Data Structures
Add and Search Word Medium πŸ€·πŸ»β€β™‚οΈ WordDictionary.cs Trie + DFS
Kth Smallest Element in a BST Medium πŸ€·πŸ»β€β™‚οΈ KthSmallest Tree
Merge k Sorted Lists Hard πŸ€·πŸ»β€β™‚οΈ MergeKLists Week05
Find Median from Data Stream Hard πŸ€·πŸ»β€β™‚οΈ MedianFinder Week02
Insert Interval Medium πŸ€·πŸ»β€β™‚οΈ Insert
Longest Consecutive Sequence Medium πŸ€·πŸ»β€β™‚οΈ LongestConsecutive
Word Search II Hard πŸš€ WordSearchII DP ?
BONUS --- πŸ™ŒπŸ» --- --- ---
Meeting Rooms* Easy πŸ€·πŸ»β€β™‚οΈ CanAttendMeetings Intervals
Meeting Rooms 2* Medium πŸ€·πŸ»β€β™‚οΈ MinMeetingRooms Intervals Y
Number of Connected Components in an Undirected Graph* Medium πŸ€·πŸ»β€β™‚οΈ CountComponents Graph
Alien Dictionary* Hard πŸ€·πŸ»β€β™‚οΈ AlienOrder Kahn TopSort
Valid Palindrome Easy πŸ€·πŸ»β€β™‚οΈ IsPalindrome
Longest Palindromic Substring Medium πŸ€·πŸ»β€β™‚οΈ LongestPalindrome

Week 5 - Dynamic programming

Week 5 focuses on Dynamic Programming (DP) questions. Personally as an interviewer, I'm not a fan of DP questions as they are not really applicable to practical scenarios and frankly if I were made to do the tough DP questions during my interviews I'd not have gotten the job. However, companies like Google still ask DP questions and if joining Google is your dream, DP is unavoidable.

DP questions can be hard to master and the best way to get better at them is... you guessed it - practice! Be familiar with the concepts of memoization and backtracking.

Practically speaking the return of investment (ROI) on studying and practicing for DP questions is very low. Hence DP questions are less important/optional and you should only do them if you have time to spare and you're very keen to have all bases covered (and interviewing with Google).

Question Difficulty NeetCode Solution Category
Climbing Stairs Easy πŸ€·πŸ»β€β™‚οΈ ClimbStairs DP
Coin Change Medium πŸš€ CoinChange DP
Longest Increasing Subsequence Medium πŸ€·πŸ»β€β™‚οΈ LengthOfLIS DP
Combination Sum Medium πŸ€·πŸ»β€β™‚οΈ
House Robber Medium πŸš€ HouseRobber.cs DP
House Robber II Medium πŸ€·πŸ»β€β™‚οΈ
Decode Ways Medium πŸ€·πŸ»β€β™‚οΈ
Unique Paths Medium πŸ€·πŸ»β€β™‚οΈ
Jump Game Medium πŸ€·πŸ»β€β™‚οΈ
Word Break Medium πŸ€·πŸ»β€β™‚οΈ
BONUS --- πŸ™ŒπŸ» --- ---
The Maze Medium πŸ€·πŸ»β€β™‚οΈ SlidingMaze.cs SquareUp
LRU Cache Medium πŸ€·πŸ»β€β™‚οΈ LRUCache LinkList
Random Pick with Weight Medium πŸ€·πŸ»β€β™‚οΈ RandomPick.cs Google
Reorganize String Medium πŸš€ ReorganizeString Space X
Baseball Game EZ πŸš€ CalPoints SpeedRun
Merge k Sorted Lists Hard πŸ€·πŸ»β€β™‚οΈ MergeKLists Competition
Merge Sorted Array EZ πŸš€ Merge x2 ptr
Sort List Medium πŸš€ SortList MergeSort
Buildings With an Ocean View Med πŸ€·πŸ»β€β™‚οΈ FindBuildings FaceBook
Sum of Subarray Ranges EZ/Hard+ πŸ€·πŸ»β€β™‚οΈ SubArrayRanges MonoStack

Week 6 - Just keep grinding problems

Question Difficulty NeetCode Solution Category
Word Break Med πŸ€·πŸ»β€β™‚οΈ WordBreak Recursion/DP
Swim in Rising Water Hard πŸš€ SwimInWater Dj
Min Cost to Connect All Points Med πŸš€ MinSpanTree Prim / MST
Analyze User Website Visit Pattern Med πŸ€·πŸ»β€β™‚οΈ MostVisitedPattern Amazon
Reorder Data in Log Files Med πŸ€·πŸ»β€β™‚οΈ DataLog.cs Amazon
Maximum Units on a Truck Ez πŸ€·πŸ»β€β™‚οΈ MaximumUnits Amazon
Valid Word Abbreviation Ez πŸ€·πŸ»β€β™‚οΈ ValidWordAbbreviation Meta
ValidPalindrome Ez πŸ€·πŸ»β€β™‚οΈ ValidPalindrome Meta
MovingAverage Ez πŸ€·πŸ»β€β™‚οΈ MovingAverage Meta
Zigzag Conversion Med πŸ€·πŸ»β€β™‚οΈ ZigZag Popular
3Sum Closest Med πŸ€·πŸ»β€β™‚οΈ ThreeSumClosest Popular
Roman to Integer Ez πŸ€·πŸ»β€β™‚οΈ RomanToInt Popular
NumUniqueEmails Ez πŸ€·πŸ»β€β™‚οΈ NumUniqueEmails Comp
Shortest Bridge Med πŸš€ ShortestBridge Google
Making A Large Island Hard πŸ€·πŸ»β€β™‚οΈ Island Google
Maximum Points Med πŸš€ MaxScore Google
Trapping Rain Water Hard πŸ€·πŸ»β€β™‚οΈ Trap Popular
Design In-Memory File System Hard πŸ€·πŸ»β€β™‚οΈ FileSystem Popular
Surrounded Regions Med πŸš€ Surround NC
Longest Happy String Med πŸš€ HappyString NC
Count Vowels Permutation Hard πŸš€ CountVowel NC
Largest Number Med πŸš€ LargestNumber NC
Largest Rectangle in Histogram Hard πŸš€ LargestRectangleArea NC
Maximum Frequency Stack Hard πŸš€ FreqStack NC

Helping neetcode.io on code completion for csharp solutions with PR's

Question Difficulty NeetCode Solution
Encode and Decode Strings Med πŸš€ Codec
Permutation in String Med πŸš€ PermutationInString
Sliding Window Maximum Hard πŸš€ SlidingWindowMax
Min Stack Med πŸš€ MinStack
Daily Temperatures Med πŸš€ DailyTemperatures
Koko Eating Bananas Med πŸš€ Bananas
Car Fleet Med πŸš€ CarFleet
Permutations Med πŸš€ Permute
Target Sum Med πŸš€ FindTargetSumWays
Generate Parentheses Med ❓ Generate

DP Challenge

  • What are you the worst at? DP
  • What is the most challenging type of problem? DP
  • What are you going to practice? DP
Question Difficulty Solution
70. Climbing Stairs Easy ClimbStairs
746. Min Cost Climbing Stairs Easy MinCostClimbingStairs
198. House Robber Med Robber1
213. House Robber II Med Rob

🧑 Favorite Resources

Understanding Solutions

Graphs

Design

Other