Skip to content

175 efficient solutions to must-know interview problems

Notifications You must be signed in to change notification settings

SegopotsoMakhutja/Interview_solutions

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

76 Commits
 
 
 
 
 
 

Repository files navigation

Cracking the Coding Interview

Section Question Solution Difficulty Great Problem
1.1 Is Unique Solution Easy *
1.2 Check Permutations Solution Easy
1.3 URLify Solution Easy *
1.4 Palindrome Permutation Solution Easy *
1.5 One Away Solution Medium *
1.7 Rotate Matrix Solution Hard *
1.8 Zero Matrix Solution Easy *
1.9 String Rotation Solution Easy
2 - Intro Implement a List Solution Easy *
2.1 Remove Dups Solution Easy *
2.2 Return Kth to Last Solution Easy
2.3 Delete Middle Node Solution Easy
2.4 Partition Solution Medium *
2.5 Sum Lists Solution Medium
2.6 Palindrome Solution Medium *
2.7 Intersection Solution Medium *
2.8 Loop Detection Solution Hard *
3 - Intro Implement a Stack Solution Easy *
3 - Intro Implement a Queue Solution Easy *
3.1 Three in One Solution Medium
3.2 Stack Min Solution Medium *
3.4 Queue via Stacks Solution Medium *
3.5 Sort Stack Solution Medium *
4 - Intro Implement a TreeNode Solution Easy *
4 - Intro Pre-In-Post order Traversals Solution Easy *
4 - Intro Implement a GraphNode Solution Easy *
4 - Intro Breadth-First Search (BFS) Solution Medium *
4 - Intro Depth-First Search (DFS) Solution Medium *
4 - Intro Bidirectional Search Solution Easy *
4.01 Route Between Nodes Solution Easy *
4.02 Minimal Tree Solution Medium *
4.03 List of Depths Solution Medium *
4.04 Check Balanced Solution Medium *
4.05 Validate BST Solution Medium *
4.06 Successor Solution Medium *
4.07 Build Order Solution Hard *
4.08 First Common Ancestor Solution Hard *
4.09 BST Sequences Solution Hard
4.10 Check Subtree Solution Medium
4.11 Random Node Solution Hard *
4.12 Paths with Sum Solution Hard *
5 - Intro BitFunctions: getBit Solution Easy
5 - Intro BitFunctions: setBit Solution Easy
5 - Intro BitFunctions: clearBit Solution Easy
5.2 Binary to String Solution Medium
5.3 Flip Bit to Win Solution Medium
5.4 Next Number Solution Hard
5.6 Conversion Solution Easy
5.7 Pairwise Swap Solution Medium
6 - Intro Prime - isPrime Solution Easy
6 - Intro Prime - generate Primes Solution Medium
7.12 Hash Table Solution Hard *
8 - Intro Fibonacci Solution Easy *
8.01 Triple Step Solution Easy *
8.02 Robot in a Grid Solution Hard
8.03 Magic Index Solution Medium *
8.04 Power Set Solution Hard *
8.05 Recursive Multiply Solution Medium *
8.06 Towers of Hanoi Solution Hard *
8.08 Permutations with Dups Solution Hard *
8.09 Parens Solution Medium *
8.11 Coins Solution Hard *
8.12 Eight Queens Solution Hard *
8.13 Stack of Boxes Solution Hard *
9 - Intro 4 Ways to Divide Data Solution Medium *
9 - Intro Find Words in Millions of Documents Solution Easy *
9.4 Duplicate URLs Solution Medium *
9.5 Cache Solution Medium *
10 - Intro Binary Search Solution Easy *
10 - Intro Merge Sort Solution Hard *
10 - Intro Quick Sort Solution Hard *
10.01 Sorted Merge Solution Easy
10.02 Group Anagrams Solution Medium *
10.03 Search in Rotated Array Solution Medium *
10.04 Sorted Search No Size Solution Medium *
10.06 Sort Big File Solution Medium *
10.07 Missing Int Solution Hard
10.08 Find Duplicates Solution Easy *
10.09 Sorted Matrix Search Solution Medium *
10.10 Rank from Stream Solution Hard *
10.11 Peaks and Valleys Solution Easy *
Book Intro Math cubes Solution Medium *
7.09 Circular Array Solution Medium *
13.5 TreeMap, HashMap, LinkedHashMap Solution Easy *
15.1 Thread vs. Process Solution Medium
15.4 Deadlock-Free Class Solution Medium
15.5 Call in Order Solution Medium
15.6 Synchronized Methods Solution Easy
16.01 Number Swapper Solution Medium
16.04 Tic Tac Win Solution Medium *
16.05 Factorial Zeros Solution Medium *
16.06 Smallest Difference Solution Medium *
16.08 English Int Solution Medium *
16.10 Living People Solution Medium *
16.11 Diving Board Solution Easy *
16.14 Best Line Solution Hard *
16.15 Master Mind Solution Medium
16.16 Sub Sort Solution Medium *
16.17 Contiguous Sequence Solution Medium *
16.18 Pattern Matching Solution Hard *
16.19 Pond Sizes Solution Medium *
16.20 T9 Solution Medium *
16.21 Sum Swap Solution Medium *
16.22 Langtons Ant Solution Easy *
16.23 Rand7 from Rand5 Solution Medium *
16.24 Pairs with Sum Solution Medium *
16.25 LRU Cache Solution Hard *
17.01 Add Without Plus Solution Medium *
17.02 Shuffle Solution Hard *
17.03 Random Set Solution Hard *
17.05 Letters and Numbers Solution Hard *
17.07 Baby Names Solution Easy *
17.09 Kth Multiple Solution Hard *
17.10 Majority Element Solution Hard *
17.11 Word Distance Solution Medium *
17.12 BiNode Solution Hard *
17.14 Smallest K Solution Medium *
17.15 Longest Word Solution Hard *
17.16 The Masseuse Solution Medium *
17.18 Shortest Supersequence Solution Hard *
17.19 Missing Two Solution Medium *
17.20 Continous Median Solution Hard *
17.21 Volume of Histogram Solution Medium *
17.22 Word Transformer Solution Hard *
17.23 Max Black Square Solution Hard *
17.24 Max Submatrix Solution Hard *

