Join Our Community
Placement Roadmap

DSA Roadmap 2026: Learn Data Structures & Algorithms in Java

A clear, step-by-step path to learn DSA from zero and crack coding rounds of product and service companies. Follow the stages in order, solve the practice problems at each stop, and you will be interview-ready in about 5–6 months.

5–6 MonthsAt 2–3 hrs/day
12 StagesBasics to DP
BeginnerNo prior DSA needed
JavaLanguage used

By Deepak Panwar, Founder – Smart Programming  |  Updated: October 2026

Who is this roadmap for?

  • College students preparing for placements
  • Freshers targeting product-based companies
  • Developers switching to better-paying roles
  • Anyone who knows basic programming

What you will be able to do

  • Solve easy and medium LeetCode problems confidently
  • Recognise patterns like two pointers and sliding window
  • Explain time and space complexity in interviews
  • Clear online coding tests (TCS NQT, HackWithInfy etc.)

How to follow this roadmap

  • Go stage by stage – do not skip the basics
  • Solve 10–20 problems after every stage
  • Revise old topics every weekend
  • Track your progress in a sheet or on GitHub

The 12-Stage Roadmap

Follow the stages in order. Finish the practice task before moving to the next stop.

Stage 1 · Week 1–2

Programming Basics in Java

Get comfortable writing and running Java programs before touching data structures.

  • Variables & data types
  • Operators
  • if-else & switch
  • Loops
  • Functions / methods
  • Pattern programs

Practice: Solve 20–30 basic logic problems (even/odd, prime, factorial, patterns).

Stage 2 · Week 3

Time & Space Complexity

Learn to measure how fast and how memory-hungry your code is – every interviewer asks this.

  • Big O, Big Ω, Big Θ
  • Best / average / worst case
  • Complexity of loops
  • Space complexity

Practice: Write the complexity of every program you solve from now on.

Stage 3 · Week 4–6

Arrays & Strings

The most asked topic in coding rounds. Master the core patterns here.

  • 1D & 2D arrays
  • Two pointers
  • Sliding window
  • Prefix sum
  • Kadane's algorithm
  • String manipulation
  • StringBuilder

Practice: Solve 40+ problems – e.g. Two Sum, Best Time to Buy Stock, Longest Substring Without Repeating Characters.

Milestone: 50+ problems solved – you can clear basic online coding tests
Stage 4 · Week 7–8

Recursion & Backtracking

Recursion is the base for trees, graphs and DP, so build strong intuition here.

  • Recursion basics & call stack
  • Head vs tail recursion
  • Subsets & permutations
  • N-Queens
  • Sudoku solver

Practice: Dry-run every recursive solution on paper before coding it.

Stage 5 · Week 9–10

Searching & Sorting

Classic algorithms that appear directly or as building blocks in other problems.

  • Linear & binary search
  • Binary search on answer
  • Bubble, selection, insertion sort
  • Merge sort
  • Quick sort

Practice: Implement each sorting algorithm yourself, then solve 15 binary search problems.

Stage 6 · Week 11–12

Linked List, Stack & Queue

Linear data structures with pointer manipulation – very common in interviews.

  • Singly & doubly linked list
  • Fast & slow pointers
  • Reverse a linked list
  • Stack & monotonic stack
  • Queue, deque & circular queue

Practice: Solve Reverse Linked List, Detect Cycle, Valid Parentheses, Next Greater Element.

Stage 7 · Week 13

Hashing

HashMap and HashSet turn many O(n²) solutions into O(n).

  • HashMap & HashSet
  • Frequency counting
  • hashCode & collisions
  • Subarray sum problems

Practice: Re-solve 10 older array problems using hashing and compare complexity.

Milestone: 120+ problems – ready for service-company technical rounds
Stage 8 · Week 14–16

Trees & Binary Search Tree

Hierarchical data structures – a must for product-based company interviews.

  • Binary tree traversals
  • Level order (BFS)
  • Height & diameter
  • BST insert / delete / search
  • Lowest Common Ancestor

Practice: Solve 25 tree problems; practise both recursive and iterative traversals.

Stage 9 · Week 17

Heaps & Priority Queue

Used for “top K”, scheduling and streaming problems.

  • Min heap & max heap
  • PriorityQueue in Java
  • Top K elements
  • Merge K sorted lists

Practice: Solve Kth Largest Element and Top K Frequent Elements.

Stage 10 · Week 18–20

Graphs

Graphs model networks, maps and dependencies – high-value topic for product companies.

  • Adjacency list & matrix
  • BFS & DFS
  • Cycle detection
  • Topological sort
  • Dijkstra's algorithm
  • Union-Find

Practice: Solve Number of Islands, Course Schedule, Rotting Oranges.

Stage 11 · Week 21–23

Dynamic Programming

The toughest but most rewarding topic. Start with recursion + memoization, then move to tabulation.

  • Memoization (top-down)
  • Tabulation (bottom-up)
  • 1D DP
  • 0/1 Knapsack
  • Longest Common Subsequence
  • DP on grids

Practice: Solve 30 DP problems – Climbing Stairs, House Robber, Coin Change, LCS.

Stage 12 · Week 24+

Interview Practice & Mock Tests

Convert knowledge into interview performance with timed practice.

  • Timed contests
  • Mock interviews
  • Company-wise questions
  • Explaining your approach aloud

Practice: Give at least 1 timed contest and 1 mock interview every week.

You are interview-ready: 250+ problems solved across all major patterns
Advertisements

Projects to Build

Beginner

Student Marks Analyzer

Use arrays, sorting and searching to rank students and find toppers.

Intermediate

LRU Cache

Build an LRU cache with HashMap + doubly linked list – a real interview question.

Advanced

Route Finder

Find the shortest path between cities using graphs and Dijkstra's algorithm.

Tips to Succeed

  1. Consistency beats intensity – 2 problems every day is better than 20 on Sunday.
  2. Understand, don’t memorise – after solving, write the pattern used in one line.
  3. Stuck for 30–40 minutes? Read the hint or solution, then re-solve it yourself the next day.
  4. Revise – keep a list of problems you could not solve and retry them weekly.
  5. Talk while coding – interviewers judge your approach, not just the final answer.

Frequently Asked Questions

How long does it take to learn DSA?

With 2–3 hours of daily practice, most students complete this roadmap in 5–6 months. If you already know programming basics, you can finish in about 4 months.

Which language is best for DSA – Java or C++?

Both are good. Java is a great choice if you also want to become a Java backend or full stack developer, because the same language helps you in projects and interviews.

How many LeetCode problems are enough for placements?

Around 250–300 well-understood problems covering all major patterns is enough for most service and product-based companies. Quality matters more than count.

Can I learn DSA without a CS background?

Yes. This roadmap starts from programming basics, so non-CS students can follow it step by step.

Advertisements

Learn DSA with Deepak Panwar

Want a guided path? Our DSA using Java course covers every stage of this roadmap with 200+ coding and LeetCode problems.

Explore Other Roadmaps

Hello Coder, how can I help you ?