Course welcome
Data Structures and Alogrithms:
- Big myth: learn to code -> super wrong. You learn to solve problems. You also learn to tell the machine to repeat your solution.
- is a set of well defined rules (recipes) for solving famously known programming problems.
- is a tool to evaluate the efficiency of your code.
- is valuable, 70+ years accumulated knowledge of humankind on using computer to solve real life problems.
- is a Swiss Army knife kind of toolbox for you to rely on when solving your programming problems.
- helps you think smarter, more rational even just for your normal life decision making. Learning and practicing Data Structure & Algorithms is like going to the gym for your brain. It's brain exercise.
A software engineer without the knowledge of Data Structure & Algorithms doing programming, is like a naked soldier going to war.
Prerequisites
- Knowing at least one programming language. It can be any of your choice. This course will use Javascript for sample code.
-
Basic Maths (~ grade 8 and up):
- Algebra
- Combinatorics
Course outcome
Success outcome definition:
- You: equipped with this powerful toolbox, have a systematic way to approach, solve problem, program solution and evaluate the efficiency of the solution.
- Interview: successfully solve interview questions like the ones from Google, Facebook, ...
- Daily work: quickly create and program time and space optimized solutions for your daily work as a software engineer.
How course designed
- Specifically designed to prepare you to pass the coding interview as well as be able to write a time and space optimized Pull Request for daily work as a software engineer.
- Easy to understand and easy to repeat.
- As short and complete as possible.
- Language chosen to desribe a subject is as less technical and more relevant as possible.
- Each video/tutorial length is around 10 minutes. The idea is you can learn anywhere, anywhen.
- Videos are meant to show detailed explanation.
- Tutorials are to solidify videos contents and used as lecture notes for future reference.
How to be successful
- Watch the video first then read the tutorial (repeat if you need to).
- Practice the concepts/problems at least 3 times.
- Minimum expected time spent = 1x video learn + 3x practice = 4x total learn time
- Answer all real life interview questions at the end of each tutorial to practice your future job interview and to affirm your gain.
🎯 🎯 🎯 Be persistent! Motivation is what gets you started. Habit is what gets you there. Always remind yourself of the reason that you started this course.
🏋️ 🏋️ 🏋 Practice, practice, practice. What you hear, you will forget. What you see, you will remember. What you do, you will understand.
Textbooks, online practices and competitions
Textbooks are optional. We already extracted the best, relevant knowledge of the books to put in the videos/tutorials.
- Introduction to Algorithms, 3rd edition - Thomas H. Cormen (1,313 pages)
- Algorithms Illuminated (Part 1): The Basics - Tim Roughgarden (218 pages)
- Algorithms Illuminated (Part 2): Graph Algorithms and Data Structures - Tim Roughgarden (221 pages)
- Algorithms Illuminated (Part 3): Greedy Algorithms and Dynamic Programming - Tim Roughgarden (229 pages)
- Algorithms Illuminated (Part 4): Algorithms for NP-Hard Problems - Tim Roughgarden (271 pages)
Online interview coding practice:
- PRAMP Practice makes perfect is a mock interview practice platform where you can practice interview with job seekers like you.
- Leetcode is a coding practice platform that contains 99% of coding interview quesions from Silicon Valley companies.
- HackerRank is a good platform to practice and know your progress among peers.
Competitions are fun and help you grow. Noticeable achievements in one of these competitions will get you a job offer with $500,000+/year salary in big tech companies like Google, Facebook, ... :
- Google Code Jam: yearly, open to all, $15,000 prize for 1st place.
- Google Kick Start: yearly, open to all, for beginners.
- Google Hash Code: yearly, open to all.
- Facebook Hacker Cup: yearly, open to all, $20,000 prize for 1st place.
- Microsoft Imagine Cup: yearly, open to 16+ years old students only, $100,000 prize for 1st place.
- International Collegiate Programming Contest ICPC: yearly, open to college students only, one of the oldest and most prestigious programing contest, $15,000 prize for 1st place.
- International Olympiads in Informatics IOI: yearly, open to age 13+ to K12 students only, $1,200 prize for 1st place.
More resources if you want to pursue academia career (Math, theory focused):
- Stanford free online Data Structure & Algorithm class on Youtube by Tim Roughgarden, PhD. This class is theory focused. It's suitable if you want to see more about Mathematical explanations.
- Stanford Algorithms Specialization on Coursera by Tim Roughgarden, PhD.
- MIT Open Course Ware 6.006: Introduction to Algorithms by Erik Demaine & Srini Devadas.
- MIT Open Course Ware 6.046: Design and Analysis of Algorithms by Erik Demaine Ph.D & Srini Devadas Ph.D.
Why job interview focuses so much on algorithms?
- To test if you can write time & space optimized code on your everyday task as a software engineer. If you can prove that you can write high quality code in an interview, it's highly likely you can contribute good code.
- To test if you have good analytical and problem solving skills. Programming job is the work of the mind. Programming problems are quite daunting to solve. So if you can solve them, employers believe you have the skills to solve similar problems.
- What about frameworks and tools, they are important too. Why do interviews focus so little on them? Again, if you can prove you have analytical and problem solving skills, employers believe you can learn those frameworks and tools quickly.
Sample code
Along with the tutorials can be found on sesv-tutorial github.
Course outline
Individual topics are purposely listed so you can come back and reference them easily.
Lecture 1: Big O notation, an easy way to estimate the complexity of an algorithm 11:46
- What is code complexity?
- Why is it important to measure code complexity?
- How to calculate Time and Space complexity?
- Big O complexity is asymptotic analysis
- Popular Big O complexities: names and graphs
* Lecture 2: Data structures 04:57
- What is a data structure?
- What to remember when learning a new data structure?
- Why are there so many data structures?
- Improving time usually requires more space and vice versa
Lecture 3: Array 03:09
Lecture 4: String 03:10
Lecture 5: Set 02:55
Lecture 6: HashTable/HashMap/Map 04:26
Lecture 7: Stack 03:31
Lecture 8: Queue 03:25
Lecture 9: Priority Queue 06:12
Lecture 10: Linked List 10:03
Lecture 11: Tree part 1/5: Tree and Binary Tree 8:11
Lecture 12: Tree part 2/5: balanced/unbalanced Binary Search Tree 10:43
Lecture 13: Tree part 3/5: extracting useful information out of tree using Loop, Stack and Queue 19:46
Lecture 14: Tree part 4/5: understanding function call stack and recursion 17:27
Lecture 15: Tree part 5/5: extracting useful information from tree using recursion 15:19
Lecture 16: Graph 23:44
*Lecture 17: Algorithms 09:38
Lecture 18: FOR LOOP, a (almost) guaranteed, "brute force" solution 7:10
Lecture 19: Recursion 13:47
Lecture 20: Binary search 12:23
Lecture 21: Greedy 10:33
Lecture 22: Divide and Conquer 17:05
Lecture 23: Sort 03:01
Lecture 24: Two Pointers 14:53
Lecture 25: Sliding Window 09:34
Lecture 26: Breadth First Search 09:37, 08:01, 10:59
Lecture 27: Depth first Search 05:46, 11:58, 05:46
Lecture 28: Topological Sort 06:59
Lecture 29: Bellman-Ford 16:16
Lecture 30: Backtracking 14:04, 11:30
Lecture 31: Dynamic Programing part 1/10 36:09
Lecture 32: Dynamic Programing part 2/10 46:18
Lecture 33: Dynamic Programing part 3/10 16:16
Lecture 34: Dynamic Programing part 4/10 14:00
Lecture 35: Dynamic Programing part 5/10 16:14
Coming lectures:
Lecture 41: Steps to solve problem and program the solution
Real life interview questions
- Why do you need to learn data structures & algorithms?
- Do you think within a short time range, you can come up with a programming solution that is better than a solution which based on the accumulated knowledge of human kind in 70 years?
- What are your assets when coming for a software job interview or solving a programming problem?