Skip to content

Latest commit

 

History

History
170 lines (87 loc) · 10.1 KB

DSA.md

File metadata and controls

170 lines (87 loc) · 10.1 KB

Learning DSA from Scratch

DSA can be seen as three step process, A. Learn a language, B. Learn a data structure, C. Apply it in algorithms. Let's dig in shall we?

Learning a language is THE MOST asked question so, here's an answer. What language do I pick, short answer is it depends, the long of it is this. You have primarily three options,

C/C++

Java

Python

What to pick and why? Simply speaking, most programming languages have the same skeleton just different ways of doing it. Therefore, they are used in different ways.

C++ is a powerful language which gives most of the power in your hands, this includes handling how much power or resource you would demand from a system. What kind of system memory you wish to utilise. If you have a timeline of over a year or more this is the best option for you. Though this has a long learning curve and does take time, it helps a lot in the future since almost every other language on this list has features taken from C++. Lastly, if you wish to join Competitive Programming this is the way to go.

Java is a language that falls somewhere in the middle where it's not too easy but not too frustrating as well. Most service based companies who are in the Asian belt prefer Java as a language in many of their projects. Bearing that in mind. If you're aiming for a job in a service based firm this is the way to go. The learning curve is a bit less than C++ but again the concepts are quite empowering for a programmer in their career.

Python is the kingpin that runs the Wild West that's IT these days, Python would be the ideal choice if you're a short deadline and need a job ASAP. The concepts are fewer and the language is less verbose.

Resources to learn the languages:

For C++

1 First two lectures on Harvard's CS50 (David J Malan is one of the best explainers of Intro To Programming I've ever seen)

  1. W3Schools www.w3schools.com (Works great as a course material and reference)

  2. www.learncpp.com (Frankly, the best place to learn imho)These should be enough for learning C++

For Java

