Cheat Sheets
Quick reference guides for every topic. Perfect for last-minute revision before your interview.
DSA Patterns
Data structures & algorithms reference
Big O Cheat Sheet
Time and space complexity reference for all common operations.
DSAArray Patterns
Two pointers, sliding window, prefix sum, and more.
DSAString Patterns
Pattern matching, manipulation, and character-level algorithms.
DSAHash Map Patterns
Frequency counting, grouping, and lookup optimization.
DSAStack Patterns
Monotonic stack, expression evaluation, and next greater element.
DSATree Patterns
DFS, BFS, LCA, and tree construction techniques.
DSAGraph Patterns
BFS, DFS, topological sort, union find, shortest path.
DSADP Patterns
1D DP, 2D DP, knapsack, LIS, and state optimization.
Java Reference
Collections, OOP, memory, and modern features
Java Collections Cheat Sheet
ArrayList, HashMap, HashSet, PriorityQueue — when to use each.
JavaJava OOP Cheat Sheet
Classes, inheritance, polymorphism, interfaces, and SOLID principles.
JavaJava Memory & JVM
Stack vs heap, garbage collection, equals/hashCode contract.
JavaJava 8+ Features
Lambdas, streams, functional interfaces, and Optional.
SQL Reference
Joins, window functions, aggregation, and design
SQL JOINs Cheat Sheet
INNER, LEFT, RIGHT, FULL, CROSS, SELF joins explained.
SQLSQL Window Functions
ROW_NUMBER, RANK, DENSE_RANK, LAG, LEAD, PARTITION BY.
SQLSQL Aggregation
COUNT, SUM, AVG, GROUP BY, HAVING — complete reference.
SQLSQL Database Design
Normalization, schema design, and entity relationships.
Frontend Reference
HTML, CSS, JavaScript, React, and performance
CSS Layout Cheat Sheet
Flexbox, Grid, positioning, and responsive design patterns.
FrontendJavaScript Closures & Scope
Closures, hoisting, this, and execution context patterns.
FrontendReact Hooks Cheat Sheet
useState, useEffect, useRef, useMemo, useCallback reference.
FrontendTypeScript Types
Types, interfaces, generics, and utility types reference.
System Design Reference
Architecture, distributed systems, and design patterns
CAP Theorem Cheat Sheet
Consistency, Availability, Partition tolerance tradeoffs.
System DesignCaching Patterns
Cache-aside, read-through, write-through, and invalidation.
System DesignDesign Patterns
Factory, Strategy, Observer, Singleton, and more.
System DesignSystem Design Framework
Step-by-step approach for HLD interviews.
Backend Reference
HTTP, REST, Spring Boot, and authentication
HTTP Methods Cheat Sheet
GET, POST, PUT, PATCH, DELETE — when and how to use each.
BackendREST API Design
RESTful URL design, status codes, and best practices.
BackendSpring Boot Cheat Sheet
DI, annotations, controllers, services, and repositories.
BackendAuthentication Patterns
JWT, sessions, OAuth 2.0, and token refresh flows.
MERN Backend Reference
Node.js, Express, MongoDB, and caching
Node.js Streams Cheat Sheet
Readable, writable, transform streams — pipeline and backpressure.
MERNExpress Middleware Cheat Sheet
Built-in, third-party, and custom middleware patterns.
MERNMongoDB Aggregation Cheat Sheet
$match, $group, $lookup, $project pipeline stages.
MERNJWT Authentication Cheat Sheet
Access tokens, refresh tokens, cookie security, and rotation.
MERNRedis Caching Cheat Sheet
Cache-aside, invalidation, distributed locks, and TTL patterns.
MERNMongoose Cheat Sheet
Schemas, validation, population, hooks, and query optimization.
Interview Prep
Behavioral, leadership, and mock interview guides
Quick Reference: Time Complexities
| Data Structure | Access | Search | Insert | Delete |
|---|---|---|---|---|
| Array | O(1) | O(n) | O(n) | O(n) |
| Stack | O(n) | O(n) | O(1) | O(1) |
| Queue | O(n) | O(n) | O(1) | O(1) |
| Linked List | O(n) | O(n) | O(1) | O(1) |
| Hash Map | N/A | O(1) | O(1) | O(1) |
| BST (Balanced) | O(log n) | O(log n) | O(log n) | O(log n) |
| Heap | O(1) | O(n) | O(log n) | O(log n) |
| Trie | N/A | O(m) | O(m) | O(m) |
| Segment Tree | O(log n) | O(log n) | O(log n) | O(log n) |
* m = length of key, n = number of elements
Sorting Algorithms
| Algorithm | Best | Average | Worst | Space | Stable |
|---|---|---|---|---|---|
| Bubble Sort | O(n) | O(n²) | O(n²) | O(1) | Yes |
| Insertion Sort | O(n) | O(n²) | O(n²) | O(1) | Yes |
| Merge Sort | O(n log n) | O(n log n) | O(n log n) | O(n) | Yes |
| Quick Sort | O(n log n) | O(n log n) | O(n²) | O(log n) | No |
| Heap Sort | O(n log n) | O(n log n) | O(n log n) | O(1) | No |
| Tim Sort | O(n) | O(n log n) | O(n log n) | O(n) | Yes |
Algorithm Pattern Decision Tree
Is the data sorted?
Need fast lookups? → HashMap
Need to find pairs? → Two Pointers (sort first) or HashMap
Need subarray/substring? → Sliding Window
Need shortest path? → BFS (unweighted) or Dijkstra (weighted)
Need all permutations? → Backtracking
Need optimal value? → DP or Greedy
Need connected components? → Union-Find or DFS
DP vs Greedy?
Does local optimal always lead to global optimal? → Greedy
Are subproblems overlapping? → DP (Memoization or Tabulation)
Need to consider all possibilities? → Backtracking