Skip to content
Use code for 50% offSee plans

Interview Cheat Sheets for Tech Candidates: What to Keep in Memory

Interview Cheat Sheets for Tech Candidates: What to Keep in Memory

The reference tables every software engineer should memorize before a coding or system design interview, organized as readable cheat sheets you can print and scan.

By PhantomCodeAI Team

TL;DR

  • The point of an interview cheat sheet is not to read during the round but to pre-load common facts so working memory is free for reasoning.
  • Memorize the big-O table, data-structure operation costs, sorting tradeoffs, graph algorithms, concurrency primitives, HTTP status codes, SQL versus NoSQL choices, system design building blocks, and capacity-estimation latencies.
  • Read each table, cover it, reproduce it, then explain it out loud as if to a junior.
  • You own a cheat sheet only when you can recreate it from scratch in under two minutes.

Introduction

You cannot open Google during an interview. The point of a cheat sheet is not to give you something to read during the round, it is to pre-load the facts you will need so your working memory is free for reasoning. The best interview candidates are not the ones who know more, they are the ones whose most common questions take up zero thinking cost.

This guide is a compact set of cheat sheets you should be able to recite. Read them. Then cover them and reproduce each table from memory. You will know you own them when you can draw the whole big-O table on a whiteboard in under two minutes.

Table of Contents

  1. How to use these cheat sheets
  2. Big-O complexity table
  3. Data structure tradeoffs
  4. Sorting algorithms comparison
  5. Graph algorithms cheat sheet
  6. Concurrency primitives
  7. HTTP status code map
  8. SQL versus NoSQL choices
  9. System design building blocks
  10. Capacity estimation numbers
  11. Common pitfalls and edge cases
  12. FAQ
  13. Conclusion

1. How to Use These Cheat Sheets

Do not print them and stare at them during the interview. Interviewers can tell. Instead, use this cycle:

DayAction
1Read each table slowly
2Cover the table, reproduce it
3Explain each row out loud as if to a junior engineer
4Write all tables from scratch
5Recall during a warm-up set before a mock interview

Knowledge becomes useful only after you can retrieve it under load. That is the bar. Regular mock interviews with a structured debrief are a realistic way to check whether you clear it.

2. Big-O Complexity Table

Common complexities, from fastest to slowest

NotationNameExample
O(1)ConstantHash lookup
O(log n)LogarithmicBinary search
O(n)LinearSingle pass over array
O(n log n)LinearithmicMerge sort, quick sort average
O(n^2)QuadraticNested loops over same array
O(n^3)CubicTriple nested loops
O(2^n)ExponentialSubset enumeration
O(n!)FactorialPermutation enumeration

Core operations by data structure

StructureAccessSearchInsertDeleteSpace
ArrayO(1)O(n)O(n)O(n)O(n)
Dynamic arrayO(1)O(n)O(1) amortizedO(n)O(n)
Linked listO(n)O(n)O(1) at known nodeO(1) at known nodeO(n)
Hash table-O(1) avgO(1) avgO(1) avgO(n)
Binary search tree, balancedO(log n)O(log n)O(log n)O(log n)O(n)
HeapO(1) topO(n)O(log n)O(log n) topO(n)
TrieO(k)O(k)O(k)O(k)O(n*k)

n is number of elements, k is length of key.

3. Data Structure Tradeoffs

When to pick what

NeedPick
Fast random access by indexArray
Fast key to value lookupHash table
Ordered keys with range queriesBalanced BST or sorted map
Top-K by priorityHeap
Frequent prefix lookupTrie
Membership test with small memoryBloom filter
LRU cache semanticsDoubly linked list plus hash
Disjoint sets / connectivityUnion-Find
Undo history, matching parensStack
BFS, rate limiting queueQueue
Range sum, range updateFenwick tree or segment tree

Hash table pitfalls

PitfallFix
Mutable keysUse immutable types or tuples
Poor hash function on user-defined keysCombine fields with a prime multiplier
Worst-case O(n) on collisionsBalanced bucket or rehashing
Iteration order assumptionsUse an explicitly ordered map

4. Sorting Algorithms Comparison

AlgorithmBestAverageWorstSpaceStableIn-place
Quick sortO(n log n)O(n log n)O(n^2)O(log n)NoYes
Merge sortO(n log n)O(n log n)O(n log n)O(n)YesNo
Heap sortO(n log n)O(n log n)O(n log n)O(1)NoYes
Insertion sortO(n)O(n^2)O(n^2)O(1)YesYes
Tim sortO(n)O(n log n)O(n log n)O(n)YesNo
Counting sortO(n+k)O(n+k)O(n+k)O(k)YesNo
Radix sortO(d*(n+b))O(d*(n+b))O(d*(n+b))O(n+b)YesNo

Quick choices under pressure

SituationUse
Small n, partially sortedInsertion sort
Large n, generalTim sort (default in Python, Java)
Limited memory, worst case criticalHeap sort
Stable sort requiredMerge sort
Integers in known bounded rangeCounting or radix sort

5. Graph Algorithms Cheat Sheet

Traversal and shortest path

