Coding interview prep
200 algorithms to pass any tech interview
You know the feeling: the whiteboard goes blank, the clock is ticking, and one tricky question decides everything. DEVSMAFIA gives you a structured path through the patterns that actually show up in interviews, so you walk in prepared, not panicking.
Two Number Sum
Easy, Arrays
Write a function that takes in a non-empty array of distinct integers and an integer representing a target sum. If any two numbers in the input array sum up to the target sum, the function should return them in an array, in any order. If no two numbers sum up to the target sum, the function should return an empty array.
Sample Input
array = [3, 5, -4, 8, 11, 1, -1, 6] targetSum = 10
Sample Output
[-1, 11] // os números podem estar em qualquer ordem
function twoNumberSum(array, targetSum) { const seen = new Set(); for (const num of array) { const complement = targetSum - num; if (seen.has(complement)) return [complement, num]; seen.add(num); } return [];}- Test Case 1[3, 5, -4, 8, 11, 1, -1, 6], 10 [-1, 11]Passed
- Test Case 2[4, 6], 10 [4, 6]Passed
- Test Case 3[4, 6, 1], 5 [4, 1]Passed
- 200 problems
- 11 algorithm categories
- EN + PT-BR
- Lifetime access
Built for the interview that changes your career
Big tech interviews are not about memorizing trivia. They test whether you can break a problem down, choose the right approach, and communicate clearly while you code.
We curated 200 original problems across Easy, Medium, Hard, and Very Hard, mirroring the depth you need for companies like Google, Meta, Amazon, and strong startups. Each one includes sample cases, hidden tests, progressive hints, and a full optimal solution with complexity analysis.
Practice in a real IDE in your browser: JavaScript or Python. Run against tests instantly. Reveal hints when you are stuck. Study the solution when you are ready to learn, not when you are guessing.
The full curriculum
Every problem is categorized by topic and difficulty so you always know what to practice next.
31
Easy
73
Medium
58
Hard
38
Very Hard
Arrays
49
Strings
29
Recursion
13
Searching
7
Sorting
8
Greedy Algorithms
7
Binary Search Trees
8
Binary Trees
14
Graphs
20
Linked Lists
12
Dynamic Programming
33
Easy
31 problems. Unlock to practice.
- 001Two Number SumArrays
- 002Validate SubsequenceArrays
- 003Sorted Squared ArrayArrays
- 004Tournament WinnerArrays
- 005Non-Constructible ChangeArrays
- 006Palindrome CheckStrings
- 007Caesar Cipher EncryptorStrings
- 008First Non-Repeating CharacterStrings
- 009Nth FibonacciRecursion
- 010Product SumRecursion
- 011Binary SearchSearching
- 012Find Three Largest NumbersSearching
- 013Bubble SortSorting
- 014Insertion SortSorting
- 015Minimum Waiting TimeGreedy Algorithms
- 016Class PhotosGreedy Algorithms
- 017Tandem BicycleGreedy Algorithms
- 018Monotonic ArrayArrays
- 019Transpose MatrixArrays
- 020Running SumArrays
- 021Anagram CheckStrings
- 022Reverse WordsStrings
- 023Most Frequent CharacterStrings
- 024FactorialRecursion
- 025Selection SortSorting
- 026Find Closest Value in BSTBinary Search Trees
- 027Node DepthsBinary Trees
- 028Depth-First SearchGraphs
- 029Remove Duplicates From Linked ListLinked Lists
- 030Generate DocumentStrings
- 031Power of TwoRecursion
Medium
73 problems. Unlock to practice.
- 032Three Number SumArrays
- 033Smallest DifferenceArrays
- 034Move Element To EndArrays
- 035Array Of ProductsArrays
- 036First Duplicate ValueArrays
- 037Merge Overlapping IntervalsArrays
- 038Spiral TraverseArrays
- 039Longest PeakArrays
- 040Group AnagramsStrings
- 041Longest Substring Without DuplicationStrings
- 042PowersetRecursion
- 043PermutationsRecursion
- 044Quick SortSorting
- 045Merge SortSorting
- 046Validate BSTBinary Search Trees
- 047Invert Binary TreeBinary Trees
- 048Branch SumsBinary Trees
- 049Breadth-First SearchGraphs
- 050Reverse Linked ListLinked Lists
- 051Kadane's AlgorithmDynamic Programming
- 052Max Subset Sum No AdjacentDynamic Programming
- 053Number of Ways to Make ChangeDynamic Programming
- 054Min Number of Coins for ChangeDynamic Programming
- 055Largest RangeArrays
- 056Subarray SortArrays
- 057Majority ElementArrays
- 058Single Cycle CheckArrays
- 059Run-Length EncodingStrings
- 060Search For RangeSearching
- 061Shifted Binary SearchSearching
- 062QuickselectSearching
- 063Three Number SortSorting
- 064River SizesGraphs
- 065Merge Linked ListsLinked Lists
- 066Remove Kth Node From EndLinked Lists
- 067Min Height BSTBinary Search Trees
- 068Find Kth Largest Value in BSTBinary Search Trees
- 069Height Balanced Binary TreeBinary Trees
- 070Minimum Characters For WordsStrings
- 071Valid IP AddressesStrings
- 072Longest Palindromic SubstringStrings
- 073Cycle In GraphGraphs
- 074Sum of Linked ListsLinked Lists
- 075Staircase TraversalDynamic Programming
- 076Number of Ways to Traverse GraphDynamic Programming
- 077Missing NumbersArrays
- 078Next Greater ElementArrays
- 079Valid Starting CityArrays
- 080Zero Sum SubarrayArrays
- 081SemordnilapStrings
- 082Common CharactersStrings
- 083Reverse Words In StringStrings
- 084Balanced BracketsStrings
- 085One EditStrings
- 086Task AssignmentGreedy Algorithms
- 087Min Number Of JumpsDynamic Programming
- 088Search In Sorted MatrixSearching
- 089Phone Number MnemonicsRecursion
- 090Heap SortSorting
- 091BST TraversalBinary Search Trees
- 092Tree Level Order TraversalBinary Trees
- 093Youngest Common AncestorGraphs
- 094Two-ColorableGraphs
- 095Middle NodeLinked Lists
- 096Sunset ViewsArrays
- 097Best SeatArrays
- 098Minimum Area RectangleArrays
- 099Merge Sorted ArraysArrays
- 100Sort StackRecursion
- 101Generate Div TagsRecursion
- 102Optimal FreelancingGreedy Algorithms
- 103Suffix Trie ConstructionStrings
- 104Reverse Polish NotationArrays
Hard
58 problems. Unlock to practice.
- 105Levenshtein DistanceDynamic Programming
- 106Max Sum Increasing SubsequenceDynamic Programming
- 107Longest Common SubsequenceDynamic Programming
- 108Binary Tree DiameterBinary Trees
- 109Knapsack ProblemDynamic Programming
- 110Four Number SumArrays
- 111Min RewardsArrays
- 112Water AreaArrays
- 113Apartment HuntingArrays
- 114Calendar MatchingArrays
- 115Pattern MatcherStrings
- 116Smallest Substring ContainingStrings
- 117Knuth Morris Pratt AlgorithmStrings
- 118Interweaving StringsDynamic Programming
- 119Longest Increasing SubsequenceDynamic Programming
- 120Max Profit With K TransactionsDynamic Programming
- 121Disk StackingDynamic Programming
- 122Numbers In PiDynamic Programming
- 123Maximum Sum SubmatrixDynamic Programming
- 124Dice ThrowsDynamic Programming
- 125Longest String ChainDynamic Programming
- 126Reconstruct BSTBinary Search Trees
- 127Same BSTsBinary Search Trees
- 128Max Path Sum In Binary TreeBinary Trees
- 129Find Nodes Distance KBinary Trees
- 130Remove IslandsGraphs
- 131Minimum Passes Of MatrixGraphs
- 132Linked List PalindromeLinked Lists
- 133Shift Linked ListLinked Lists
- 134Zip Linked ListLinked Lists
- 135Zigzag TraverseArrays
- 136Underscorify SubstringStrings
- 137Index Equals ValueSearching
- 138Radix SortSorting
- 139Sweet And SavoryArrays
- 140Container With Most WaterArrays
- 141Longest Balanced SubstringStrings
- 142Lowest Common ManagerRecursion
- 143Best DigitsGreedy Algorithms
- 144Can JumpGreedy Algorithms
- 145Ambiguous MeasurementsDynamic Programming
- 146Maximize ExpressionDynamic Programming
- 147Juice BottlingDynamic Programming
- 148Palindrome Partitioning Min CutsDynamic Programming
- 149Word BreakDynamic Programming
- 150Decode WaysDynamic Programming
- 151Validate Three NodesBinary Search Trees
- 152All Kinds of Node DepthsBinary Trees
- 153Compare Leaf TraversalBinary Trees
- 154Symmetrical TreeBinary Trees
- 155Split Binary TreeBinary Trees
- 156Evaluate Expression TreeBinary Trees
- 157Largest IslandGraphs
- 158Kruskal's AlgorithmGraphs
- 159Word SearchGraphs
- 160Node SwapLinked Lists
- 161Rearrange Linked ListLinked Lists
- 162Flatten Binary TreeBinary Trees
Very Hard
38 problems. Unlock to practice.
- 163Largest Rectangle Under SkylineArrays
- 164Shorten PathStrings
- 165Count InversionsArrays
- 166Number of Binary Tree TopologiesDynamic Programming
- 167Non-Attacking QueensRecursion
- 168Knight ConnectionGraphs
- 169Square of ZeroesArrays
- 170Airport ConnectionsGraphs
- 171Boggle BoardGraphs
- 172Dijkstra's AlgorithmGraphs
- 173Right Smaller ThanArrays
- 174Multi String SearchStrings
- 175Longest Common SubstringDynamic Programming
- 176Burst BalloonsDynamic Programming
- 177Maximal SquareDynamic Programming
- 178Maximal RectangleDynamic Programming
- 179Longest Palindromic SubsequenceDynamic Programming
- 180Topological SortGraphs
- 181A* AlgorithmGraphs
- 182Two-Edge-Connected GraphGraphs
- 183Count SquaresArrays
- 184Rectangle ManiaArrays
- 185Solve SudokuRecursion
- 186Regular Expression MatchingDynamic Programming
- 187Wildcard MatchingDynamic Programming
- 188Word LadderGraphs
- 189Prim's AlgorithmGraphs
- 190Combination SumRecursion
- 191Max Points on a LineArrays
- 192Trapping Rain Water 2DArrays
- 193Sliding Window MaximumArrays
- 194Median of Two Sorted ArraysArrays
- 195Merge K Sorted ListsLinked Lists
- 196Basic CalculatorStrings
- 197Text JustificationStrings
- 198Remove Invalid ParenthesesStrings
- 199Longest Consecutive SequenceArrays
- 200Max Sum of Three Non-Overlapping SubarraysArrays
Everything you need to get interview-ready
In-browser IDE
Write JavaScript or Python, run sample tests, and submit against hidden cases without leaving the page.
Hints that teach
Reveal guidance step by step when you are stuck, so you learn the pattern instead of copying an answer.
Full explanations
See the optimal approach, time and space complexity, and a clear walkthrough after you try.
English and Portuguese
Every prompt, hint, and explanation is available in natural Brazilian Portuguese and English.
Track your progress
Mark problems as solved, pick up where you left off, and build momentum over time.
How it works
01
Choose a problem
Filter by category, difficulty, or status and start with what matches your level.
02
Code and test
Pick JavaScript or Python, use Run for visible tests, and Submit when you are ready for the full evaluation.
03
Learn and repeat
Use hints and solutions to solidify patterns, then move to the next challenge.
One payment. Full access.
Own the library forever
No subscription. Pay once and keep practicing for as long as you need.
- All 200 algorithm problems
- Hints and optimal solutions
- In-browser editor and test runner (JavaScript & Python)
- Bilingual EN / PT-BR content
- Progress saved to your account
Promotional price. Limited time.
Was $79
$39One-time payment
Lifetime access
You save $40
Less than a single algo coaching session. Yours forever.
Secure Stripe checkout. Instant access, no subscription.
Questions
Is this a subscription?
No. You pay once and get lifetime access to the full library.
Which language do I code in?
The workspace supports JavaScript and Python across all 200 problems. Switch languages anytime. Your code is saved separately for each. Every problem includes reference solutions in both languages.
Are the problems copied from other platforms?
No. They are original problems written for DEVSMAFIA, organized to cover the same topics and difficulty mix you need for real interviews.
When do I get access?
Immediately after checkout. You will be redirected to the practice catalog.
Can I use this if I am not in Brazil?
Yes. English speakers pay in USD. Brazilian users see pricing in BRL.
Own the library forever
No subscription. Pay once and keep practicing for as long as you need.
$79$39
One-time payment, lifetime access
You save $40