๐Ÿง  Data Structures & Algorithms

The #1 skill that decides your placement. Learn every core data structure with plain-English explanations, then prove it by solving real interview problems in our built-in online judge โ€” no signup, everything free.

โšก Start Solving Problems โ†’
24
Practice Problems
9
Core Topics
100%
Free, No Login
โœ“
Instant Test Feedback

Core Topics

Each topic below maps directly to problems in the practice judge โ€” learn the idea, then immediately solve.

๐Ÿ“Š

Arrays

Beginner ยท Most asked in interviews

The foundation of everything. Contiguous memory, O(1) access by index. Interviews love array manipulation: traversals, in-place edits, prefix sums, and the two-pointer pattern.

TraversalTwo PointersPrefix SumKadane's
๐Ÿ”ค

Strings

Beginner ยท TCS/Infosys favourite

Strings are arrays of characters with extra tricks: frequency counting, palindromes, anagrams, and sliding windows. Service-company coding rounds are ~40% string problems.

ReversalPalindromeAnagramSliding Window
๐Ÿ—บ๏ธ

HashMaps & Sets

Beginner ยท The O(n) superpower

Key โ†’ value lookup in O(1). The single most useful interview tool: turns O(nยฒ) brute-force into O(n). In JavaScript: Map, Set, or plain objects.

Frequency CountLookupDeduplication
๐Ÿ“š

Stacks & Queues

Intermediate ยท CS3301 core

Stack = Last-In-First-Out (undo, brackets, recursion). Queue = First-In-First-Out (scheduling, BFS). The "valid parentheses" problem is asked in nearly every fresher interview.

LIFO / FIFOpush / popBracket Matching
๐Ÿ”—

Linked Lists

Intermediate ยท Pointer thinking

Nodes connected by pointers โ€” O(1) insert/delete, O(n) access. Interviewers use linked lists to test whether you can reason about references. "Reverse a linked list" is the classic.

TraversalReversalFast/Slow Pointers
๐Ÿ”

Searching

Intermediate ยท O(log n) magic

Linear search checks everything: O(n). Binary search halves the space each step: O(log n) โ€” but only on sorted data. Off-by-one bugs here fail more interviews than any other topic.

LinearBinary Searchlo/hi Pointers
โ†•๏ธ

Sorting

Intermediate ยท Know the trade-offs

Bubble/Selection/Insertion are O(nยฒ) teaching tools; Merge Sort and Quick Sort are the O(n log n) real deals. Interviews rarely ask you to write a full sort โ€” they ask about the merge step and complexity trade-offs.

Merge SortQuick SortStability
๐ŸชŸ

Sliding Window & Two Pointers

Advanced ยท Product-company pattern

The pattern behind most "substring/subarray" problems. Maintain a moving window and shrink/grow it instead of re-checking everything โ€” O(nยฒ) becomes O(n). Zoho and Freshworks love these.

Window Expand/ShrinkSubstring Problems
๐Ÿงฉ

Dynamic Programming

Advanced ยท Digital/Prime level

Break a problem into overlapping subproblems and remember answers. Start with Fibonacci and Climbing Stairs, then Coin Change. Needed for TCS Digital/Prime and product companies โ€” not for Ninja-level rounds.

MemoizationBottom-updp[] tables

Big-O Cheat Sheet

The one table to memorize before any technical interview.

Structure / AlgorithmAccessSearchInsertDeleteNotes
ArrayO(1)O(n)O(n)O(n)Insert/delete shift elements
HashMapโ€”O(1)*O(1)*O(1)**average case
Linked ListO(n)O(n)O(1)O(1)O(1) if you have the node
Stack / QueueO(n)O(n)O(1)O(1)Only at the ends
Binary Searchโ€”O(log n)โ€”โ€”Sorted data only
Bubble / Insertion Sortโ€”โ€”O(nยฒ)Fine for tiny inputs
Merge / Quick Sortโ€”โ€”O(n log n)Merge = stable; Quick = in-place
BST (balanced)O(log n)O(log n)O(log n)O(log n)Degrades to O(n) if skewed

Your 6-Week DSA Roadmap

2 hours a day. By week 6 you're ready for any service-company round and most product-company screens.

1

Week 1 โ€” Arrays & Strings

Learn traversal, reversal, frequency counting. Solve problems 1โ€“10 in the practice judge (all Easy). Aim for 2 per day.

2

Week 2 โ€” HashMaps & Two Pointers

Re-solve Two Sum and Anagram using maps in O(n). Then Move Zeroes and Remove Duplicates with two pointers.

3

Week 3 โ€” Stack, Queue & Linked List

Valid Parentheses, then Reverse Linked List. Draw the pointer diagrams on paper โ€” never solve linked lists in your head.

4

Week 4 โ€” Searching & Sorting

Binary Search until the off-by-ones stop biting. Implement the merge step. Understand why Quick Sort is O(n log n) average, O(nยฒ) worst.

5

Week 5 โ€” Sliding Window & Intro DP

Longest Substring, Max Subarray (Kadane), Climbing Stairs, Fibonacci iteratively. These four unlock half of all Medium problems.

6

Week 6 โ€” Hard Problems & Mock Interviews

Coin Change, Product Except Self, Trapping Rain Water. Then do timed mocks: 2 problems in 45 minutes, explaining your approach out loud. Pair with our TCS NQT guide and interview question bank.

Keep Going

DSA pairs with everything else on this site: