Interview Readiness — Master Recap and Final Cheatsheet

Sanjeev SharmaSanjeev Sharma
3 min read

Advertisement

The Complete Interview Cheatsheet


Pattern Recognition — At a Glance

Input is sorted?
Binary search, two pointers

Find all combinations / subsets?
Backtracking

Shortest path, fewest steps?
BFS

Any valid path / all paths?
DFS

Minimum cost, maximum value?
DP

Overlapping intervals?
Sort by start, greedy merge / heap

Top K elements?
Heap (min-heap of size K)

Substring with constraint?
Sliding window

Contiguous subarray sum?
Prefix sum + hashmap

Frequency / duplicates?
HashMap / Counter

Prefix match / autocomplete?
Trie

Range queries?
Segment Tree / BIT

Graph connectivity?
Union-Find

Ordering with dependencies?
Topological sort

Running median?
Two heaps

Next greater / smaller element?
Monotonic stack

Complexity Cheatsheet

AlgorithmTimeSpace
BFS / DFSO(V+E)O(V)
Dijkstra (heap)O((V+E) log V)O(V)
Binary SearchO(log n)O(1)
Merge SortO(n log n)O(n)
Heap push/popO(log n)O(n)
HashMap get/setO(1) avgO(n)
Trie insert/searchO(L)O(ALPHABET × N × L)
Union-FindO(α(n)) ≈ O(1)O(n)
Segment TreeO(log n)O(n)
LRU get/putO(1)O(n)
1D DPO(n) or O(n²)O(n) or O(1)
2D DPO(mn)O(mn) or O(n)

The STAR Story Index

Story 1: Biggest impact project → "Invent and Simplify" / "Deliver Results"
Story 2: Disagreed with manager → "Have Backbone; Disagree and Commit"
Story 3: Failure and recovery → "Learn and Be Curious"
Story 4: Learned fast → "Learn and Be Curious"
Story 5: Incomplete data decision → "Bias for Action" / "Are Right, A Lot"
Story 6: Improved a process → "Invent and Simplify" / "Frugality"
Story 7: Tough feedback → "Earn Trust"
Story 8: Mentored someone → "Hire and Develop the Best"
Story 9: Competing priorities → "Deliver Results"
Story 10: Above and beyond → "Ownership" / "Customer Obsession"

The UMPIRE Checklist (Per Problem)

UUnderstood the problem? (restate + ask edge cases)
MMatched to a pattern?
PPlanned with pseudocode?
IImplemented cleanly?
RReviewed with test case?
EEvaluated complexity?

Company Quick Reference

GoogleMetaAmazon
Rounds4-545-6
StyleAnalyticalFast-pacedLP-heavy
Key topicsGraphs, DPArrays, TreesBFS, Design
ValuesGoogleynessMove FastLeadership Principles
System designL5+E5+SDE II+
Coding speedModerateFastModerate
Hint cultureWill hintMay hintExpects self-recovery

Closing Mindset

Three things to remember on interview day:

  1. The interviewer wants you to succeed — they're rooting for you, not trying to catch you out.

  2. Communication > cleverness — a clearly explained O(n²) solution beats a silent O(n) one.

  3. Progress is visible — saying "I'd start with X and optimise to Y given more time" shows engineering judgment even if you don't finish.

You've put in the work. Trust the preparation.

Advertisement

Sanjeev Sharma

Written by

Sanjeev Sharma

Full Stack Engineer · E-mopro