Nathan Wailes - Blog - GitHub - LinkedIn - Patreon - Reddit - Stack Overflow - Twitter - YouTube
Algorithms, Data Structures, System Design and Interview Questions
- 1.1 Related pages
- 2 A step-by-step process for solving algorithm questions
- 3 How I study
- 4 Data structures
- 4.1 Questions
- 5 Non-algorithm-specific interview advice
- 6 Algorithms-Specific Informational Websites (not programming challenge websites)
- 7 Books
- 8 Articles
- 9 Interview Challenge sites
- 10 Front-end interview challenge / prep sites
- 11 Interview Prep sites
- 12 Non-Interview-Prep Challenge sites
- 13 Topics
- 13.1 Linked Lists
- 13.2 Databases
- 13.3 Dynamic Programming (DP)
- 13.4 Heaps
- 13.5 Recursion
- 13.6 Trees
- 13.6.1 Binary Trees
- 13.7 The interview process
- 14 Flashcards
- 15 System Design
- 15.1 Learning resources
- 15.2 Articles / Forum posts
Related pages
A step-by-step process for solving algorithm questions
Draw out a simple visual example.
Do it in something like Balsamiq.
Copy-paste it to visually show what the step-by-step process should look like.
Think about what variables you want at each step to answer the relevant question you have to be able to calculate the desired answer.
Ask yourself: What features of the state of each ‘step’ through the input can you think of to assign names to? Write the code needed to calculate/update these values with each iteration (or just have them as stub functions to be filled in later) and it could give you enough of a step in the right direction for the rest of the solution to make itself clear.
How I study
I have Neetcode questions in Anki.
I track which questions I’ve actually studied by checking them off on the Neetcode website.
I’m aiming to go through all questions of a type before moving onto the next type.
Creating Replit versions:
If I can’t access the question on Leetcode (it’s a premium question) or the Lintcode version (or if the Lintcode version is too different from the Leetcode question), I can create a Replit version in here.
Make the ‘template’ version of the question, then when you actually want to do the question, use that same Replit and you can just use the git feature to discard all of the changes you made to the code when you’re done.
Data structures
Questions
What is the threshold at which point it's a good idea to create a class for a data structure?
Non-algorithm-specific interview advice
Algorithms-Specific Informational Websites (not programming challenge websites)
Nick Parlante - Pointers, Binary Trees, etc.
Very good explanations
OK explanations
Books
Look good:
The Algorithm Design Manual by Skiena
Rec'd by Adam D'Angelo in a Quora post.
Essential Algorithms - 5 stars on O'Reilly
Working with Algorithms in Python - O'Reilly video series - 4.3 stars - Same guy who wrote 'Algorithms in a Nutshell'
Maybe good:
Meh:
Articles
Interview Challenge sites
this is by Kalzumeus
Front-end interview challenge / prep sites
Interview Prep sites
rec'd by Choketsu
Codility
Rec'd by Toptal
rec'd by Choketsu
via Tom A.
Non-Interview-Prep Challenge sites
Rec'd by Toptal
Someone who works with machine learning explaining how Kaggle is a simplification of real ML work:
Jason B Hill's Project Euler solutions
Rec'd by Toptal, Chris Uga
rec'd by Choketsu
How to get started training at the USACO Gateway:
What is it like to attend the USACO training camp?
It's only a week
New people just get 3 hours of lab/lecture in the morning
The top guys do a contest every day. Sometimes the contest goes until after lunch, otherwise they just review after lunch. (Seems like 5 hrs/day)
Then everyone has fun for the rest of the day
If one is stuck on a particular section, is it worthwhile to keep on trying to solve the given problem, or should one move on to other sources in preparation for programming contests?
Richard Peng, one of the most successful Canadian IOI competitors of all time, on the USACO training pages:
"USACO training was put together before the major IOI escalation (Finland/Korea/Wisconsin). A lot of the techniques described on it are no longer useful on *OI and a lot of the 'hot' topics over the past few years are not covered. Also, a lot of the bottle necks on training are quite meaningless, and they typically cause a lot of frustration and time waste on the scale of months."
Topics
Linked Lists
Databases
Dynamic Programming (DP)
https://activities.tjhsst.edu/sct/lectures/0405/dp1.pdf
"Dynamic programming, often abbreviated "DP", is a technique to efficiently solve recursion problems -- problems whose solutions depend on solutions of smaller problems -- by storing partial results. Many times, it is obvious that a given problem is a recursion problem. However, it may not be so obvious that using DP will tremendously speed up the solution. We start by looking at an example."
Heaps
Recursion
Trees
Binary Trees
The interview process
http://seldo.com/weblog/2014/08/26/you_suck_at_technical_interviews
http://blog.triplebyte.com/how-to-pass-a-programming-interview
https://medium.com/@evnowandforever/f-you-i-quit-hiring-is-broken-bb8f3a48d324#.jhferyy53
Flashcards
Here is an explanation of how to programmatically create Anki deck packages: http://decks.wikia.com/wiki/Anki_APKG_format_documentation
Here's an example of people collaborating on an Anki deck: http://decks.wikia.com/wiki/Main_Page
Javascript problem manager: https://github.com/imaginate/algorithmIV-question-manager
The stages of understanding: (think about it as high-level vs. low-level understanding, or broad vs. deep understanding)
Broad / High-level: Recognition of terms / basic understanding of definitions
High / Mid-level Knowing when to use a particular tool
Mid/Low-level: Knowing how to do something
Deep / Low-level: Knowing about tricky things / edge cases / less-common problems
Algorithms
Testing recognition / basic understanding
What does "BFS" stand for?
Acronym used in IK
Give an example of an O(X) algorithm. ← See 'The Pragmatic Programmer' for examples.
Give an example of an O(1) algorithm.
Give an example of an O(lg(n)) algorithm.
"Binary search of a sorted list, traversing a binary tree, and finding the first set bit in a machine word(?)."
Give an example of an O(n) algorithm.
Exhaustive searches, finding the maximum value in an array, and generating checksums.
Give an example of an O(m * n) algorithm.
"This commonly occurs in simple sorting algorithms, such as bubble sort, where the outer loop scans each element in the array in turn, and the inner loop works out where to place that element in the sorted result."
Give an example of an O(n*lg(n)) algorithm.
Quicksort
Give an example of an O(n^2) algorithm.
Give an example of an O(n^3) algorithm.
Give an example of an O(2^n) algorithm.
Give an example of an O(n!) algorithm.
"Whenever algorithms start looking at the permutations of things, their running times may get out of hand. (...) Examples include algorithms for many of the acknowledged 'hard' problems–the traveling salesman problem, optimally packing things into a container, partitioning a set of numbers so that each set has the same total, and so on. Often, heuristics are used to reduce the running times of these types of algorithms in particular problem domains."
Arrays and other Ad-hoc problems
Concurrency
Dynamic Programming
Graphs and other Data Structures
Group coding mocks
Group mocks on Concurrency
Group mocks on Object Modeling
Group mocks on Scalable Systems
Linked Lists, Stacks, and Queues
Object Modeling
Orientation + Behavioral
Recursion
Scalable Systems
Sorting
Strings
Trees
Done - K-ary tree
Used in IK
BST
Used in IK
System Design
Learning resources
Alex Xu
https://www.amazon.com/Designing-Data-Intensive-Applications-Reliable-Maintainable-ebook/dp/B06XPJML5D/ref=tmm_kin_swatch_0?_encoding=UTF8&qid=&sr=
https://www.designgurus.io/ - Grokking the System Design Interview (online course)
NeetCode system design courses - https://neetcode.io/courses
https://www.algoexpert.io/systems/product
Negative review: https://www.reddit.com/r/cscareerquestions/comments/s0e54f/warning_systems_expert_by_the_algoexpert_guy_is/
“modules are very light on information, and you'd have a better time just reading the wikipedia page on those topics.”
“topics aren't well explained and it's just an extremely high level overview of what they are”
Udemy: https://www.udemy.com/courses/search/?src=ukw&q=system+design
https://www.amazon.com/Scalability-Startup-Engineers-Artur-Ejsmont/dp/0071843655
Articles / Forum posts
https://www.reddit.com/r/cscareerquestions/comments/ufhjjk/what_are_the_best_resources_to_study_system_design/
I’ve added the mentioned resources to the “learning resources” section on this page, but the most-common recommendations were the GitHub primer and the DDIA book.
https://medium.com/javarevisited/7-best-places-to-learn-system-design-79e2d261f343
TODO: Go through this.