Patterns

Interview patterns

If you're getting started, the win is recognizing the pattern—the family a problem belongs to—and knowing what to do next on the board. Karkai is built around that, not around grinding a huge problem count.

Each card below describes what the pattern is for. Where a track is live, use Open in workspace for guided, hands-on practice on the live board with reviews in the same place.

  • Two pointers

    Move indices on arrays or sequences to shrink a search space—common on sorted data, merging streams, and palindrome-style walks.

  • Sliding window

    Coming soon

    Maintain a window over an array or string—fixed or variable size—with O(1) updates as it slides.

  • Binary search

    Coming soon

    Halve the search space on sorted structure—or on an implicit “answer space” when the predicate is monotone.

  • BFS & DFS

    Coming soon

    Systematic traversal for trees, grids, and graphs—levels vs depth, stacks vs queues, visited sets.

  • Dynamic programming

    Coming soon

    Overlapping subproblems and optimal substructure—tables, memoization, and classic recurrence families.

  • Greedy

    Coming soon

    Local choices that stay safe under an exchange argument—often after sorting or a clear ordering.

  • Backtracking

    Coming soon

    Build candidates incrementally, prune when constraints fail—permutations, subsets, boards, and words.

  • Heaps & top-K

    Coming soon

    Priority queues for running medians, scheduling, and k-way merges—log-time inserts and extracts.

  • Trees & BST

    Coming soon

    Traversals, parent pointers, balanced structures, and classic tree interview idioms.

  • Graphs

    Coming soon

    Shortest paths, ordering, components, and weighted edges—adjacency models you can reason about fast.

  • Union-find

    Coming soon

    Track connected components with near-constant merges and finds—great for dynamic connectivity.

  • Bit manipulation

    Coming soon

    Masks, XOR tricks, and low-level patterns for subsets, parity, and compact state.

Home