dsa

    Arrays & Strings Course

    Master production-grade problem solving, algorithm thinking, array manipulation, string processing & coding interview patterns.

    120
    Lessons
    8
    Modules
    0/120
    Completed

    Architecture

    Array Traversal & Algorithm Lifecycle

    From input array to optimized output — through traversal, condition checks, processing and result accumulation.

    Input Array
    n elements
    Loop / Pointers
    i, j, l, r
    Condition Check
    logic
    Processing
    compute
    State Update
    best / sum
    Output
    result
    Two Pointers
    Opposite · Fast/Slow
    Sliding Window
    Fixed · Dynamic
    Binary Search
    Sorted · Rotated · Answer
    Prefix / Kadane
    Range sums · Max subarray
    Curriculum

    Enterprise learning path

    8 modules · 120 lessons

    Arrays Fundamentals

    0/15 complete
    1. 1
      Arrays Home
      Next up

      An array is a collection of items stored in contiguous memory locations.

    2. 2
      Introduction to Arrays

      An array stores multiple values under a single variable name, accessed by an index.

    3. 3
      How Arrays Work

      Arrays use contiguous memory blocks.

    4. 4
      Static vs Dynamic Arrays

      Static arrays have a fixed length (C arrays, Java arrays).

    5. 5
      Array Memory Representation

      Every array element sits next to the previous one in RAM.

    6. 6
      Array Traversal

      Traversal means visiting every element exactly once.

    7. 7
      Insertion in Arrays

      Inserting at the end is O(1) amortized.

    8. 8
      Deletion in Arrays

      Deleting an element requires shifting later elements left to fill the gap.

    9. 9
      Updating Array Elements

      Updating is O(1): you compute the address from the index and overwrite the value.

    10. 10
      Array Time Complexity

      Access O(1), search O(n), insert at end O(1) amortized, insert/delete in middle O(n).

    11. 11
      Multi-Dimensional Arrays

      2D arrays are arrays of arrays — a grid of rows and columns.

    12. 12
      Common Array Operations

      Sum, average, min, max, reverse, copy, fill, contains.

    13. 13
      Array Patterns

      Patterns: prefix sum, sliding window, two pointers, fast/slow, sort+scan, hashmap counting.

    14. 14
      Prefix Sum Basics

      Prefix sum lets you answer 'sum of any subarray' in O(1) after O(n) preprocessing.

    15. 15
      Kadane's Algorithm

      Kadane finds the maximum sum contiguous subarray in O(n).

    String Fundamentals

    0/15 complete
    1. 16
      Introduction to Strings

      A string is a sequence of characters.

    2. 17
      String Memory Representation

      Strings are stored as contiguous arrays of bytes (ASCII) or code units (UTF-16, UTF-8).

    3. 18
      String Traversal

      Loop from i=0 to length-1, read s[i].

    4. 19
      Character Arrays

      A char[] is a mutable array of characters.

    5. 20
      Immutable vs Mutable Strings

      String objects in Java/Python/JS are immutable — every concatenation creates a new object.

    6. 21
      String Manipulation

      Splitting, joining, replacing, trimming, slicing — basic transformations every developer uses daily.

    7. 22
      String Comparison

      == compares references, equals/strcmp/.compareTo compares characters.

    8. 23
      String Builder Concepts

      StringBuilder uses a resizable char buffer to append in O(1) amortized.

    9. 24
      Palindrome Problems

      A palindrome reads the same forwards and backwards.

    10. 25
      Frequency Counting

      Count character occurrences with a 26-int array (lowercase) or HashMap.

    11. 26
      Anagram Problems

      Two strings are anagrams if they contain the same characters in any order.

    12. 27
      Pattern Matching Basics

      Finding a pattern P inside text T.

    13. 28
      ASCII & Unicode

      ASCII has 128 chars (0-127).

    14. 29
      String Complexity Analysis

      Length n: traversal O(n), substring O(k), concat O(n+m), sort O(n log n), naive search O(n·m).

    15. 30
      Real-World String Problems

      Validating email, parsing URLs, sanitizing user input, building a search engine, log-line parsing — strings are everywhere.

    Array Algorithms

    0/15 complete
    1. 31
      Linear Search

      Walk through every element until found.

    2. 32
      Binary Search

      Search a sorted array in O(log n) by repeatedly halving the range.

    3. 33
      Bubble Sort

      Repeatedly swap adjacent out-of-order pairs.

    4. 34
      Selection Sort

      Find the smallest element and put it at index 0, then the next smallest at index 1, and so on.

    5. 35
      Insertion Sort

      Build the sorted prefix one element at a time.

    6. 36
      Merge Sort Basics

      Divide array in half, sort each half recursively, merge in O(n).

    7. 37
      Quick Sort Basics

      Pick a pivot, partition smaller/larger elements, recurse.

    8. 38
      Two Sum Problem

      Find two indices i,j such that nums[i]+nums[j]=target.

    9. 39
      Maximum Subarray

      Find the contiguous subarray with the largest sum.

    10. 40
      Rotate Array

      Shift array right by k.

    11. 41
      Move Zeroes

      Move all zeros to the end without changing relative order.

    12. 42
      Product Array Puzzle

      Build array where output[i] = product of all nums except nums[i] — without division and in O(n).

    13. 43
      Prefix Sum Problems

      Range-sum, equilibrium index, subarray sum equals K.

    14. 44
      Difference Array

      To apply many range increments efficiently, store +x at l and -x at r+1; one prefix sum at the end gives final array.

    15. 45
      Advanced Array Patterns

      Monotonic deque, sparse table, Mo's algorithm, square-root decomposition — patterns above the basics that solve the hardest problems.

    String Algorithms

    0/15 complete
    1. 46
      Reverse String

      Use two pointers from both ends and swap.

    2. 47
      Reverse Words

      Reverse the entire string, then reverse each word.

    3. 48
      Longest Common Prefix

      Compare characters of all strings index-by-index until mismatch.

    4. 49
      Longest Substring Without Repeating

      Sliding window + hashmap.

    5. 50
      String Compression

      Run-length encode 'aaabb' as 'a3b2'.

    6. 51
      Rabin-Karp Basics

      Compare rolling hashes to find pattern in O(n+m) average.

    7. 52
      KMP Algorithm Introduction

      Build failure function so the pattern never re-checks prefixes.

    8. 53
      Z Algorithm Basics

      Compute Z[i] = longest substring starting at i that matches a prefix.

    9. 54
      Sliding Window on Strings

      Maintain a moving window with character counts.

    10. 55
      String Hashing Basics

      Polynomial rolling hash for fast substring comparison.

    11. 56
      Regex Basics

      Patterns to describe strings: anchors, character classes, quantifiers, groups, lookaheads.

    12. 57
      Text Processing Problems

      Word count, log parsing, CSV splitting, tokenizing — daily backend chores.

    13. 58
      Encoding & Decoding

      Run-length, base64, URL encode, JSON escape — convert strings between formats safely.

    14. 59
      String Optimization Problems

      Minimum operations to make equal, longest palindromic substring, edit distance — DP-heavy challenges.

    15. 60
      Advanced String Challenges

      Suffix arrays, suffix trees, Aho-Corasick — state-of-the-art techniques for search and bioinformatics.

    Searching & Sorting

    0/15 complete
    1. 61
      Searching Algorithms

      Linear, binary, ternary, exponential, interpolation — pick the one that fits your data and constraints.

    2. 62
      Binary Search Patterns

      Lower bound, upper bound, search-on-answer, rotated arrays.

    3. 63
      Lower Bound & Upper Bound

      Lower bound: first index ≥ x.

    4. 64
      Sorting Fundamentals

      Comparison-based sorts can't beat O(n log n).

    5. 65
      Stable vs Unstable Sorting

      A stable sort preserves the relative order of equal keys.

    6. 66
      Merge Sort Deep Dive

      External sorting, parallel merge sort, in-place variants.

    7. 67
      Quick Sort Deep Dive

      Random pivot, three-way partition (Dutch flag), introsort.

    8. 68
      Heap Sort Basics

      Build a max heap in O(n), extract max n times.

    9. 69
      Counting Sort

      O(n + k) when keys are integers in range [0, k].

    10. 70
      Bucket Sort

      Distribute into k buckets, sort each, concatenate.

    11. 71
      Searching in Rotated Arrays

      Modified binary search; pick the sorted half each step.

    12. 72
      Peak Element Problems

      Binary search on slope direction.

    13. 73
      Search Optimization

      Index, sort once and binary search many times, cache hot keys, use bloom filters for membership.

    14. 74
      Sorting Complexity Analysis

      Time, space, stability, in-place — choose by constraints, not by name.

    15. 75
      Real Interview Problems

      Sort + two pointers, sort + binary search, sort + greedy — hybrid recipes from FAANG sets.

    Sliding Window & Two Pointers

    0/15 complete
    1. 76
      Sliding Window Introduction

      Maintain a window over the array and slide it instead of recomputing every range.

    2. 77
      Fixed Size Window

      Window of size k slides one step at a time; add the new element, drop the old.

    3. 78
      Dynamic Window

      Window grows when valid, shrinks when invalid.

    4. 79
      Two Pointer Basics

      Two indices traverse the array.

    5. 80
      Opposite Direction Pointers

      One starts at the beginning, one at the end; they move toward each other.

    6. 81
      Fast & Slow Pointer

      Fast moves twice as fast as slow.

    7. 82
      Longest Subarray Problems

      Longest with sum=k, longest with at most k distinct, longest no-repeat — all sliding window patterns.

    8. 83
      Minimum Window Problems

      Find shortest substring containing all chars of T.

    9. 84
      Subarray Sum Problems

      Subarray sum equals k via prefix sum + hashmap; subarray with sum divisible by k via mod hashmap.

    10. 85
      Duplicate Detection

      HashSet, sort+scan, frequency array, Floyd's cycle on indices — many ways to find duplicates.

    11. 86
      Partition Problems

      Dutch flag, segregate odd/even, sort colors — partition with two or three pointers in O(n).

    12. 87
      Window Optimization

      Use deque to maintain max/min in O(1) per element.

    13. 88
      Pattern Recognition

      Nested loop with j depending on i?

    14. 89
      Real Coding Interview Patterns

      Top 50 LeetCode patterns walkthrough — every one comes back as a slight variation.

    15. 90
      Advanced Window Challenges

      Sliding window median, k-distinct subarray, count of nice subarrays — when basic windows aren't enough.

    Advanced Problem Solving

    0/15 complete
    1. 91
      Greedy Array Problems

      Make the locally optimal choice at every step.

    2. 92
      Matrix Problems

      2D grid traversals, row/column ops, transpose, in-place rotation.

    3. 93
      Spiral Traversal

      Visit a 2D matrix in spiral order with four pointers — top, bottom, left, right.

    4. 94
      Monotonic Stack Basics

      Stack that only keeps increasing (or decreasing) elements.

    5. 95
      Prefix & Suffix Techniques

      Combine prefix and suffix arrays to answer range queries without nested loops.

    6. 96
      HashMap Optimization

      Convert nested loop searches into O(1) lookups.

    7. 97
      Frequency Arrays

      Fixed-size int[26] or int[256] beats HashMap for ASCII problems by 5-10×.

    8. 98
      Sparse Arrays

      Most cells are zero — store only non-zero entries with HashMap or coordinate list.

    9. 99
      Compression Algorithms

      Run-length, Huffman, LZ77 — turn long arrays into short ones with no info loss.

    10. 100
      Data Stream Problems

      Process elements one at a time without storing all of them.

    11. 101
      Competitive Programming Tricks

      Bit manipulation, modular arithmetic, lookup tables, precomputation — gain milliseconds.

    12. 102
      Memory Optimization

      Reuse buffers, in-place ops, primitive arrays vs object arrays, Java -Xmx tuning.

    13. 103
      Time Complexity Optimization

      Replace O(n²) with O(n log n) via sort+pointer, or with O(n) via hashmap.

    14. 104
      Real Production Algorithm Cases

      Pagination, search ranking, recommendation, deduplication — algorithms running 24/7 in real systems.

    15. 105
      Enterprise Problem Solving

      Throughput, latency, SLA, observability — algorithms that survive production load.

    Practice & Interview Preparation

    0/15 complete
    1. 106
      Arrays Exercises

      20 hand-picked problems covering every fundamental array pattern, ordered easy → hard.

    2. 107
      Strings Exercises

      20 string problems from reverse to KMP — graded difficulty.

    3. 108
      Sorting Challenges

      Custom comparators, sort-then-scan, k-th element, top-k frequent.

    4. 109
      Sliding Window Challenges

      Top-15 LeetCode sliding window questions with full solutions.

    5. 110
      Binary Search Challenges

      Search-on-answer problems: ship-capacity, koko-bananas, split-array.

    6. 111
      Coding Interview Questions

      100+ FAANG-style questions with hints, brute force, optimal, and follow-ups.

    7. 112
      Mock DSA Interviews

      Three full 45-minute mock interview scripts with rubric and feedback.

    8. 113
      LeetCode Style Problems

      Curated path: 75 essential problems → 150 → 300.

    9. 114
      Real Interview Scenarios

      'Walk me through how you'd…' open-ended scenarios that test communication.

    10. 115
      FAANG Problem Solving

      Google, Meta, Amazon, Apple, Microsoft — the patterns each company favours.

    11. 116
      Optimization Challenges

      Take a working O(n²) and reach O(n log n) or O(n).

    12. 117
      Debugging Tasks

      Spot the off-by-one, the wrong base case, the integer overflow — train your eye.

    13. 118
      Whiteboard Coding Practice

      No autocomplete, no compiler — neat handwriting + think-aloud habits.

    14. 119
      Pattern Recognition Challenges

      Given a problem, name the pattern in under 30 seconds.

    15. 120
      Enterprise Coding Assessments

      HackerRank, Codility, CoderPad style timed tests with sample rubrics.