Tech_Interview_Prep

Data Structures & Algorithms

Core data structures, complexity analysis, and problem-solving patterns.

Subject: Programming Fundamentals · Roles: AI Engineer, Data Scientist, Machine Learning Engineer, Robotics Engineer, Software Engineer

Concepts

Arrays & Hashing

Contiguous storage, O(1) average-case lookups via hash maps, and the frequency-counting patterns they enable.

Two Pointers

Two indices moving through a sequence — from opposite ends or in lockstep — to cut brute-force O(n²) scans to O(n).

Stacks

LIFO ordering for tracking nested structure — matching parentheses, undo history, and monotonic sequences.

Binary Search

Halving the search space on sorted data, and the many variants beyond a plain lookup.

Sliding Window

A variable- or fixed-size window over a sequence, expanded and contracted in O(n) total instead of recomputing from scratch.

Linked Lists

Singly/doubly linked lists, pointer manipulation, and the classic two-pointer patterns.

Trees

Hierarchical node structures built on the same pointer discipline as linked lists, traversed via recursion or an explicit stack/queue.

Tries

A tree specialized for prefix operations over strings — each edge is a character, each path from the root is a prefix.

Heaps / Priority Queues

A tree-shaped structure that keeps the min (or max) element accessible in O(1), with O(log n) insert and remove.

Backtracking

Recursive brute-force search with early pruning — build a partial solution, and abandon it the moment it can't possibly work.

Graphs

Nodes and edges generalizing trees to arbitrary connections — cycles, multiple parents, and disconnected components all allowed.

Advanced Graphs

Weighted shortest paths and connectivity beyond plain BFS/DFS — Dijkstra, Union-Find, and minimum spanning trees.

Intervals

Ranges with a start and end — sorting by start (or end) turns overlap and merge problems into a single linear pass.

Greedy Algorithms

Making the locally-best choice at each step and never revisiting it — correct only when the problem has the right structural guarantee.

1-D Dynamic Programming

Breaking a problem into overlapping subproblems indexed by a single variable, solved once each and reused.

2-D Dynamic Programming

DP where the subproblem needs two indices — grid paths, two-string comparisons, and knapsack-style capacity constraints.

Bit Manipulation

Working directly on a number's binary representation with AND/OR/XOR/shifts — for O(1) tricks and memory-efficient state.

Math & Geometry

Problems that lean on a specific mathematical insight — number theory, combinatorics, or coordinate geometry — rather than a general algorithmic pattern.