The book is written in latex, and all contents except the code is located under Easy-Book folder. Feel free to send me pull requests to contribute contents. Before you start to improve the contents, it would be helpful to know the high-level structure of the book. Read How to contribute? for more details.
All contributors (with decent amount of contributions) will be listed as authors in the project.
In short, this is a middle-to-high level algorithm book designed with cracking coding interviews at heart. It offers a one-stop coding interview prep experience. The structure of the book:
- Preparation: introduce the global picture of algorithmic problem solving and coding interviews, learn abstract data structures and highly related and useful math such as recurrence relation, and hands-on Python practice by relating the abstract data structures to Python data structures. Coding is not just code after all.,
- Principles: we organize the design and principle here so that readers can use them as guidance while not seeking for peculiar algorithm for solving a problem.
- Classical algorithms: We enhance our algorithm database via learning how to apply the core principles to a variety of classical problems. A database that we can quickly relate to when seeing problems.
- Coding interview problem patterns: We close our book with the analyzing and categorizing problems by patterns. We address classical and best solutions for each problem pattern.
Besides trying to make the content easy to follow, here summarizes the uniqueness of this book: (1) it offers Python source code that is tailored to be simple so that it would be natural for you to use in interviews (2) all the exercises and examples are from Leetcode problems so that you get to practise online (3) Classical algorithms are explained with design principles. No algorithm is magic. (Check out advanced graph algorithms as an example) (4) problem patterns to help you tackle coding interview questions topic by topic.
Preparing for coding interviews can be daunting, and cracking them might seem nearly impossible for many of us. However, it's essential to view the process as a learning opportunity and find enjoyment in it. Computer science encompasses a wide range of fields beyond just programming. Interview problems often touch on areas like enumerative combinatorics and linear algebra, highlighting the interdisciplinary nature of the subject. What truly matters is our enthusiasm for learning and our ability to apply that knowledge to solve real-world problems.
While there are many books available that focus on teaching algorithms or preparing for interviews, few effectively combine the two. This book aims to fill that gap by integrating algorithmic principles, problem-solving patterns, and hands-on LeetCode problems into one cohesive resource. Unlike books that provide hiring statistics or quick tricks for passing interviews, this book's goal is to showcase the beauty of algorithmic problem-solving. By doing so, it aims to inspire readers to become more passionate and confident software engineers. The interview questions serve as a playground where readers can apply and reinforce what they've learned.
The whole book is compiled as pdf.
For readers, you can read the book as a whole or read chapters selectively following the below links.
- Abstract Data Structures
- Discrete Programming
- Recurrence Relation
- Iteration and Recursion
- Bit Manipulation
- Python Data Structures( source code )
-
Complexity Analysis
-
Search Strategies(source code: Graph Search, source code: Tree Traversal)
-
Reduce and Conquer
-
Decrease and Conquer
- Sorting and Selection( source code: sorting algorithms, Python comparison and sort functions)
- Dynamic Programming
- Greedy Algorithms
- Advanced Data Structures
- Advanced Search on Linear Data Structures( source code)
- Advanced Graph Algorithms
- String Pattern Matches
- Math and Geometry Algorithms
- Dynamic Programming Questions (15%)
- Array Questions (15%)
- Linked List, Stack, Queue, and Heap Questions (12%)
- String Questions (15%)
- Tree Questions (10%)
- Graph Questions (15%)
Note: everything is still in progress, so use it with caution.
-
Skiena, Steven S. The algorithm design manual: Text. Vol. 1. Springer Science & Business Media, 1998.
-
T. H. Cormen, Introduction to algorithms, MIT press, 2009.
-
Manber, Udi. Introduction to algorithms: a creative approach. Addison-Wesley Longman Publishing Co., Inc., 1989.
-
Kleinberg, Jon, and Eva Tardos. Algorithm design. Pearson Education India, 2006.
-
Russell, Stuart J., and Peter Norvig. Artificial intelligence: a modern approach. Malaysia; Pearson Education Limited,, 2016. (Best book ever in explaining searching problem-solving, differentiate tree-search and graph-search)
-
D. M. Beazley, Python essential reference, Addison-Wesley Professional,2009.
-
S. Halim and F. Halim, Competitive Programming 3, Lulu Independent Publish, 2013.
-
B. Slatkin, Effective Python: 59 Specific Ways to Write Better Python,Pearson Education, 2015.
-
H. hua jiang, “Leetcode blogs,” https://zxi.mytechroad.com/blog/category, 2018, [Online; accessed 19-July-2018].
-
B. Baka, “Python data structures and algorithms: Improve application performance with graphs, stacks, and queues,” 2017.
-
“Competitive Programming,”https://cp-algorithms.com/, 2019, [Online; accessed 19-July-2018].
-
“cs princeton,”https://aofa.cs.princeton.edu/60trees/, 2019, [Online; accessed 19-July-2018]
- Graph Visualize with graphviz. Examples. Tutorial to use Python
Practice is important. Schedule some mocking interviews with interviewing.io. If you cant manage to register, you can join us in discord server and ask peers for practice interview.
Join me on discord server: https://discord.gg/ZXnSag7fMP, for a supportive community
If you have ideas to improve the book, about formatting, more contents, or correct the errors, do not hesitate to let me know.
To cite this content, please use:
```bibtex @misc{handsondsa, author = {Li Yin}, title = {Hands-on Algorithmic Problem Solving}, howpublished = {\url{https://github.com/liyin2015/python-coding-interview/}}, year = {2021} } ```