Two Pointers
Coordinate two indices to eliminate candidate pairs or partition an ordered search space.
Map 93 reviewed Python Interview Skills across Patterns, Data Structures, and Algorithms. Filter by a recognition signal or open the family that needs reinforcement.
recognize → choose → prove
Showing 93 Skills
Family 1 of 3
Recognize reusable problem shapes and preserve their invariants.
Coordinate two indices to eliminate candidate pairs or partition an ordered search space.
Move pointers inward from both ends when ordering lets each comparison discard candidates.
Advance read and write pointers in one direction for compaction, partitioning, or deduplication.
Advance pointers at different speeds to detect cycles, middles, or repeated state.
Maintain an incrementally updated contiguous range instead of recomputing every subarray.
Slide a window of constant length while adding the entering value and removing the leaving value.
Expand and contract a window to preserve a validity invariant and optimize its length or score.
Precompute cumulative aggregates so range queries become constant-time differences.
Use cumulative matrix regions and inclusion-exclusion to answer rectangular range queries.
Encode range updates at boundaries and reconstruct final values with a prefix accumulation.
Maintain ordered unresolved candidates for next-greater, next-smaller, and span problems.
Maintain a deque ordered by value to query window extrema while elements enter and leave.
Family 2 of 3
Choose storage and access behavior that matches the operations.
Contiguous indexed sequence used for random access, scanning, and in-place transformations.
Two-dimensional indexed data commonly treated as rows, columns, or an implicit graph.
Immutable character sequence used in parsing, matching, sliding-window, and dynamic-programming tasks.
Key-value structure providing average constant-time lookup, update, and frequency aggregation.
Unique-key structure for average constant-time membership and duplicate detection.
Node sequence connected by references, favoring local insertion over random access.
Last-in-first-out structure for nested state, expression evaluation, and iterative traversal.
First-in-first-out structure for breadth-first traversal, scheduling, and ordered processing.
Double-ended queue supporting constant-time insertion and removal at both ends.
Partially ordered tree-backed structure supporting efficient minimum or maximum extraction.
Abstract queue that removes the highest-priority item, commonly implemented with a heap.
Hierarchical acyclic structure used for recursive aggregation, search, and ordered relationships.
Family 3 of 3
Apply explainable procedures with explicit preconditions and bounds.
Locate a value, state, path, or feasible answer inside an explicit or implicit search space.
Inspect candidates sequentially when no exploitable ordering or index is available.
Repeatedly halve an ordered or monotone search space using a boundary invariant.
Explore a branch completely before backtracking, using recursion or an explicit stack.
Explore states level by level, yielding shortest unweighted path lengths from the source set.
Enumerate constrained candidates by choosing, exploring, pruning, and undoing decisions.
Solve a problem by reducing it to smaller instances with explicit base cases.
Solve overlapping subproblems once and combine their results under a state transition.
Make locally optimal choices only when an exchange or invariant proves global correctness.
Split a problem into independent subproblems, solve them recursively, and combine results.
Reorder values by a comparison or key to expose structure for subsequent processing.
Recursively sort halves and merge them in stable O(n log n) time with auxiliary storage.