Python for Interviews

The Python that interview solutions rely on: collections, heapq, sorting keys.

Core Techniques

Complexity analysis, recursion and divide & conquer: the reasoning behind every pattern.

Arrays & Hashing

Lookups, counting, prefix sums, sorting, grids and in-place index tricks.

Two Pointers & Windows

Linear scans with two indices or a moving window.

Stacks & Queues

LIFO/FIFO structures and their monotonic variants.

Linked Lists

Pointer manipulation on singly linked lists.

Trees

Traversals, BST properties, paths and construction.

Heaps

Priority queues for top-K, medians and merging.

Graphs

Traversal, ordering, connectivity and shortest paths.

Backtracking

Exhaustive search with pruning.

Dynamic Programming

Optimal substructure with memoisation or tables.

Greedy & Intervals

Locally optimal choices and interval reasoning.

String Algorithms

Palindromes and substring search.

Advanced Data Structures

Tries, range-query trees and custom designs.

Math & Bits

Bitwise tricks and number theory.