Learning Data Structures and Algorithms (DSA) from scratch in 90 days using Java is an
excellent way to improve your problem-solving skills, and it's a great preparation for coding
interviews. Here's a detailed roadmap that breaks down your 90-day plan into manageable
steps.
Week 1-2: Basics of Java & Programming Fundamentals
Goal: Build a solid understanding of Java syntax and basic programming concepts.
1. Java Basics:
o Syntax: Variables, data types, operators
o Control structures: if-else, loops (for, while)
o Functions/methods
o Arrays and Strings (basic operations, traversing, searching, sorting)
2. Object-Oriented Programming (OOP) in Java:
o Classes and objects
o Inheritance, Polymorphism, Abstraction, and Encapsulation
o Constructors and destructors
o Method Overloading and Overriding
o Access modifiers (public, private, protected)
3. Practice:
o Simple Java problems (loops, conditions, functions)
o Solve basic problems on platforms like LeetCode or HackerRank (start with
easy-level problems)
Week 3-4: Introduction to Data Structures
Goal: Get familiar with the fundamental data structures.
1. Arrays:
o Declaration, initialization, and operations (insert, delete, search)
o Multidimensional arrays
o Dynamic arrays vs static arrays (introduction to ArrayList in Java)
2. Strings:
o String manipulations (concatenation, substring, reverse)
o StringBuilder class in Java (mutable strings)
3. Linked Lists:
o Single Linked List (insertion, deletion, searching)
o Doubly Linked List
o Circular Linked List
4. Practice:
o Array and String problems on LeetCode (easy-medium level)
o Linked List problems (insertion, deletion, reversal, merging)
Week 5-6: Advanced Data Structures
Goal: Dive deeper into more complex data structures.
1. Stacks:
o Stack implementation (using arrays and linked lists)
o Stack applications (expression evaluation, parsing)
2. Queues:
o Queue implementation (using arrays and linked lists)
o Circular Queue, Deque
o Priority Queue (using PriorityQueue in Java)
3. Hashing:
o HashMap and HashSet in Java
o Collision handling methods (Chaining, Open Addressing)
4. Practice:
o Solve problems on stacks and queues (e.g., balanced parentheses, queue
operations)
o Hashing-related problems (e.g., anagrams, duplicates, frequency counting)
Week 7-8: Trees
Goal: Master the concepts of trees, which are crucial for many algorithms.
1. Binary Trees:
o Tree traversal: Pre-order, In-order, Post-order, Level-order
o Depth-first search (DFS) and Breadth-first search (BFS)
2. Binary Search Tree (BST):
o Insertion, deletion, search operations
o Balancing a BST (Introduction to AVL, Red-Black trees)
3. Heaps:
o Min-heap and Max-heap
o Priority Queue implementation
o Heap operations (insertion, deletion)
4. Practice:
o Tree-based problems (height, diameter, lowest common ancestor)
o Implement a binary search tree and solve problems related to BST traversal,
balancing, etc.
Week 9-10: Graphs
Goal: Learn graph theory and graph algorithms.
1. Graph Representation:
o Adjacency Matrix, Adjacency List
o Directed and Undirected graphs
2. Graph Traversal:
o Depth-First Search (DFS)
o Breadth-First Search (BFS)
3. Graph Algorithms:
o Shortest Path: Dijkstra’s, Bellman-Ford
o Minimum Spanning Tree (Prim's, Kruskal’s)
o Topological Sorting (for Directed Acyclic Graphs)
4. Practice:
o Solve graph problems (e.g., cycle detection, connected components)
o Implement BFS and DFS for various graph problems
o Solve shortest path and MST-related problems
Week 11-12: Advanced Algorithms and Techniques
Goal: Focus on more complex algorithms and dynamic programming.
1. Dynamic Programming (DP):
o Introduction to DP
o Knapsack Problem, Longest Common Subsequence, Longest Increasing
Subsequence
o DP on Trees, DP on Graphs
2. Divide and Conquer:
o Merge Sort, Quick Sort
o Binary Search (Iterative and Recursive)
3. Greedy Algorithms:
o Activity Selection Problem
o Huffman Coding
4. Backtracking:
o N-Queens Problem
o Subset Sum Problem
5. Practice:
o Solve DP problems (e.g., Fibonacci, coin change, longest increasing
subsequence)
o Greedy algorithm problems (e.g., job scheduling, fractional knapsack)
o Backtracking problems (e.g., Sudoku solver, rat in a maze)
Week 13: Review & Problem Solving
Goal: Consolidate knowledge and focus on problem-solving.
1. Review All Data Structures and Algorithms:
o Review key concepts of Arrays, Linked Lists, Trees, Graphs, etc.
o Recap important algorithms (e.g., sorting, searching, DP)
2. Mock Interviews & Practice:
o Take part in mock coding interviews (LeetCode contest, HackerRank
challenges)
o Solve problems in a timed environment (focus on speed and efficiency)
o Do 2-3 problems each day on LeetCode or similar platforms (medium/hard
level)
3. Focus on Weak Areas:
o Identify areas where you're struggling or need improvement (e.g., dynamic
programming, graph algorithms)
o Solve problems specifically from those topics
Additional Resources & Tips:
1. Books:
o "Data Structures and Algorithms in Java" by Robert Lafore
o "Cracking the Coding Interview" by Gayle Laakmann McDowell (for interview
preparation)
2. Online Courses:
o Coursera: "Data Structures and Algorithm Specialization" by UC San Diego
o Udemy: "Mastering Data Structures & Algorithms using Java" (Tim Buchalka)
3. Coding Practice Platforms:
o LeetCode, HackerRank, Codeforces, GeeksforGeeks
o Participate in daily challenges and contests to improve problem-solving
speed.
4. Additional Practice:
o Write your own implementation of basic data structures (e.g., stacks, queues,
linked lists, trees).
o Focus on solving problems consistently rather than just reading concepts.
Daily Time Commitment:
Aim for 2-3 hours/day of study, broken into:
o 1 hour for reading and understanding theory
o 1-2 hours for solving problems and practicing
Consistency is key! Stay committed and push through the tough problems. Good luck on
your journey to mastering DSA in 90 days!