AlgorithmUseComplexityNotes
BFSShortest path in unweighted graphO(V+E)Queue based
DFSComponents, cycles, topological sortO(V+E)Stack or recursion
DijkstraShortest path, non-negative weightsO((V+E) log V)Min-heap
Bellman-FordShortest path with negative weightsO(V*E)Detects negative cycles
Floyd-WarshallAll-pairs shortest pathO(V^3)Dense graphs only
A*Shortest path with heuristicDepends on heuristicNeeds admissible heuristic

Spanning tree and connectivity

AlgorithmUseComplexity
PrimMST, dense graphsO(E log V)
KruskalMST, sparse graphsO(E log E)
Union-FindConnectivity queriesNearly O(1) amortized
TarjanStrongly connected componentsO(V+E)
KosarajuStrongly connected componentsO(V+E)

6. Concurrency Primitives

Common primitives

PrimitivePurposeTypical API
MutexExclusive access to a resourcelock, unlock
Read-write lockMany readers or one writerrlock, wlock
SemaphoreBounded number of concurrent usersacquire, release
Condition variableWait for a predicatewait, signal, broadcast
BarrierSynchronize N threads at a pointawait
ChannelMessage passing between workerssend, receive
AtomicLock-free single-variable opsload, store, CAS
Future or PromiseEventual valueawait, then

Concurrency bugs map

BugCauseDetection
Race conditionUnsynchronized shared stateStress tests, TSan
DeadlockCycle of locksLock order graph
LivelockThreads yield to each other indefinitelyBackoff with randomization
StarvationUnfair schedulingUse fair locks, queues
Priority inversionLow-priority holds lock high-priority needsPriority inheritance
Double-checked locking errorsUnsafe publicationUse language-appropriate patterns

Memory ordering basics

ModelGuarantees
Sequential consistencyStrict, global order
Acquire-releaseOrders synchronization between threads
RelaxedOnly atomicity, no ordering
Happens-beforePartial order via release-acquire pairs

7. HTTP Status Code Map

Classes

RangeMeaning
1xxInformational
2xxSuccess
3xxRedirection
4xxClient error
5xxServer error

Codes you should know cold

CodeNameWhen
200OKSuccess
201CreatedNew resource created
202AcceptedQueued for async processing
204No ContentSuccess with empty body
301Moved PermanentlyLong-term redirect
302FoundTemporary redirect
304Not ModifiedCached resource valid
400Bad RequestClient-side validation failure
401UnauthorizedMissing or invalid auth
403ForbiddenAuth valid but no permission
404Not FoundResource does not exist
409ConflictVersion conflict or duplicate
422Unprocessable EntitySemantic validation failure
429Too Many RequestsRate limit exceeded
500Internal Server ErrorGeneric server failure
502Bad GatewayUpstream failure
503Service UnavailableOverloaded or down
504Gateway TimeoutUpstream did not respond

Common HTTP method behaviors

MethodIdempotentSafeCacheable
GETYesYesYes
HEADYesYesYes
POSTNoNoRarely
PUTYesNoNo
PATCHNoNoNo
DELETEYesNoNo
OPTIONSYesYesNo

8. SQL Versus NoSQL Choices

When to pick which

NeedPickReason
Strong transactions, joinsRelationalACID, referential integrity
Flexible schema, write volumeDocumentJSON-native, horizontal scale
Time-series telemetryTime-series DBOptimized compression, retention
Massive key-value lookupsKey-valueO(1) lookup, partitioned
Graph traversalsGraph DBNative relationship indexing
Full-text searchSearch engineInverted index, ranking
Analytics over TBColumnar warehouseScan compression, MPP

Consistency options you must explain

TermMeaning
Strong consistencyA read reflects the latest successful write
Eventual consistencyReads converge after some delay
Read-your-writesA client sees its own writes immediately
Monotonic readsA client never sees older data after newer
Causal consistencyOperations with cause-effect order are preserved

9. System Design Building Blocks

Core components to recognize

BlockPurposeTypical choice
Load balancerSpread trafficL7 reverse proxy
API gatewayAuth, routing, rate limitManaged gateway
Stateless servicesHorizontal scaleContainerized fleet
Relational databaseSource of truthManaged Postgres
CacheReduce read latencyIn-memory distributed cache
Message queueDecoupling, bufferingBroker with durable queues
Object storeBlobs and large filesCloud object storage
Search indexFull-text and filteringInverted index service
Stream processorReal-time aggregationStream platform
Batch processorNightly jobsDistributed batch engine
CDNStatic and cacheable contentEdge delivery network
MonitoringMetrics, logs, tracesObservability stack

Common design patterns

PatternUse
Read replicasScale reads
Sharding by user idScale writes and storage
CQRSSeparate read and write models
Event sourcingReplay and audit
SagaDistributed transactions
Leader-followerWrites to leader, reads from followers
Consistent hashingSharding that survives node changes
Write-through cacheCache always consistent with DB
Write-back cacheHigher write throughput, risk on crash
Rate limiterProtect services from abuse
Circuit breakerStop cascading failure
BulkheadIsolate failure domains

10. Capacity Estimation Numbers

Latencies you should know cold