LeetCode

# Question Solution Difficulty Great Problem
15 3sum Solution Medium *
16 3sum Closest Solution Medium *
20 Valid Parentheses Solution Easy *
21 Merge Two Sorted Lists Solution Easy *
23 Merge k Sorted Lists Solution Hard *
28 Implement strStr() Solution Easy *
98 Validate Binary Search Tree Solution Medium *
104 Maximum Depth of Binary Tree Solution Easy *
136 Single Number Solution Easy *
141 Linked List Cycle Solution Easy *
143 Reorder List Solution Medium *
151 Reverse Words in a String Solution Medium *
162 Find Peak Element Solution Medium *
189 Rotate Array Solution Easy *
200 Number of Islands Solution Medium *
206 Reverse Linked List Solution Easy *
300 Longest Increasing Subsequence Solution Medium *
347 Top K Frequent Elements Solution Medium *
518 Coin Change 2 Solution Medium *
560 Subarray Sum Equals K Solution Medium *
692 Top K Frequent Words Solution Medium *
695 Max Area of Island Solution Medium *
1013 Pairs of Songs With Total Durations Divisible by 60 Solution Easy *

LeetFree

# Question Solution Difficulty Great Problem
694 Number of Distinct Islands Solution Medium *
711 Number of Distinct Islands II Solution Hard

HackerRank

Question Solution Difficulty Great Problem
Linked List - Print in Reverse Solution Easy *
Linked List - Get Node Value Solution Easy *
Counting Sort Solution Medium *
Reverse a Doubly Linked List Solution Medium *
Tree - Level Order Traversal Solution Medium *
Java 1D Array Solution Medium *
Java Dequeue Solution Medium *
Java Singleton Solution Medium *
Contacts Solution Hard *
Array Manipulation Solution Hard *
Electronics Shop Solution Easy
Minimum Distances Solution Easy
Find Digits Solution Easy
Picking Numbers Solution Easy
Ransom Note Solution Easy
Sansa and XOR Solution Easy
Making Anagrams Solution Medium
Repeated String Solution Medium
Inserting a Node Into a Sorted Doubly Linked List Solution Medium
Super Reduced String Solution Medium
Caesar Cipher Solution Medium
Gemstones Solution Medium
Maximizing XOR Solution Medium
Sum vs XOR Solution Hard

More Questions

Question Solution Difficulty Great Problem
Dijkstra's Algorithm Solution Hard

About

175 efficient solutions to must-know interview problems

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published