Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/arpankg/ctci-python-solutions

Cracking the Coding Interview in Python 3. The solutions all have detailed explanations with visuals.
https://github.com/arpankg/ctci-python-solutions

cracking-the-coding-interview gayle-laakmann-mcdowell interview-practice interview-preparation interview-questions python python3

Last synced: 3 days ago
JSON representation

Cracking the Coding Interview in Python 3. The solutions all have detailed explanations with visuals.

Awesome Lists containing this project

README

        

# Cracking the Coding Interview in Python - Solutions with Explanations

Detailed explanations to the coding interview questions in CTCI. The solutions are written in Python 3.

**If you find this useful, a Github star would be much appreciated!!** ⭐ ⭐ ⭐

## Arrays and Strings
|Problem Number | Problem Name | Status|
|--- | --- | --- |
| 1.1 | Is Unique | [Read Solution ✅](https://quastor.org/cracking-the-coding-interview/arrays-and-strings/is-unique) |
| 1.2 | Check Permutation | [Read Solution ✅](https://quastor.org/cracking-the-coding-interview/arrays-and-strings/check-permutation) |
1.3 | URLify | [Read Solution ✅](https://quastor.org/cracking-the-coding-interview/arrays-and-strings/urlify) |
1.4 | Palindrome Permutation | [Read Solution ✅](https://quastor.org/cracking-the-coding-interview/arrays-and-strings/palindrome-permutation) |
1.5 | One Away | [Read Solution ✅](https://quastor.org/cracking-the-coding-interview/arrays-and-strings/one-away) |
1.6 | String Compression | [Read Solution ✅](https://quastor.org/cracking-the-coding-interview/arrays-and-strings/string-compression) |
1.7 | Rotate Matrix | [Read Solution ✅](https://quastor.org/cracking-the-coding-interview/arrays-and-strings/rotate-matrix) |
1.8 | Zero Matrix | [Read Solution ✅](https://quastor.org/cracking-the-coding-interview/arrays-and-strings/zero-matrix) |
1.9 | String Rotation | [Read Solution ✅](https://quastor.org/cracking-the-coding-interview/arrays-and-strings/string-rotation) |

## Linked Lists

| Problem Number | Problem Name | Status |
| --- | --- | --- |
| 2.1 | Remove Dups | [Read Solution ✅](https://quastor.org/cracking-the-coding-interview/linked-lists/remove-duplicates) |
| 2.2 | Return Kth to Last | [Read Solution ✅](https://quastor.org/cracking-the-coding-interview/linked-lists/return-kth-to-last) |
| 2.3 | Delete Middle Node | [Read Solution ✅](https://quastor.org/cracking-the-coding-interview/linked-lists/delete-middle-node) |
| 2.4 | Partition | [Read Solution ✅](https://quastor.org/cracking-the-coding-interview/linked-lists/partition) |
| 2.5 | Sum List | [Read Solution ✅](https://quastor.org/cracking-the-coding-interview/linked-lists/sum-list) |
| 2.6 | Palindrome | [Read Solution ✅](https://quastor.org/cracking-the-coding-interview/linked-lists/palindrome) |
| 2.7 | Intersection | [Read Solution ✅](https://quastor.org/cracking-the-coding-interview/linked-lists/intersection) |
| 2.8 | Loop Detection | [Read Solution ✅](https://quastor.org/cracking-the-coding-interview/linked-lists/loop-detection) |

## Stacks and Queues

| Problem Number | Problem Name | Status |
| --- | --- | --- |
| 3.1 | Three In One | [Read Solution ✅](https://quastor.org/cracking-the-coding-interview/stacks-and-queues/three-in-one) |
| 3.2 | Stack Min | [Read Solution ✅](https://quastor.org/cracking-the-coding-interview/stacks-and-queues/stack-min) |
| 3.3 | Stack of Plates | [Read Solution ✅](https://quastor.org/cracking-the-coding-interview/stacks-and-queues/stack-of-plates)|
| 3.4 | Queue via Stacks | [Read Solution ✅](https://quastor.org/cracking-the-coding-interview/stacks-and-queues/queue-via-stacks) |
| 3.5 | Sort Stack | ❌ |
| 3.6 | Animal Shelter | ❌ |

## Trees and Graphs

| Problem Number | Problem Name | Status |
| --- | --- | --- |
| 4.1 | Route Between Nodes | ❌ |
| 4.2 | Minimal Tree | ❌ |
| 4.3 | List of Depths | ❌ |
| 4.4 | Check Balanced | ❌ |
| 4.5 | Validate BST | ❌ |
| 4.6 | Successor | ❌ |
| 4.7 | Build Order | ❌ |
| 4.8 | First Common Ancestor | ❌ |
| 4.9 | BST Sequence | ❌ |
| 4.10 | Check Subtree | ❌ |
| 4.11 | Random Node | ❌ |
| 4.12 | Paths with Sum | ❌ |

## Bit Manipulation

| Problem Number | Problem Name | Status |
| --- | --- | --- |
| 5.1 | Insertion | ❌ |
| 5.2 | Binary to String | ❌ |
| 5.3 | Flip Bit to Win | ❌ |
| 5.4 | Next Number | ❌ |
| 5.5 | Debugger | ❌ |
| 5.6 | Conversion | ❌ |
| 5.7 | Pairwise Swap | ❌ |
| 5.8 | Draw Line | ❌ |

## Object Oriented Design

| Problem Number | Problem Name | Status |
| --- | --- | --- |
| 7.1 | Deck of Cards | ❌ |
| 7.2 | Call Center | ❌ |
| 7.3 | Jukebox | ❌ |
| 7.4 | Parking Lot | ❌ |
| 7.5 | Online Book Reader | ❌ |
| 7.6 | Jigsaw | ❌ |
| 7.7 | Chat Server | ❌ |
| 7.8 | Othello | ❌ |
| 7.9 | Circular Array | ❌ |

## Recursion and Dynamic Programming

| Problem Number | Problem Name | Status |
| --- | --- | --- |
| 8.1 | Triple Step | ❌ |
| 8.2 | Robot in a Grid | ❌ |
| 8.3 | Magic Index | ❌ |
| 8.4 | Power Set | ❌ |
| 8.5 | Recursive Multiply | ❌ |
| 8.6 | Towers of Hanoi | ❌ |
| 8.7 | Permutation without Dups | ❌ |
| 8.8 | Permutation with Dups | ❌ |
| 8.9 | Parens | ❌ |
| 8.10 | Paint Fill | ❌ |
| 8.11 | Coins | ❌ |
| 8.12 | Eight Queens | ❌ |
| 8.13 | Stack of Boxes | ❌ |
| 8.14 | Boolean Evaluation | ❌ |

## Sorting and Searching

| Problem Number | Problem Name | Status |
| --- | --- | --- |
| 10.1 | Sorted Merge | ❌ |
| 10.2 | Group Anagram | ❌ |
| 10.3 | Search in Rotated Array | ❌ |
| 10.4 | Sorted Search, No Size | ❌ |
| 10.5 | Sparse Search | ❌ |
| 10.6 | Sort Big File | ❌ |
| 10.7 | Missing Int | ❌ |
| 10.8 | Find Duplicates | ❌ |
| 10.9 | Sorted Matrix Search | ❌ |
| 10.10 | Rank from Stream | ❌ |
| 10.11 | Peaks and Valleys | ❌ |

## Moderate

| Problem Number | Problem Name | Status |
| --- | --- | --- |
| 16.1 | Number Swapper | [Read Solution ✅](https://quastor.org/cracking-the-coding-interview/moderate/number-swapper) |
| 16.2 | Word Frequencies | [Read Solution ✅](https://quastor.org/cracking-the-coding-interview/moderate/word-frequencies) |
| 16.3 | Intersection | ❌ |
| 16.4 | Tic Tac Win | ❌ |
| 16.5 | Factorial Zeros | ❌ |
| 16.6 | Smallest Difference | ❌ |
| 16.7 | Number Max | ❌ |
| 16.8 | English Int | ❌ |
| 16.9 | Operations | ❌ |
| 16.10 | Living People | ❌ |
| 16.11 | Diving Board | ❌ |
| 16.12 | XML Encoding | ❌ |
| 16.13 | Bisect Squares | ❌ |
| 16.14 | Best Line | ❌ |
| 16.15 | Master Mind | ❌ |
| 16.16 | Sub Sort | ❌ |
| 16.17 | Contiguous Sequence | ❌ |
| 16.18 | Pattern Matching | ❌ |
| 16.19 | Pond Sizes | ❌ |
| 16.20 | T9 | ❌ |
| 16.21 | Sum Swap | ❌ |
| 16.22 | Langton's Ant | ❌ |
| 16.23 | Rand7 from Rand5 | ❌ |
| 16.24 | Pairs with Sum | ❌ |
| 16.25 | LRU Cache | ❌ |
| 16.26 | Calculator| ❌ |

## Hard

| Problem Number | Problem Name | Status |
| --- | --- | --- |
| 17.1 | Add Without Plus | ❌ |
| 17.2 | Shuffle | ❌ |
| 17.3 | Random Set | ❌ |
| 17.4 | Missing Number | ❌ |
| 17.5 | Letters and Numbers | ❌ |
| 17.6 | Count of 2s | ❌ |
| 17.7 | Baby Names | ❌ |
| 17.8 | Circus Tower | ❌ |
| 17.9 | Kth Multiple | ❌ |
| 17.10 | Majority Element | ❌ |
| 17.11 | Word Distance | ❌ |
| 17.12 | BiNode | ❌ |
| 17.13 | Re-Space | ❌ |
| 17.14 | Smallest K | ❌ |
| 17.15 | Longest Word | ❌ |
| 17.16 | The Masseuse | ❌ |
| 17.17 | Multi Search | ❌ |
| 17.18 | Shortest Supersequence | ❌ |
| 17.19 | Missing Two | ❌ |
| 17.20 | Continuous Median | ❌ |
| 17.21 | Volume of Histogram | ❌ |
| 17.22 | Word Transformer | ❌ |
| 17.23 | Max Black Square | ❌ |
| 17.24 | Max Submatrix | ❌ |
| 17.25 | Word Rectangle | ❌ |
| 17.26 | Sparse Similarity | ❌ |

**If you find this useful, a Github star would be much appreciated!!** ⭐ ⭐ ⭐

## Contributing

Pull requests are welcome. For major changes, please open an issue to discuss what you want to change.

## Contributors

Huge thanks to our contributors!

* [Gan3i](https://www.linkedin.com/in/ganeshnageshappa/)
* [Farhan Juneja](https://www.linkedin.com/in/farhan-juneja/)