OperationLatency
L1 cache~1 ns
Branch mispredict~5 ns
L2 cache~4 ns
Mutex lock/unlock~25 ns
Main memory~100 ns
Compress 1 KB~2,000 ns
Send 2 KB over 1 Gbps~20,000 ns
SSD random read~150,000 ns
Round trip same datacenter~500,000 ns
Read 1 MB sequentially from memory~250,000 ns
Read 1 MB sequentially from SSD~1 ms
Disk seek~10 ms
Cross-continent round trip~150 ms

Sizing shortcuts

FigureApproximation
Seconds in a day~10^5
Seconds in a month~2.5 x 10^6
Bytes in a TB10^12
Chars in a tweet~280
DAU:QPS rule of thumbDAU / 86400 x peak factor
Peak to average ratio2x to 10x
Read:write on social feed100:1
Write amplification on SSD2x to 10x

11. Common Pitfalls and Edge Cases

Coding pitfalls

CategoryClassic edge case
ArraysEmpty, single element, all duplicates
StringsEmpty string, unicode, whitespace
TreesEmpty tree, single node, skewed
GraphsDisconnected components, self-loops
RecursionMax recursion depth
Integer mathOverflow, negative zero, division by zero
Floating pointPrecision, NaN, infinity
ConcurrencyEmpty queue on consumer start
IOPartial reads, EOF in the middle of a record

Design pitfalls

CategoryClassic pitfall
CacheCold start, thundering herd
QueuePoison messages
DBHot partitions
AuthToken replay
Rate limitClock skew across nodes
RetryNo jitter, cascading load
RolloutNo canary, no rollback plan

12. FAQ

Q: Should I memorize all of these tables? Yes for big-O, HTTP status, concurrency primitives, and capacity numbers. The rest should be at the level where you can reproduce them on a whiteboard given five minutes.

Q: Do I need to know all sorting algorithms? You should know quick sort, merge sort, heap sort, and insertion sort cold. Counting and radix are bonus knowledge for interviews about ranges of integers.

Q: How do I practice retrieval? Cover the table and reproduce it. Explain each row out loud. Do it once a day for a week before the interview.

Q: What about new databases and tools? Learn the categories first: relational, document, key-value, columnar, graph, search, time-series. Specific product names are less important than mapping the shape of the need.

Q: Are cheat sheets allowed during remote interviews? Written notes are usually fine, but reading from them visibly is a negative signal. Treat the cheat sheet as prep, not as an aid during the round.

Q: What if I forget a big-O mid-interview? Derive it. Count operations out loud. Interviewers prefer a candidate who reasons from first principles over one who recites the wrong memorized answer. Narrating that derivation comes more easily once you have practiced thinking out loud in coding interviews.

13. Conclusion

A cheat sheet is only as useful as your ability to recite it under pressure. The goal is not to keep the reference nearby, it is to internalize the reference. The tables above represent the minimum vocabulary required to perform at a top engineering interview: big-O, data structure operations, concurrency primitives, HTTP, SQL and NoSQL choices, system design building blocks, and capacity numbers.

Copy them, cover them, reproduce them, and explain them. When you can do that without looking, your working memory is free for the parts of the interview that actually require thinking: decomposing the problem, making tradeoffs, and communicating clearly. That is the real value of a cheat sheet, and that is why every senior engineer keeps one quietly in their head.

Frequently asked questions

What should be on a software engineer interview cheat sheet?

The minimum: big-O complexity for common operations, data-structure tradeoffs (array, hash table, BST, heap, trie), sorting algorithms, graph algorithms (BFS, DFS, Dijkstra, Union-Find), concurrency primitives, HTTP status codes, SQL versus NoSQL choices, system design building blocks, and capacity-estimation numbers like cache, memory, SSD, and cross-continent latencies.

What latency numbers should I memorize for system design interviews?

Know these cold: L1 cache around 1 ns, main memory around 100 ns, SSD random read around 150 microseconds, round trip same datacenter around 500 microseconds, disk seek around 10 ms, and cross-continent round trip around 150 ms. These power back-of-the-envelope calculations on whether to cache, replicate, or shard. A mock system design interview with capacity estimation drills lets you practice that math before the real round.

Are cheat sheets allowed to look at during a remote tech interview?

Written notes are usually fine, but visibly reading from a cheat sheet during the round is a negative signal. Treat the cheat sheet as preparation, not as an in-round aid. The goal is to internalize the tables so you can recall them without breaking eye contact or pausing your narration.

What is the difference between SQL and NoSQL choices in interviews?

Pick relational for strong transactions and joins (ACID, referential integrity). Pick document for flexible schema and write volume (JSON-native, horizontal scale). Pick key-value for massive O(1) lookups, columnar for analytics over terabytes, time-series for telemetry, graph for relationship traversals, and search engines for full-text.

What concurrency primitives do tech interviewers expect me to know?

Mutex (exclusive lock), read-write lock (many readers or one writer), semaphore (bounded concurrency), condition variable (wait for a predicate), barrier (synchronize N threads), channel (message passing), atomic operations (lock-free CAS), and futures or promises. Also know the common bugs: race conditions, deadlock, livelock, starvation, and priority inversion.