Derek Banas[https://www.youtube.com/playlist?list=PLE7E8B7F4856C9B19] has a fantastic tutorial on YT. Tim Bulchaka’s Java Masterclass[https://www.udemy.com/course/java-the-complete-java-developer-course/] course (Paid Resource)Coding With John[https://www.youtube.com/playlist?list=PLkeaG1zpPTHiMjczpmZ6ALd46VjjiQJ_8] is another fabulous resource.

For Python

Corey Schafer[https://www.youtube.com/playlist?app=desktop&list=PL-osiE80TeTt2d9bfVyTiXJA-UTHn6WwU] on YT

W3Schools (Works great as a course material and reference)

The Python Tutorial on Python.Org[https://wiki.python.org/moin/BeginnersGuide] is a good reference to work as a pair with any of the above listed resources.

So, what all must you know from a language agnostic view point,The basics - Variables, if-else, strings, loops, functions.OOPs (Object Oriented Programming) - Classes, Methods, instances, etc.

At this stage you can move on to learning Data Structures, I'll be listing the most common ones and what approaches are necessary. This is not an exhaustive list nor it is a rulebook for solving problems. Tweak and learn as per your need and adapt.

I would suggest to go through these data structures.

  • Linked lists

  • Stacks

  • Queues

  • Trees

  • Graphs

  • Heaps

  • Hash tables

These would allow you to clear any interview or start solving competitive programming problems.

A playlist that helped me a lot for data structures was William Fiset's video[https://www.youtube.com/watch?v=RBSGKlAvoiM]

If you have taken Java as a language Princeton University's Algorithms[https://www.coursera.org/learn/algorithms-part1] would be the go-to resource.

Tech Interview Handbook is another resource that would be helpful.

Abdul Bari[https://www.youtube.com/playlist?list=PLDN4rrl48XKpZkf03iYFl-O29szjTrs_O] is a fantastic resource for Algorithms. His explanations are top tier.

Though in JavaScript this resource[https://www.youtube.com/playlist?list=PLC3y8-rFHvwjPxNAKvZpdnsr41E0fCMMP] for it's logic explanations are great.

(MOOC)[https://www.mooc.fi/] is a resource I missed out on thanks to u/WingsOfReason for suggesting.

Simultaneous to this would be recommended to solve problems from sites such as HackerRank, LeetCode.

In the case for LeetCode go for Easy Problems at first then go to medium problems. Hard Problems are better suited for Competitive Problems only.

The way I used to solve problems was this, I set a timer of 20 minutes and read the problem trying to solve the problem. After the 20 mins were over, regardless of if I had solved the problem or not reading through the editorials or looking through on Google for solutions helped me see methods or logics I hadn't thought of before.

Form a habit of solving at least 2 problems a day, which helps your mind work everyday and allow you to go.

Some Tips:

Getting an error is the rule, the program running perfect is the exception. This is a mindset which would allow you to get over the hesitation of feeling incompetent and giving up. StackOverFlow, Reddit and other such resources have millions of people solving, asking problems. Which simply means you're not alone.

You can always edit bad code, a blank page is depressing anyway, Write the code once you've got a solution. You can then edit it and make it better. Writing on paper is also a great habit to have.

The better programmer keeps going one more time than the person before them.

Even the greatest programmer today once didn't know how to declare a variable.Good luck!

The best resource I've found is the Leetcode's Interview Crash Course on Data Structures and Algorithms. I recommend it highly.

It's better you know discrete mathematics which is one of the prerequisites[https://ocw.mit.edu/courses/6-006-introduction-to-algorithms-spring-2020/pages/syllabus/], and also in MIT introduction to algorithms course it's mostly about how it is implemented (without a code), it focuses on theory and communication (how do you communicate an algorithm answer if a question was asked like why does this algorithm work, how does it have a time complexity of O(n)), and if you already know discrete its better to start with data structures[https://www.youtube.com/watch?v=RBSGKlAvoiM] which the OP mentioned and then continue with MIT introduction to algorithm course[https://www.youtube.com/playlist?list=PLUl4u3cNGP63EdVPNLG3ToM6LaEUuStEY].

Found common sense algos by Jay Wengrow to be a better book. And pair it with an algos course, and you are good to go.

Some other courses by good teachers

Scott barrett: Udemy course where he shows visual examples and implements the data structures from scratch and it helped a ton.

Robert Sedgewick: This man is a master teacher. The video course at Cursera is well worth it. Coursera course: Part I[https://www.coursera.org/learn/algorithms-part1] Part II[https://www.coursera.org/learn/algorithms-part2]

Books

Coursebook: Algorithms 4th Edition[http://algs4.cs.princeton.edu/home/]

From Dinesh Varyani Newsletter on Cracking FAANG. Recently I have received a lot of queries regarding my preparation that helped me crack FAANG/MAANG companies. Below are some of the resources that helped me a lot -

(Ask me anything related to FAANG Technical interviews in the comment section)

✅ 𝗖𝗿𝗮𝗰𝗸𝗶𝗻𝗴 𝘁𝗵𝗲 𝗚𝗔𝗠𝗔𝗠 𝗧𝗲𝗰𝗵𝗻𝗶𝗰𝗮𝗹 𝗜𝗻𝘁𝗲𝗿𝘃𝗶𝗲𝘄𝘀:

👉 Dive into my ebook for the ultimate roadmap, tips, and strategies that led to my success! Download the ebook - https://bit.ly/bgamam

✅ 𝗖𝗼𝗱𝗶𝗻𝗴 𝗜𝗻𝘁𝗲𝗿𝘃𝗶𝗲𝘄

👉 Revise concepts lightning-fast with my DSA playlist at 2x speed! (https://lnkd.in/dJfS9FkD)

👉 Crush over 250+ popular LeetCode medium problems!

👉 Get the top 400 LeetCode questions in one handy xlsx sheet (https://lnkd.in/dWn73jXd) + ace the Coding Interview with my pro tips (https://lnkd.in/dsn4cipq)

👉 Clement Mihailescu's AlgoExpert's got your back with 200+ killer questions (https://www.algoexpert.io/). Fast-track your prep!

✅ 𝗦𝘆𝘀𝘁𝗲𝗺 𝗗𝗲𝘀𝗶𝗴𝗻 𝗜𝗻𝘁𝗲𝗿𝘃𝗶𝗲𝘄

👉 Dive deep into system design with Arslan Ahmad's Grokking the System Design Interview (https://lnkd.in/dXywra2R) for expert insights and real-world case studies!

👉 Master system design concepts with Alex Xu's ByteByteGo course (https://lnkd.in/d6yRpRvy) - everything you need from his acclaimed book!

✅ 𝗟𝗼𝘄-𝗟𝗲𝘃𝗲𝗹 𝗗𝗲𝘀𝗶𝗴𝗻 𝗜𝗻𝘁𝗲𝗿𝘃𝗶𝗲𝘄

👉 Elevate your design game with real-world examples! Check out the Design Patterns in Action course (https://lnkd.in/dwHa-vTN)

👉 Grokking the Object Oriented Design Interview (https://lnkd.in/deuAXR-U) offers a detailed roadmap with step-by-step approaches to ace OOD interviews!

👉 Level up with UML diagram practice on Diagrams.net

✅ 𝗔𝗣𝗜 𝗗𝗲𝘀𝗶𝗴𝗻 𝗜𝗻𝘁𝗲𝗿𝘃𝗶𝗲𝘄

👉 Nail API design with best practices, implementation tips, and guidelines (https://lnkd.in/d_x39xkK)

👉 Explore real-world use cases like Stripe (https://lnkd.in/dsM7PpJt) & Twitter (https://lnkd.in/dxiMu8wr) API

👉 Master API design principles with examples from https://lnkd.in/dA5AUaz3#/

✅ 𝗗𝗮𝘁𝗮𝗯𝗮𝘀𝗲 𝗗𝗲𝘀𝗶𝗴𝗻 𝗜𝗻𝘁𝗲𝗿𝘃𝗶𝗲𝘄

👉 Combine Object Oriented Design with relational mapping strategies for killer solutions! Grokking the Object Oriented Design Interview (https://lnkd.in/deuAXR-U) is your roadmap!

👉 Sketch relational schemas like a pro on https://drawsql.app

✅ 𝗕𝗲𝗵𝗮𝘃𝗶𝗼𝗿𝗮𝗹 𝗜𝗻𝘁𝗲𝗿𝘃𝗶𝗲𝘄

👉 Crush behavioral interviews with Mastering Behavioral Interviews (https://lnkd.in/dQ8gU3QJ) - your ultimate guide to acing the human side of interviews!

👉 Get insider tips on behavioral questions from Jeff H Sipe, YouTube channel (https://lnkd.in/d6rgxbnr)

👉 Modernize your approach with Grokking Modern Behavioral Interview (https://lnkd.in/dmeMzYvz) for cutting-edge strategies

✅ Follow Dinesh Varyani for strategies, tips, and resources on technical interviews