Harsha's Placement Sprint

Apr 20 – May 15, 2026  ·  26 Days  ·  DSA · Aptitude · MERN · Interview · Career Toolkit
🌙☀️
26
Days
200+
DSA Problems
26
MERN Modules
220+
Interview Q&A
5+ hrs
Daily Study
DSA · 2 hr
Aptitude · 1 hr
MERN · 1 hr
Interview Q&A · 1 hr
Approach
Problems
Week 1 — Foundation · Apr 20–26
Lock in the fundamentals. Arrays → Strings → Hashing → Two Pointers → Linked Lists → Stacks/Queues → Recursion. MERN track starts with JavaScript mastery and ends with your first Express API. Interview block: you'll learn to answer like a candidate with experience, not theory.
01

Arrays & Time Complexity

Monday, Apr 20

DSAAptiMERNInterview
DSA · 2 hrs
Arrays + Big-O Fundamentals
  • Big-O hierarchy: O(1) → O(log n) → O(n) → O(n log n) → O(n²) → O(2ⁿ) → O(n!). Map each class to a code shape you can spot instantly.
  • Constraint → complexity target: n≤10³ → O(n²) ok · n≤10⁵ → O(n log n) · n≤10⁸ → O(log n). Read constraints BEFORE picking algorithm.
  • Prefix Sum: pre[i]=pre[i-1]+arr[i]. Range sum (l,r)=pre[r]-pre[l-1]. Turns O(n) query → O(1).
  • Kadane's: local=max(num, local+num), track global. Max subarray sum in O(n) one pass.
  • Sliding Window (fixed): build first window, then slide — add right, remove left. O(n).
  • Sliding Window (variable): expand right always; shrink left while constraint violated; record answer on valid windows.
  • Two Pointers (sorted): l=0, r=n-1. sum<target→l++, sum>target→r--. O(n).
  • Dutch National Flag: low/mid/high pointers — 3-way partition in one pass.
Space matters: in-place = O(1) extra. Creating a new array of size n = O(n) space. Interviewers ask about both.
Approach · Brute Force → Optimize
  • Step 1: state brute force aloud — "nested loops, O(n²)".
  • Step 2: trade space for time — HashMap for O(1) lookup, prefix array for O(1) query.
  • Step 3: find loop redundancy — two loops on same data → two-pointer or sliding window.
  • Step 4: verify on small example. Then state final complexity before coding.
Aptitude · 1 hr · Numbers, HCF, LCM
  • HCF (GCD): Euclidean — gcd(a,b)=gcd(b,a%b) till remainder 0.
  • LCM = a·b / HCF. For 3 numbers: LCM(a,b,c) = LCM(LCM(a,b),c).
  • Divisibility: 3 (digit sum÷3), 4 (last 2÷4), 8 (last 3÷8), 9 (digit sum÷9), 11 (alt-sum÷11).
  • Unit digit cycles of 4: 2→{2,4,8,6}, 3→{3,9,7,1}, 7→{7,9,3,1}, 8→{8,4,2,6}. Use power mod 4.
  • Remainder theorem: (a·b) mod n = ((a mod n)·(b mod n)) mod n.
  • Practice: IndiaBix → Numbers (25 Qs). Log every wrong one + method.
MERN · 1 hr · JavaScript Foundations & ES6
  • Closures: inner function retains access to outer scope even after outer returns. Powers hooks, module pattern.
  • let vs const vs var: var is function-scoped, hoisted as undefined. let/const block-scoped, TDZ till declared.
  • Arrow functions: no own this, no arguments, cannot be new'd. Perfect for callbacks.
  • Destructuring + spread/rest: const {a,b} = obj, [...arr], {...obj}. Used in every React file.
  • Promises & async/await: async always returns a Promise. await only inside async. try/catch for errors.
  • Task: build a 30-line script with map/filter/reduce, one closure counter, one async fetch.
Interview Q&A · 1 hr · OOP Fundamentals
Tech HR + Senior Dev lens. Every answer below has: core answer · differentiator (what makes you sound senior) · example · common mistake to avoid.
What are the 4 pillars of OOP? Explain with an example.
Encapsulation (bundle data + methods, hide internals), Abstraction (expose what, hide how), Inheritance (child reuses parent), Polymorphism (same name, different behavior).
Differentiator: tie each pillar to a real-world use — encapsulation = a class with private fields + getters; abstraction = an interface like List used without knowing it's ArrayList.
Example: Shape (abstract) → Circle, Square override area() — polymorphism + inheritance + abstraction in one design.
Mistake: confusing abstraction and encapsulation. Abstraction is about design intent; encapsulation is about code packaging.
Difference between abstract class and interface?
Abstract class can have implemented methods, fields, constructors; single-inherited. Interface is a pure contract (Java 8+ allows default methods); multi-implemented.
Differentiator: "Use abstract class for 'is-a' with shared code; use interface for 'can-do' capabilities. A Bird is an Animal (abstract), but it can Fly (interface)."
Example: List interface implemented by AbstractList (abstract class) → ArrayList.
Mistake: saying "interface can't have code" — outdated since Java 8 default/static methods.
Method overloading vs overriding?
Overloading = same class, same name, different parameters (compile-time). Overriding = subclass redefines parent's method with same signature (runtime).
Differentiator: call it static vs dynamic polymorphism — the JVM resolves overloading at compile time via signature matching, overriding via the vtable at runtime.
Example: add(int,int) + add(double,double) = overload. Animal.sound()Dog.sound() = override.
Mistake: trying to "overload" by changing only return type — won't compile.
What is the diamond problem? How does Java solve it?
Multiple inheritance ambiguity — B and C both inherit from A, D inherits from B and C; which A does D get? Java forbids multi-inheritance of classes; allows multi-interface with explicit resolution using InterfaceName.super.method().
Differentiator: mention C++ solves this with virtual inheritance; Python uses C3 linearization (MRO).
Example: two interfaces both declare default void hello() — implementing class must override and pick.
Mistake: saying "Java doesn't allow multiple inheritance" — it does, for interfaces.
What is SOLID? Give one example of each.
Single-responsibility · Open/closed · Liskov substitution · Interface segregation · Dependency inversion.
Differentiator: cite one code smell per principle. SRP: a God class. OCP: a switch on type. LSP: a subclass throwing on a parent method. ISP: a fat interface. DIP: code new'ing concrete DB class inside a service.
Example (DIP): service depends on UserRepository interface, not MongoUserRepo class — swap DB without touching service.
Mistake: reciting names only. Interviewers want smell → principle → fix.
Composition over Inheritance — what does it mean?
Prefer "has-a" (object holds another) over "is-a" (class extends class). Inheritance creates tight coupling and a rigid hierarchy; composition lets you swap behaviors at runtime.
Differentiator: reference the Strategy pattern — inject the algorithm instead of subclassing.
Example: instead of FlyingDuck extends Duck, give Duck a FlyBehavior field.
Mistake: saying "never use inheritance" — use it for genuine is-a with no behavior variation.
Static vs instance methods — when to use each?
Static = belongs to class, no this, can't access instance state. Instance = needs an object, can access fields.
Differentiator: "Static is for utility/pure logic — Math.max, Integer.parseInt. Instance is for anything that mutates or reads object state."
Example: UserService.hashPassword(str) → static. user.updateEmail(x) → instance.
Mistake: overusing static → untestable code (can't mock), hidden global state.
What is the Singleton pattern? How do you make it thread-safe?
One instance per JVM. Thread-safe options: eager init (field initialized at class load), double-checked locking with volatile, or enum singleton (Joshua Bloch's preferred way).
Differentiator: mention enum is serialization-safe and reflection-safe out of the box.
Example: public enum Config { INSTANCE; }
Mistake: plain if(instance==null) without synchronization — race condition creates two instances.
Explain this keyword in Java/JS — any difference?
Java: this = current instance, bound at compile time. JS: this = determined by call site (method call, fn call, new, arrow). Arrow fns inherit this from enclosing scope.
Differentiator: in JS, obj.method() → this=obj; const f=obj.method; f() → this=undefined (strict). This bites everyone in React class components.
Example: setTimeout(()=>this.tick(),1000) works because arrow captures outer this.
Mistake: assuming JS this follows the lexical rules of Java.
02

Strings & Sliding Window

Tuesday, Apr 21

DSAAptiMERNInterview
DSA · 2 hrs · Strings + Pattern Matching
  • Frequency map: array[26] for lowercase letters — faster than HashMap. Anagram = same frequency.
  • Sliding window on strings: expand right (add char), shrink left (remove char). Track count of satisfied constraints, not the whole map.
  • Palindrome (two-pointer): l=0, r=n-1, move in. O(n) O(1).
  • Palindrome (expand from center): for each i, expand odd (i,i) and even (i,i+1). O(n²) but finds longest.
  • Reverse words: reverse whole string, then reverse each word. O(n) O(1).
  • KMP (concept): build LPS/failure array — skip re-checking already-matched prefix. O(n+m).
  • Char math: c-'a' = 0..25 index. ASCII 'A'=65, 'a'=97, '0'=48.
  • Never concat in loop — use StringBuilder/array+join. Loop concat = O(n²).
Aptitude · 1 hr · Percentages + Profit & Loss
  • % change = (new−old)/old × 100. Successive %: multiply (1+a/100)(1+b/100).
  • x% of y = y% of x. Pick whichever is easier.
  • Profit/Loss % on CP unless stated. SP = CP(1+P%/100).
  • Two successive discounts d1, d2: effective = 1 − (1−d1/100)(1−d2/100).
  • SP of x = CP of y: Profit% = ((y−x)/x)×100.
MERN · 1 hr · Node.js & NPM
  • Node event loop: single-threaded JS + libuv thread pool. Phases: timers → pending → poll → check → close.
  • CommonJS vs ES Modules: require/module.exports vs import/export. Modern Node supports both — pick ESM for new projects.
  • package.json essentials: scripts, dependencies vs devDependencies, semver (^, ~).
  • Async APIs: fs.readFile (callback), fs.promises.readFile (Promise). Avoid sync APIs in servers.
  • Task: init a Node project, write a file reader that returns a Promise, run with node --watch.
Interview Q&A · 1 hr · Operating Systems
Process vs Thread — core difference?
Process = independent program with own memory space. Thread = lightweight unit inside a process, shares memory with siblings.
Differentiator: "Context-switching between threads is cheaper (same address space, no TLB flush). Inter-thread communication is via shared memory, IPC between processes needs pipes/sockets/shared mem."
Example: Chrome uses a process per tab for isolation; within a tab, threads for rendering, network, JS.
Mistake: saying "threads are faster" — they're cheaper to create/switch, not always faster to compute.
What is a deadlock? Name its 4 conditions.
Two+ threads blocked forever, each waiting on a resource held by the other. Coffman conditions: mutual exclusion, hold-and-wait, no preemption, circular wait.
Differentiator: "Break any one condition → no deadlock. Practical fix: always acquire locks in the same global order (prevents circular wait)."
Example: Thread A locks account1 then account2; Thread B locks account2 then account1. Classic transfer deadlock.
Mistake: confusing deadlock with livelock (both keep moving but make no progress) or starvation.
Paging vs Segmentation?
Paging: fixed-size blocks (pages), no external fragmentation. Segmentation: variable-size, logical (code, stack, heap). Modern OS uses paged segments.
Differentiator: mention TLB (translation lookaside buffer) caches page table entries; TLB miss is a key perf cost.
Example: 4KB page size is standard on x86.
Mistake: saying paging has "internal fragmentation" without explaining — last page of a process may be partially used.
What is virtual memory? Why do we need it?
Abstraction giving each process its own large contiguous address space, mapped to physical RAM + disk. Enables isolation, overcommit, and lazy loading.
Differentiator: "Page faults happen when an accessed page isn't in RAM — OS loads from disk (swap). Excessive faults = thrashing."
Example: malloc'ing 2GB on a 1GB machine works — only actually-touched pages consume RAM.
Mistake: confusing virtual memory (address translation) with swap space (the disk area).
CPU scheduling — compare FCFS, SJF, Round Robin.
FCFS: simple, convoy effect. SJF: optimal avg wait but needs burst prediction, can starve. Round Robin: time-quantum based, fair, context-switch overhead.
Differentiator: mention MLFQ (multi-level feedback queue) — what real OSes use. Short bursts stay in high-priority queue.
Example: quantum too small → all overhead. Too big → degenerates to FCFS.
Mistake: forgetting preemptive vs non-preemptive variants of SJF.
Mutex vs Semaphore?
Mutex = binary lock, one owner, releases by same owner. Semaphore = counter allowing N concurrent accesses; no ownership.
Differentiator: "Use mutex for mutual exclusion. Use counting semaphore for resource pools (e.g., DB connection pool of 10)."
Example: producer-consumer with two semaphores — empty slots + filled slots.
Mistake: using a binary semaphore for critical section — it lacks owner check, so any thread can release.
Page replacement algorithms — FIFO, LRU, Optimal?
FIFO: oldest page out (Belady's anomaly). LRU: least-recently-used — best practical. Optimal: future-looking, theoretical benchmark only.
Differentiator: "LRU is typically approximated via clock algorithm or reference bits — exact LRU needs O(1) ops per access which is costly."
Example: Belady's anomaly — increasing frames can increase page faults in FIFO.
Mistake: claiming LRU is always best — it performs poorly on scans (working set too large).
What is a system call? Give one example.
User-mode program's way to request kernel services. Trap switches to kernel mode, OS executes, returns.
Differentiator: name the cost — mode switch ~100s of cycles. That's why buffered I/O exists (minimize syscalls).
Example: read(), write(), fork(), mmap().
Mistake: confusing syscall with library function — printf is lib; it calls write syscall.
How does fork() work?
Creates a near-identical child process. Returns child PID in parent, 0 in child, -1 on error. Uses copy-on-write for memory efficiency.
Differentiator: "COW means parent's pages aren't copied until either side writes — fork of a 4GB process is nearly free."
Example: classic shell uses fork+exec: fork a child, child exec's the command.
Mistake: assuming fork literally duplicates all memory eagerly.
03

Hashing & HashMaps

Wednesday, Apr 22

DSAAptiMERNInterview
DSA · 2 hrs · HashMap / HashSet Mastery
  • HashMap internals: array of buckets → linked list → (Java 8+) tree when bucket > 8. Load factor 0.75 triggers resize.
  • Operations: put/get/remove all O(1) average, O(n) worst (bad hash → all collide).
  • Frequency counting → one pass, then scan map. Anagram groups, top-k, majority.
  • Prefix sum + HashMap → subarrays with sum = k in O(n). Store count of each prefix sum.
  • HashSet for "seen before" → duplicate detection, cycle in O(n).
  • Custom hash/equals: if you override equals, override hashCode. Violating this → keys lost in map.
  • TreeMap = O(log n) sorted. Use when you need floor/ceiling/range queries.
Aptitude · 1 hr · Ratios, Proportions, Mixtures
  • Ratio a:b → A's share = a/(a+b) of total. Always simplify first.
  • Cross-multiply: a/b = c/d ⇒ ad = bc.
  • Alligation: (costly−mean) : (mean−cheap) = cheap:costly ratio in mix. Cross-diagram.
  • Mixture removal: after k removals of R from V with initial fraction X: final = X(1−R/V)^k.
  • Compound ratio: (a:b) · (c:d) = ac:bd.
MERN · 1 hr · Express.js Fundamentals
  • app.use / app.get / app.post — route handlers. Handler sig: (req, res, next).
  • Middleware chain: next() passes control. Error middleware has 4 args (err, req, res, next).
  • Body parsing: app.use(express.json()). Without it, req.body is undefined.
  • Router modules: const router = express.Router() — split routes into files.
  • Status codes: 200 OK, 201 Created, 400 Bad Req, 401 Unauth, 403 Forbidden, 404 Not Found, 500 Server Err.
  • Task: build a mini Express server with /health, /users (GET + POST), and a logger middleware.
Interview Q&A · 1 hr · DBMS / SQL
ACID properties — explain each.
Atomicity (all-or-nothing), Consistency (DB moves from one valid state to another), Isolation (concurrent txns don't interfere), Durability (committed data survives crash).
Differentiator: link each to a mechanism — atomicity via undo log, durability via WAL (write-ahead log), isolation via MVCC or locks.
Example: bank transfer — debit + credit as one atomic unit.
Mistake: treating "consistency" as CAP's C — they're different concepts.
Normalization — 1NF, 2NF, 3NF, BCNF?
1NF: atomic values. 2NF: 1NF + no partial dependency on composite key. 3NF: 2NF + no transitive dependency. BCNF: every determinant is a key.
Differentiator: "We normalize to kill update/insert/delete anomalies. We denormalize for read-heavy analytics — trade redundancy for speed."
Example: student(id, name, dept_id, dept_name) → dept_name depends on dept_id, not id → violates 3NF. Split.
Mistake: over-normalizing to 5NF in OLTP — too many joins.
SQL vs NoSQL — when do you pick which?
SQL (relational): strict schema, joins, ACID, vertical scale. NoSQL (document/KV/wide-col): flexible schema, horizontal scale, eventual consistency common.
Differentiator: "Pick SQL when relationships + transactions matter (banking, orders). Pick NoSQL when schema flexibility, write throughput, or geo-distribution dominates (logs, profiles, feeds)."
Example: Mongo for user profiles with varying fields; Postgres for an orders + payments system.
Mistake: "NoSQL is faster" — not universal. Depends on access pattern.
Clustered vs Non-clustered index?
Clustered: table rows physically ordered by the index key; one per table (usually PK). Non-clustered: separate structure with pointers to rows; multiple allowed.
Differentiator: "Range scans on clustered index are sequential I/O → fast. Non-clustered needs a second hop via the pointer (bookmark lookup)."
Example: InnoDB's PK is clustered — rows stored in B+ tree of PK.
Mistake: thinking MySQL's PRIMARY KEY and a regular INDEX are the same.
INNER vs LEFT vs RIGHT vs FULL OUTER JOIN?
INNER: only matches. LEFT: all from left + matches from right (null if none). RIGHT: mirror. FULL: everything, nulls where no match.
Differentiator: mention anti-join via LEFT JOIN ... WHERE right.id IS NULL — finds rows with no match. Common trick.
Example: "all users who never placed an order" → LEFT JOIN orders WHERE orders.id IS NULL.
Mistake: putting the right-table filter in WHERE instead of ON — silently converts LEFT JOIN to INNER.
What is a transaction isolation level?
Controls what concurrent txns can see. Read Uncommitted < Read Committed < Repeatable Read < Serializable. Higher = less anomalies, more locking.
Differentiator: name the anomalies each prevents — dirty read, non-repeatable read, phantom read.
Example: Postgres default is Read Committed; MySQL InnoDB is Repeatable Read.
Mistake: always cranking to Serializable — performance cliff from locks/retries.
Difference between WHERE and HAVING?
WHERE filters rows before aggregation. HAVING filters groups after aggregation.
Differentiator: "WHERE can't reference aggregate functions because they don't exist yet — that's HAVING's job."
Example: SELECT dept, COUNT(*) FROM emp WHERE active=1 GROUP BY dept HAVING COUNT(*) > 5.
Mistake: using HAVING without GROUP BY when WHERE would do.
What is a deadlock in DB? How do you resolve it?
Two txns waiting on locks each holds. DB detects via wait-for graph and kills one (victim).
Differentiator: "Prevent by always accessing tables in the same order, keeping txns short, using appropriate isolation, and retrying on 'deadlock victim' errors in app code."
Example: txn1 locks A then B; txn2 locks B then A.
Mistake: ignoring deadlock retries in app code — must catch and retry.
Index — why not index every column?
Indexes speed reads but slow writes (every insert/update must update index) and cost disk space. Also may be unused if selectivity is low.
Differentiator: mention composite indexes and left-prefix rule — (a,b,c) helps queries on a, a,b, a,b,c but not on b alone.
Example: indexing a boolean column with 50/50 split is useless — optimizer ignores it.
Mistake: adding indexes without checking query plan.
04

Two Pointers & Sorting

Thursday, Apr 23

DSAAptiMERNInterview
DSA · 2 hrs · Two Pointers + Sort Patterns
  • Two pointers (same dir): slow/fast for in-place mutation (remove dupes, move zeros).
  • Two pointers (opposite): sorted array + target sum → O(n).
  • 3Sum pattern: sort → fix i → two-pointer on rest. Skip duplicates. O(n²).
  • Merge intervals: sort by start → iterate, merge overlap (new.start ≤ prev.end).
  • Sort + scan = classic upgrade from O(n²) to O(n log n).
  • Quicksort: partition around pivot, recurse. Avg O(n log n), worst O(n²) with bad pivot.
  • Mergesort: divide + merge. Stable, O(n log n) guaranteed, O(n) extra space.
  • Counting / Radix sort: O(n+k) for small key range. Not comparison-based.
Aptitude · 1 hr · Time, Speed & Distance
  • D = S·T. km/h ↔ m/s: multiply by 5/18 (to m/s) or 18/5 (to km/h).
  • Avg speed over equal distances: 2·s1·s2/(s1+s2). Not (s1+s2)/2.
  • Relative speed: same direction → subtract; opposite → add.
  • Train + platform: total distance = train length + platform length.
  • Boats + stream: downstream = b+s; upstream = b−s. b = (d+u)/2, s = (d−u)/2.
MERN · 1 hr · MongoDB Fundamentals
  • Document model: BSON docs in collections; no enforced schema (but use validators/Mongoose in prod).
  • CRUD: insertOne, find, updateOne, deleteOne. Filters use {field: value} or operators {age:{$gt:18}}.
  • Indexes: default on _id. Add single/compound indexes for query fields. Check with .explain().
  • Aggregation pipeline: $match → $group → $sort → $project. Like SQL GROUP BY + JOIN.
  • ObjectId: 12-byte ID — timestamp + machine + pid + counter. Roughly sortable by time.
  • Task: install Mongo locally (or Atlas), insert 5 users, query by age range, add an index.
Interview Q&A · 1 hr · Computer Networks
OSI vs TCP/IP model — what's the difference?
OSI: 7 layers (Phys, Data, Net, Transport, Session, Presentation, App) — theoretical. TCP/IP: 4 practical layers (Link, Internet, Transport, App).
Differentiator: "Nobody actually implements OSI as-is. TCP/IP is what runs the internet. OSI is a teaching scaffold."
Example: TLS sits between TCP (transport) and HTTP (app) — OSI would call it presentation.
Mistake: memorizing layers without knowing which protocols live where.
TCP vs UDP?
TCP: connection-oriented, reliable, ordered, flow+congestion control, slow-start, retries. UDP: connectionless, best-effort, low latency.
Differentiator: "Use TCP when correctness matters (HTTP, SMTP, DB). Use UDP when latency matters and you can tolerate loss (DNS, video, gaming, QUIC)."
Example: HTTP/3 is built on QUIC over UDP — gets congestion control at user space, avoids head-of-line blocking.
Mistake: "UDP is unreliable" stated as a flaw — it's a deliberate feature.
Walk me through what happens when I type google.com in the browser.
1) Browser cache/DNS resolve. 2) OS DNS cache → recursive resolver → root → TLD → authoritative. 3) TCP 3-way handshake. 4) TLS handshake. 5) HTTP GET. 6) Server responds, browser parses HTML → fetches JS/CSS → paints.
Differentiator: mention HTTP/2 multiplexing, TLS 1.3's 1-RTT, and connection reuse (keep-alive) — shows depth.
Example: Chrome DevTools waterfall shows DNS, Connect, SSL, TTFB, Download segments.
Mistake: stopping at "DNS resolves" — explain the 4-level hierarchy.
What is the 3-way handshake?
SYN (client → server, seq=x) → SYN-ACK (server → client, seq=y, ack=x+1) → ACK (client → server, ack=y+1). Connection established.
Differentiator: "4-way for teardown (FIN/ACK in both directions, separately). TCP is full-duplex — each side closes independently."
Example: SYN flood DDoS abuses step 1 — half-open connections exhaust server.
Mistake: forgetting sequence numbers — they're the whole point (reliability).
HTTP vs HTTPS?
HTTPS = HTTP over TLS. TLS provides encryption, integrity, and server authentication via certificates.
Differentiator: mention TLS handshake basics — client hello → server cert (chain to CA) → key exchange (ECDHE) → symmetric session key.
Example: Let's Encrypt issues free certs via ACME protocol — now default on most sites.
Mistake: saying HTTPS "encrypts the URL" — the path + query are encrypted, but the hostname leaks via SNI (until ECH).
HTTP methods — what's idempotent?
GET, PUT, DELETE, HEAD, OPTIONS — idempotent (same effect if called N times). POST, PATCH — not idempotent.
Differentiator: "Idempotency is about server state, not response. GET should also be safe (no state change)."
Example: DELETE /user/5 — first call deletes, rest return 404, but state is unchanged → idempotent.
Mistake: using POST where PUT is correct — breaks retry semantics in clients/proxies.
DNS — how does recursive resolution work?
Client asks resolver → resolver queries root (.) for TLD server → queries TLD (.com) for authoritative → queries authoritative for the record. Resolver caches with TTL.
Differentiator: "Authoritative servers answer iteratively; recursive resolvers do the walking. CDN use low TTLs for fast cutovers; corporate records use high TTLs to reduce load."
Example: DNS records — A (IPv4), AAAA (IPv6), CNAME (alias), MX (mail), TXT (metadata).
Mistake: calling NS and A records interchangeable.
What is CORS and why does it exist?
Cross-Origin Resource Sharing — browser same-origin policy blocks JS from reading responses from other origins. Server opts-in with Access-Control-Allow-Origin.
Differentiator: "Preflight: for non-simple requests, browser sends OPTIONS first to check allowed methods/headers. This is why app.use(cors()) in Express matters."
Example: React on :3000 calling Express on :5000 → CORS preflight if custom headers.
Mistake: thinking CORS protects the server. It protects the user's browser. Server still needs auth.
REST vs WebSockets — when each?
REST: stateless request/response over HTTP. WebSockets: persistent, full-duplex after HTTP upgrade.
Differentiator: "Use REST for CRUD. Use WebSockets for low-latency real-time (chat, live dashboards, collab editing). Use SSE for one-way server push."
Example: Socket.io adds fallback + reconnection on top of WS.
Mistake: using polling when WS would fit — wasteful and slow.
05

Linked Lists

Friday, Apr 24

DSAAptiMERNInterview
DSA · 2 hrs · Linked List Operations
  • Reverse (iterative): prev=null, curr=head; save next → flip → advance. O(n) O(1).
  • Floyd's cycle: slow (1) + fast (2) — meet ⇒ cycle. Reset slow to head, move both by 1 → cycle start.
  • Dummy node pattern — eliminates head-edge-cases. Always return dummy.next.
  • Find middle: slow/fast. Fast at end → slow at middle.
  • Merge two sorted lists: dummy + compare heads + advance smaller.
  • Remove Nth from end: two pointers with N gap, one pass.
  • LRU Cache: HashMap + Doubly Linked List → O(1) get/put. Know this cold.
  • Never lose next — save before reassign. #1 LL bug.
Aptitude · 1 hr · Time & Work
  • Rate = 1/days. A does in 10d → rate 1/10 per day.
  • A+B together: combined rate = 1/A + 1/B → total time = AB/(A+B).
  • Work as LCM: if A=10d, B=15d → total work = LCM(10,15)=30 units. A does 3/day, B does 2/day → together 5/day → 6d.
  • Pipes: inflow positive, outflow negative. Net rate solves fill/drain time.
  • Efficiency ratio inverse of time. A is 2× faster than B ⇒ A takes half the time.
MERN · 1 hr · React Intro — JSX & Components
  • JSX compiles to React.createElement(). One parent element per return (Fragment or <>).
  • Functional components — plain functions returning JSX. Props are the single argument.
  • Props are read-only. Never mutate. To change, lift state up or use a callback.
  • Lists & keys: always provide a stable key (not array index if list reorders).
  • Event handlers: camelCase (onClick), pass function reference, not call result.
  • Task: build a TodoList component — accept items prop, render with keys, show empty state.
Interview Q&A · 1 hr · DSA Concept Questions
Array vs Linked List — when to pick each?
Array: O(1) random access, cache-friendly, fixed/dynamic size with amortized O(1) append. LL: O(1) insert/delete at known node, no contiguous memory needed.
Differentiator: "In practice, arrays win 95% of the time because of CPU cache. LL shines when you need O(1) splice at a known pointer — e.g., LRU cache."
Example: Java's ArrayList almost always beats LinkedList even on middle inserts under a few thousand elements.
Mistake: quoting textbook "LL is faster for insert" without the cache-locality caveat.
Why is HashMap O(1) average but O(n) worst?
Avg: uniform hash distributes keys across buckets → O(1). Worst: all keys collide → single bucket → linear search. Java 8+ mitigates with red-black tree when bucket > 8 → O(log n) worst.
Differentiator: mention hash DoS attacks — attacker crafts colliding keys. Randomized hash seeds (like Java) prevent this.
Example: bad custom hashCode returning 0 → every put collides → O(n).
Mistake: saying "O(1) always" without the hash-quality caveat.
Stack vs Heap memory?
Stack: per-thread, LIFO, holds call frames + local primitives. Fast, limited size. Heap: shared, holds objects, GC-managed in Java, malloc/free in C.
Differentiator: "Stack overflow = recursion too deep. OOM = heap exhausted. Different bugs, different fixes."
Example: int[] a = new int[5] — reference on stack, array on heap.
Mistake: confusing data-structure stack/heap with memory stack/heap.
Recursion vs Iteration — tradeoffs?
Recursion: cleaner for tree/divide-and-conquer, O(depth) call stack. Iteration: lower overhead, no stack overflow risk.
Differentiator: "Tail recursion can be optimized to iteration — but JVM doesn't do TCO, so deep recursion in Java still blows the stack."
Example: DFS is naturally recursive; can convert to iterative with explicit stack.
Mistake: writing recursive Fibonacci without memoization — exponential.
What is amortized complexity?
Average cost per op over a sequence, even if some ops are expensive. E.g., dynamic array append = amortized O(1) because resizing (O(n)) happens rarely.
Differentiator: "Doubling strategy: after n inserts, total work = n + n/2 + n/4 + ... = 2n → O(1) amortized. Without doubling (adding a fixed chunk), you'd be O(n²) total."
Example: monotonic stack — each element pushed and popped at most once → O(n) amortized, not O(n²).
Mistake: conflating amortized with average-case.
BFS vs DFS — when to pick?
BFS (queue): shortest path unweighted, level-order, closer neighbors first. DFS (stack/recursion): path existence, cycle detect, topological, connected components.
Differentiator: "BFS memory scales with width (can explode on wide graphs). DFS memory scales with depth (can stack-overflow on skinny graphs)."
Example: word ladder → BFS. N-Queens → DFS backtracking.
Mistake: using DFS for shortest path on unweighted — wrong tool.
When is sorting O(n) possible?
Comparison-based sort is Ω(n log n) — proven lower bound. Non-comparison sorts (counting, radix, bucket) achieve O(n+k) but require bounded key range / fixed digit size.
Differentiator: "Counting sort works for integers in [0, k] where k is O(n). Radix sort extends it to larger ranges via digit buckets."
Example: sort scores 0–100 for a million students → counting sort, O(n).
Mistake: claiming quicksort is always O(n log n) — worst-case O(n²) without randomized pivot.
Explain greedy vs DP in one line each.
Greedy: make locally optimal choice, never reconsider. DP: try all sub-choices, memoize, pick best.
Differentiator: "Greedy works when local optimum = global optimum (proof required: exchange argument or matroid). DP works when optimal substructure + overlapping subproblems."
Example: activity-selection (sort by end) = greedy. Knapsack 0/1 = DP (greedy fails).
Mistake: using greedy without proof — works on examples but wrong in general.
How do you debug when your algorithm "works on samples but fails"?
Generate small random inputs, compare against brute force. Look for edge cases: empty input, single element, duplicates, max/min boundary, integer overflow, negatives.
Differentiator: "Stress-testing is how competitive programmers catch WA. Write a brute force, a generator, and a checker script."
Example: binary search bug — (l+r)/2 overflows for huge l+r. Use l+(r-l)/2.
Mistake: adding print statements randomly instead of isolating.
06

Stacks & Queues

Saturday, Apr 25

DSAAptiMERNInterview
DSA · 2 hrs · Stack, Queue, Monotonic
  • Stack triggers: "nearest/next greater", "balanced/matching", "undo/history".
  • Queue triggers: "level-order", "shortest in unweighted graph".
  • Monotonic stack: keep elements increasing/decreasing; pop violators. Amortized O(n).
  • Monotonic deque: sliding window max/min in O(n).
  • Expression eval: infix → postfix (Shunting Yard); evaluate postfix with stack.
  • Two stacks → queue: push to s1; pop: drain s1 to s2, pop s2.
  • Min stack: parallel stack tracks running min → O(1) getMin.
Aptitude · 1 hr · Simple & Compound Interest
  • SI = PNR/100. Amount = P + SI.
  • CI = P(1+R/100)ⁿ − P. Amount = P(1+R/100)ⁿ.
  • CI − SI for 2 years = P(R/100)².
  • Half-yearly CI: R → R/2, n → 2n. Quarterly: R → R/4, n → 4n.
  • Rule of 72: money doubles at R% in ~72/R years.
MERN · 1 hr · React Hooks (useState, useEffect)
  • useState: returns [value, setter]. Setter replaces (doesn't merge). Use functional update when new depends on old.
  • useEffect: runs after render. Dependency array: [] = once, [x] = when x changes, none = every render.
  • Cleanup fn: returned function runs before next effect + on unmount. Use it to cancel fetches, clear timers.
  • Don't mutate state: always new object/array — setUsers([...users, newUser]). React compares by reference.
  • Common bug: infinite loop when effect setState has no/wrong deps.
  • Task: build a counter with useState + a fetch-on-mount with useEffect and cleanup.
Interview Q&A · 1 hr · Behavioral + HR Round
Tell me about yourself.
3-part structure: (1) where you are now (student at X, interests Y), (2) one or two proud projects/achievements with tech & impact, (3) why this role matters to you.
Differentiator: end with a hook — "which is why a backend-heavy role like this excites me." Recruiters remember the last line.
Example: "I'm a final-year CSE student. Built SyncSpace — a real-time collab editor with Socket.io — handled 50 concurrent users. Now want to work on systems that scale 1000×."
Mistake: reading off your resume chronologically. They have it in their hand.
Why should we hire you?
Map two skills to the JD. "You need X — I've done X in project Y. You need Z — I've learned Z deeply and can ship from day 1."
Differentiator: show you researched the role. Reference one team/product specifically — proves you prepared.
Example: "Your team works on payments — I built a Razorpay-integrated checkout in my e-commerce project, handled webhook idempotency."
Mistake: generic "I'm hardworking and a fast learner" — says nothing.
What's your biggest weakness?
One real weakness + what you're actively doing about it. Avoid humble-brags ("I work too hard").
Differentiator: show self-awareness + growth. "I used to over-engineer — now I timebox design and start with the simplest working version."
Example: "Public speaking — joined college debate, voluntarily presented at hackathon demo day."
Mistake: "I'm a perfectionist" — interviewers roll their eyes.
Describe a conflict with a teammate and how you handled it.
STAR: Situation (small scope), Task (your role), Action (listened, proposed compromise, escalated only if needed), Result (shipped + relationship intact).
Differentiator: show you separated the technical disagreement from the person. "I realized we were optimizing for different things — he for speed, me for maintainability — so we agreed on a 2-week spike."
Example: choosing between REST vs GraphQL in a team project.
Mistake: blaming the teammate. The interviewer wants to see YOUR behavior, not theirs.
Tell me about a time you failed.
Pick a real, ideally technical failure. Own it, extract the lesson, show you applied the lesson later.
Differentiator: quantify the impact and the fix. "Pushed to prod without migration — rolled back in 20 min. Now I always add a CI check before merge."
Example: shipping a feature that broke prod DB; team rolled back; you wrote the retro.
Mistake: picking a fake failure like "my project was too ambitious." Transparently dodging.
Where do you see yourself in 5 years?
Show growth ambition that's compatible with the role. Technical depth + broader scope (mentoring, system design, product thinking).
Differentiator: tie it to the company — "I want to grow into the kind of engineer who owns a system end-to-end, which is exactly what your team does."
Example: "Ship-level SDE2 by year 3, leading a small team by year 5."
Mistake: "CEO" or "your manager" — arrogant. "I don't know" — unambitious.
Why do you want to leave your current role / why this company?
Forward-looking, never trash-talking. "Outgrew the scope, want bigger systems / deeper problems / specific technology."
Differentiator: name 2 concrete things about the company — tech stack, an engineering blog post, their open-source work.
Example: "Your team open-sourced X which I read in depth. The scale you operate at is where I want to be learning."
Mistake: badmouthing past manager/team. Immediate red flag.
Tell me about a time you took initiative.
Something no one asked you to do. Bug you fixed, tool you built, process you improved.
Differentiator: quantify — "saved the team 3 hours/week" or "reduced build time 40%".
Example: wrote a script to auto-generate API types from Swagger, team adopted it.
Mistake: picking something routine ("I learned React on my own").
Do you have any questions for us?
YES — always. Ask 2-3: about team/role mechanics, growth/feedback, the first 90 days.
Differentiator: ask about their challenges. "What's the biggest engineering challenge the team is facing right now?" — shows you think like a teammate, not an applicant.
Example: "How is engineering success measured here beyond shipping features?"
Mistake: asking only about salary/WFH/leave — makes you look transactional.
What's your salary expectation?
Do research (Glassdoor, AmbitionBox, Levels.fyi). Give a range, anchored on market + your strengths. Defer if too early ("I'd like to understand the role first").
Differentiator: "Based on market data for this role and my experience, I'd expect ₹X–Y. Open to discussing total comp."
Example: fresher SDE at tier-1 startup: ₹12–18L depending on product/company.
Mistake: lowballing yourself or refusing to answer entirely.
07

Recursion + Week 1 Wrap

Sunday, Apr 26

DSAAptiMERNInterview
DSA · 2 hrs · Recursion Fundamentals
  • Recursion template: (1) base case, (2) recursive call(s) on smaller input, (3) combine results.
  • Recursion tree: visualize calls and subcalls. Total work = sum across levels.
  • Master theorem: T(n) = aT(n/b) + f(n). Merge sort: 2T(n/2)+O(n) → O(n log n).
  • Tail recursion: recursive call is last op. JVM doesn't optimize, but concept matters.
  • Subsets / permutations / combinations: the core backtracking patterns.
  • Include/exclude recurrence: at each index decide take vs skip.
  • Pitfall: missing base case or wrong decrement → stack overflow.
Week 1 revision: redo 3 problems you struggled with. Re-explain approach out loud. Score yourself on "could I teach this?"
Aptitude · 1 hr · Mixed Mock (30 Q, timed)
  • Format: 30 questions, 30 min. Simulate real placement test.
  • Topics covered: Numbers, %, P&L, Ratio, TSD, T&W, SI/CI — Week 1's full set.
  • Strategy: first pass on easy, skip hard (mark and return), never spend > 90s on one Q.
  • Review: for each wrong one, write the correct method in a notes file. This file is gold.
MERN · 1 hr · Build Your First Express CRUD
  • Project: notes-api — in-memory array store. Routes: GET /notes, POST /notes, PUT /notes/:id, DELETE /notes/:id.
  • Validation: reject missing title with 400. Return 404 on unknown id.
  • Logger middleware: log method, path, status, elapsed ms.
  • Error handler: central try/catch wrapper or 4-arg middleware. Never leak stack traces in prod.
  • Test with Postman/Thunder Client. Commit to GitHub — this starts your portfolio.
Interview Q&A · 1 hr · Week 1 Review Mock
Simulate a 45-min interview: 2 DSA (arrays + linked list), 3 CS fundamentals (OOP, OS, DBMS — random), 2 HR. Record yourself on phone. Review brutally.
Walk me through your approach — find the first non-repeating character in a string.
Two-pass: (1) frequency array[26] counting occurrences. (2) iterate original string, first char with count=1 is the answer.
Differentiator: "If queries are streaming, use a linked hashmap for O(1) get/insert and maintain the head." Shows you think beyond the prompt.
Example: "loveleetcode" → 'v'.
Mistake: using HashMap when array[26] works (slower + more memory).
Can you detect a loop in a linked list without extra space?
Floyd's tortoise-hare. Slow +1, fast +2. If they meet → cycle. O(n) time, O(1) space.
Differentiator: prove correctness: "When slow enters the cycle, fast is somewhere inside. Each iteration fast gains 1 step relative to slow — they must meet within cycle length."
Example: Linked List Cycle II (LC 142) — reset slow to head to find cycle start.
Mistake: using HashSet (O(n) space) when asked for O(1).
Explain polymorphism with a code snippet.
Parent reference holds child object; calls dispatch to child's override at runtime.
Differentiator: mention that method lookup uses the vtable — constant time, but one indirection vs direct call.
Example: List<Integer> l = new ArrayList<>(); l.add(1) invokes ArrayList.add, not List's abstract declaration.
Mistake: confusing with overloading.
What happens on SELECT with no index on a 10M-row table?
Full table scan — O(n). Plus disk I/O if not in buffer pool. Can crush the DB server on concurrent load.
Differentiator: "Add an index on the WHERE column. Check EXPLAIN to confirm it's used. For frequent range scans, consider a covering index so the lookup stays in the index B+ tree."
Example: SELECT * FROM orders WHERE user_id = 5 — index user_id → O(log n) seek + O(k) scan for k results.
Mistake: adding indexes blindly — they slow writes and take space.
Quick thread vs process fire-round.
Threads share memory; processes don't. Thread context-switch is cheap; process switch flushes TLB. Threads coordinate with mutexes; processes with IPC.
Differentiator: name a real use — Node.js single-threaded event loop + worker_threads for CPU-bound work.
Example: Nginx uses multi-process for isolation + event loops per worker.
Mistake: "threads are always better" — not for crash isolation.
Walk me through a project you're proud of.
Problem → your role → tech choices (with rationale) → one hard bug/decision → result/impact.
Differentiator: prepare to defend every tech choice — "Why MongoDB not Postgres?" Have the answer ready.
Example: Notes app — used Mongo because schema evolved weekly; used JWT because stateless fits serverless; deployed on Render.
Mistake: vague "I built a full-stack app with React and Node."
What's your approach to learning a new tech quickly?
Official docs → smallest working example → build something non-trivial → read one good open-source codebase that uses it.
Differentiator: "I timebox — 2 hrs for intro, then write code on day 1. Reading alone doesn't stick."
Example: picked up Socket.io in 2 days by building a chat app after reading the getting-started guide.
Mistake: "I watch YouTube tutorials" — passive learning, weak signal.
Week 2 — Intermediate · Apr 27 – May 3
Move into the meaty stuff. Binary Search → Recursion/Backtracking → Trees → BST/Heap → Graphs → DP. MERN builds to a full JWT-authenticated CRUD API with Mongoose. Interview block shifts to OS, DBMS, Networks, and system-design thinking.
08

Binary Search Mastery

Monday, Apr 27

DSAAptiMERNInterview
DSA · 2 hrs · Binary Search Patterns
  • Template (closed): l=0, r=n-1; while l≤r; mid=l+(r-l)/2; return/shrink. Use l+(r-l)/2 to avoid overflow.
  • Template (half-open): l=0, r=n; while l<r. Cleaner for "first true" / "last false" search.
  • Rotated sorted search: identify sorted half via arr[l] ≤ arr[mid], then decide side.
  • Binary search on answer: search space = possible answers. Check feasibility with O(n) function. Used for "min largest", "max min" problems.
  • Peak element: BS using mid vs mid+1 comparison.
  • Lower bound / upper bound: first index ≥ x / first index > x.
Aptitude · 1 hr · Permutation & Combination
  • nPr = n!/(n−r)! — arrangement, order matters. nCr = n!/(r!(n−r)!) — selection.
  • Arrange identical items: n! / (p!·q!·...) for repeats.
  • Circular permutation: (n−1)! for distinct items around a table.
  • At least 1: total − none. At most k: sum from 0..k.
  • Gap method: arrange non-objects first, then fit restricted ones into gaps.
MERN · 1 hr · React State Management (Context API)
  • Props drilling: passing props through many layers — smell.
  • Context API: createContext → Provider wraps tree → useContext in any child. Good for theme, auth, current user.
  • When Context is wrong: high-frequency updates (re-renders all consumers) → Redux/Zustand/Jotai.
  • useReducer: for complex state transitions. Works great paired with Context for local-global state.
  • Task: build a ThemeContext with light/dark toggle, consume in 2 components.
Interview Q&A · 1 hr · OOP Advanced
Explain the Observer pattern.
One subject maintains a list of observers; notifies all on state change. Decouples publisher from subscribers.
Differentiator: mention it's the foundation of event-driven systems — DOM events, Node EventEmitter, RxJS, React's state updates.
Example: stock price updates notify chart + portfolio + alerts — each a separate observer.
Mistake: confusing with Pub/Sub — Observer is in-process with direct references; Pub/Sub uses a broker.
Factory vs Builder pattern?
Factory: returns an object of a family, caller doesn't specify concrete class. Builder: step-by-step construction for objects with many optional params.
Differentiator: "Use Builder when constructor would have 5+ params — fluent API beats telescoping constructors."
Example: StringBuilder in Java; Lombok @Builder; HTTP request builders.
Mistake: using a factory for a single type — just call the constructor.
What is Dependency Injection?
Pattern where a class receives its dependencies from outside rather than creating them. Enables testing (inject mocks), swapping, loose coupling.
Differentiator: "Constructor injection > setter injection — dependencies are required and the object is always valid after construction."
Example: Spring's @Autowired; in JS you pass deps into a function/constructor.
Mistake: thinking DI requires a framework. It's a principle; frameworks just automate it.
Shallow vs deep copy?
Shallow copies the top-level object; nested references are shared. Deep copies every level.
Differentiator: "In JS, {...obj} is shallow. Deep: structuredClone(obj) (modern) or recursive copy — not JSON.parse(JSON.stringify()) (loses Dates, funcs)."
Example: React state — you must return a new object at every level you mutated, else reconciliation misses it.
Mistake: mutating nested state directly and wondering why UI doesn't update.
Final vs Abstract vs Static in Java?
final: class can't be extended / method can't be overridden / var can't be reassigned. abstract: class can't be instantiated / method has no body. static: belongs to class.
Differentiator: "final class can't be subclassed — String is final for security + hashing guarantees."
Example: Spring caches beans as static final configs.
Mistake: declaring a method both final and abstract — compile error.
Garbage collection — what does it actually do?
Reclaims memory of unreachable objects. Generational GC: Young gen (minor GC, fast) + Old gen (major GC, stop-the-world).
Differentiator: name modern collectors — G1, ZGC, Shenandoah — with pause-time goals < 10ms.
Example: memory leak in Java = accidentally-retained references (static map that keeps growing).
Mistake: thinking GC means "no memory leaks."
Difference between Composition, Aggregation, Association?
Association: any relationship. Aggregation: "has-a", parts can exist alone. Composition: "owns-a", parts die with whole.
Differentiator: "University has Departments (aggregation — dept lives if uni closes? debatable). House has Rooms (composition — no house, no rooms)."
Example: Car and Engine → composition. Car and Driver → association.
Mistake: treating all three as synonyms.
What's the Strategy pattern? Give a modern use case.
Define family of interchangeable algorithms; select at runtime. Avoids large switch/if-else chains.
Differentiator: "Payment gateways: inject PaymentStrategy — Razorpay/Stripe/UPI — caller doesn't care which."
Example: Java's Comparator is literally a strategy for sorting.
Mistake: applying it where a simple lambda would do.
09

Recursion & Backtracking

Tuesday, Apr 28

DSAAptiMERNInterview
DSA · 2 hrs · Backtracking Template
  • Template: choose → explore → un-choose. Track path, push answer at leaf.
  • Pruning: cut branches early when constraint violated. Major perf win.
  • Subsets: at each i, include or skip. Add current path to answer at each step.
  • Permutations: used[] array or swap-in-place. Careful with duplicates → sort first, skip used[i-1]==false & arr[i]==arr[i-1].
  • N-Queens: one queen per row; track cols, diag1 (r+c), diag2 (r-c) as sets.
  • Word search: DFS + visited + backtrack. Return early on found.
Aptitude · 1 hr · Probability
  • P = favourable/total. 0 ≤ P ≤ 1.
  • P(A∪B) = P(A) + P(B) − P(A∩B). If mutually exclusive, last term is 0.
  • P(A∩B) = P(A)·P(B) if independent.
  • P(A') = 1 − P(A). Use complement for "at least 1" problems.
  • Bayes: P(A|B) = P(B|A)·P(A) / P(B).
MERN · 1 hr · REST API Design
  • Resource-oriented URLs: /users, /users/:id, /users/:id/orders. Nouns, not verbs.
  • Verbs via HTTP methods: GET, POST, PUT (full replace), PATCH (partial), DELETE.
  • Status codes: use the right one. 201 for create, 204 for delete, 409 for conflict, 422 for validation, 429 for rate limit.
  • Pagination: cursor-based for stable pagination; ?limit=20&cursor=.... Offset-based fine for small datasets.
  • Versioning: /api/v1/ in URL or Accept: application/vnd.api.v1+json header.
  • Idempotency keys: clients send a unique key on POST; server dedupes retries.
Interview Q&A · 1 hr · SQL Deep Dive
Write: second highest salary.
SELECT MAX(salary) FROM emp WHERE salary < (SELECT MAX(salary) FROM emp); or SELECT salary FROM emp ORDER BY salary DESC LIMIT 1 OFFSET 1;
Differentiator: use DENSE_RANK() for Nth highest with ties handled correctly.
Example: SELECT salary FROM (SELECT salary, DENSE_RANK() OVER (ORDER BY salary DESC) r FROM emp) x WHERE r = 2;
Mistake: LIMIT 1,1 fails with ties.
Find duplicate rows.
SELECT col, COUNT(*) FROM t GROUP BY col HAVING COUNT(*) > 1;
Differentiator: to delete dupes keeping one: use ROW_NUMBER() OVER(PARTITION BY key ORDER BY id) and delete where rn > 1.
Example: dedupe emails in users table.
Mistake: using SELECT DISTINCT for finding dupes — it hides them.
What is a VIEW? When use it?
Named virtual table defined by a query. Simplifies complex joins, enforces access control (expose only needed columns).
Differentiator: materialized views cache results → fast reads, stale data. Refresh manually/scheduled.
Example: view of active users joining orders.
Mistake: treating a view as a table performance-wise — underneath it re-runs the query.
Difference: DELETE vs TRUNCATE vs DROP?
DELETE: row-by-row, WHERE allowed, logged, triggers fire, rollback possible. TRUNCATE: fast reset, no WHERE, no triggers, resets identity. DROP: removes table definition entirely.
Differentiator: "TRUNCATE deallocates pages; DELETE logs every row — hence TRUNCATE is orders of magnitude faster."
Example: clearing a staging table = TRUNCATE.
Mistake: assuming TRUNCATE can be rolled back in all DBs (Postgres yes in txn; MySQL before 8.0 no).
Explain GROUP BY + window functions.
GROUP BY collapses rows to one per group. Window functions (OVER) compute per-row results using a window of related rows — rows stay intact.
Differentiator: "RANK(), ROW_NUMBER(), LAG(), LEAD(), running totals via SUM() OVER(ORDER BY ...) — every SQL engineer should know."
Example: rank employees by salary within department: RANK() OVER (PARTITION BY dept ORDER BY salary DESC).
Mistake: using correlated subqueries where a window function is cleaner and faster.
What is a correlated subquery?
Inner query references outer query's column; runs per outer row.
Differentiator: "Can be O(n²) — rewrite as JOIN or window function when perf matters."
Example: employees earning above their dept avg.
Mistake: not realizing correlated subquery is the cause of a slow query.
Stored Procedure vs Function?
Procedure: executes logic, can perform DML, may not return values, called with CALL. Function: returns a value, used in expressions, generally side-effect free.
Differentiator: "Modern apps avoid heavy logic in DB — hard to test, version, scale. Keep DB for data, app for logic."
Example: function getTaxRate(region) used in SELECT.
Mistake: putting business rules in procs that should live in the service.
What is a foreign key? What does ON DELETE CASCADE do?
FK enforces referential integrity — value must exist in parent. CASCADE: on parent delete, child rows auto-deleted.
Differentiator: "Alternatives: RESTRICT (block), SET NULL, SET DEFAULT. Use CASCADE carefully — can nuke data unintentionally."
Example: deleting a user → cascade-deletes their posts.
Mistake: adding CASCADE without understanding the blast radius.
10

Binary Trees & Traversals

Wednesday, Apr 29

DSAAptiMERNInterview
DSA · 2 hrs · Trees
  • Traversals: preorder (root-L-R), inorder (L-root-R), postorder (L-R-root). Level-order via queue (BFS).
  • Recursive DFS template: base(null) → recurse left → recurse right → combine.
  • Max depth / height: 1 + max(dfs(l), dfs(r)).
  • Diameter: track max (leftDepth + rightDepth) across all nodes during DFS.
  • Lowest Common Ancestor: if node matches p or q → return node. If both subtrees return non-null → current is LCA.
  • Serialize / deserialize: preorder with null markers. Classic interview question.
  • Path sum: DFS + decrement target. For all paths, collect into list.
Aptitude · 1 hr · Averages & Ages
  • Avg = Sum/Count. Adding/removing element: new_avg = (old_sum ± val) / new_count.
  • Weighted avg: Σ(wᵢ·xᵢ) / Σwᵢ.
  • Ages: let present age = x; past = x-k, future = x+k. Write equations, solve.
  • Sum of 1..n = n(n+1)/2. Avg = (n+1)/2.
MERN · 1 hr · JWT Authentication
  • JWT = header.payload.signature, base64-url encoded. Signature prevents tampering; payload is readable!
  • Flow: login → server issues JWT (signed with secret). Client sends in Authorization: Bearer <token>. Server verifies on each request.
  • Don't store secrets in JWT — base64 ≠ encryption.
  • Access + Refresh: short-lived access (15m) + long-lived refresh (7d, HTTP-only cookie) — balances UX and security.
  • Revocation: stateless JWT can't be invalidated easily — use short expiry or maintain a deny-list.
  • Task: add /login issuing JWT, /me protected by authMiddleware.
Interview Q&A · 1 hr · OS Advanced + Concurrency
Explain thread synchronization primitives.
Mutex (1 owner), semaphore (N owners), read-write lock (N readers OR 1 writer), condition variable (wait/signal), barrier (wait for N threads).
Differentiator: "Prefer higher-level abstractions — Java's ConcurrentHashMap, AtomicInteger, CompletableFuture — over raw synchronized blocks."
Example: producer/consumer = mutex + 2 semaphores + queue.
Mistake: nested locks without ordering → deadlock.
volatile vs synchronized in Java?
volatile: visibility (always reads from main memory, no caching in register/cache). No atomicity. synchronized: both visibility AND atomicity via lock.
Differentiator: "volatile boolean stop = good. volatile int counter; counter++ = broken (not atomic). Use AtomicInteger."
Example: double-checked locking needs volatile to work correctly on modern JMM.
Mistake: thinking volatile is a lighter-weight synchronized — they solve different problems.
Producer-Consumer problem?
Shared bounded buffer; producers add, consumers remove. Coordinated via mutex + "not full" + "not empty" condition vars (or semaphores).
Differentiator: "Java's BlockingQueue handles this out of the box — don't reinvent."
Example: log writer uses a BlockingQueue; app threads push, writer thread drains.
Mistake: busy-wait (polling empty) — use condition vars.
User-mode vs kernel-mode?
Kernel mode: full hardware access, runs OS code. User mode: restricted, must use syscalls to request kernel services.
Differentiator: "Every syscall = mode switch = ~hundreds of ns. That's why epoll/io_uring matter — fewer syscalls."
Example: reading a file triggers read() syscall → mode switch → kernel does disk I/O → returns.
Mistake: thinking user code runs "in the kernel" when doing I/O.
Blocking vs non-blocking I/O?
Blocking: thread waits till data arrives. Non-blocking: returns immediately; you poll or use event notification (epoll/kqueue).
Differentiator: "Node.js uses non-blocking I/O + single thread + event loop — handles 10K connections with 1 thread. Java can do same with NIO/Netty."
Example: C10K problem — classic motivation for non-blocking.
Mistake: calling non-blocking "async" — they're different. Non-blocking is a syscall mode; async is a programming model.
What is a race condition? How do you fix it?
Outcome depends on non-deterministic timing of threads. Fix: make the critical section atomic (lock, atomic ops, lock-free algorithms).
Differentiator: "Check-then-act is the classic race — if (!map.contains(k)) map.put(k,v). Fix: putIfAbsent or computeIfAbsent."
Example: two threads incrementing same counter lose updates without atomicity.
Mistake: thinking volatile prevents all races — it doesn't.
What's a memory leak in a GC language?
Live references that should be dead but aren't — GC can't collect them.
Differentiator: "Common sources: static caches that grow unbounded, listeners not unregistered, ThreadLocals in thread pools, closures capturing large objects."
Example: React's useEffect forgetting to clear interval → handlers pile up.
Mistake: thinking GC magically solves memory issues.
Explain the event loop in Node.js.
Single-threaded loop processing phases: timers → pending callbacks → idle → poll (I/O) → check (setImmediate) → close. libuv thread pool handles blocking fs/crypto in background.
Differentiator: "CPU-bound tasks block the loop — offload to worker_threads. process.nextTick runs before next phase; microtasks (Promises) between phases."
Example: heavy JSON.parse blocks the loop → use streams or worker.
Mistake: calling Node "multi-threaded" without nuance.
11

BST + Heaps

Thursday, Apr 30

DSAAptiMERNInterview
DSA · 2 hrs · BST + Heap
  • BST invariant: left subtree < node < right subtree. Inorder → sorted sequence.
  • Validate BST with min/max bounds, not just parent comparison.
  • Kth smallest in BST → inorder traversal with counter.
  • Self-balancing: AVL, Red-Black — ensure O(log n) worst. Concept level only.
  • Heap = complete binary tree stored as array. Min-heap: parent ≤ children. insert/extract: O(log n).
  • heapify: bubble-up (insert) or bubble-down (extract). Build-heap is O(n).
  • Top K: min-heap of size K → O(n log k). Kth largest = size-K min-heap.
  • Median from stream: two heaps — max-heap (lower half) + min-heap (upper half).
Aptitude · 1 hr · Calendar + Clocks
  • Odd days: 100y = 5 odd, 200y = 3, 300y = 1, 400y = 0. Leap if ÷4 (÷400 for century).
  • Day of week: count odd days from a known reference.
  • Clock angle: H·30 − M·5.5 for hour vs minute angle. Between hands = absolute value.
  • Clock coincidence: hands overlap 11 times in 12 hrs. Right angle 22 times.
MERN · 1 hr · Mongoose Schemas & Relationships
  • Schema: new mongoose.Schema({ name: String, age: {type:Number, required:true, min:0} }). Adds validation + types.
  • Model: mongoose.model('User', userSchema). Use for CRUD.
  • Embed vs reference: embed for 1-to-few bounded (user addresses). Reference for 1-to-many or many-to-many (posts→comments).
  • populate(): follow refs — like a JOIN. Use sparingly, one level deep.
  • Hooks: pre('save') for password hashing, post('remove') for cleanup.
  • Task: User + Post schemas with ref, create, populate, query by author.
Interview Q&A · 1 hr · Networks Advanced + Security
How does TLS handshake work?
Client hello (versions, ciphers, random) → server hello + cert → key exchange (ECDHE) → both derive session keys → encrypted communication begins.
Differentiator: "TLS 1.3 compresses to 1-RTT (0-RTT with resumption). Cert validation walks up the chain to a trusted root CA."
Example: openssl s_client -connect google.com:443 prints handshake.
Mistake: thinking TLS uses only asymmetric crypto. It uses symmetric (AES) after key exchange — symmetric is ~100× faster.
SQL injection — how does it happen, how do you prevent it?
Attacker injects SQL via user input that gets concatenated into a query. Prevent with parameterized queries / prepared statements / ORMs.
Differentiator: "Never concat user input. Even escaping is fragile — use placeholders: db.query('SELECT * FROM u WHERE id=?',[id])."
Example: ' OR 1=1 -- classic login bypass.
Mistake: relying on client-side validation only.
XSS vs CSRF?
XSS: attacker injects JS into your page (stored, reflected, DOM). CSRF: attacker tricks user's browser into making a request using their cookies.
Differentiator: "XSS defense: escape output, CSP header, httpOnly cookies. CSRF defense: SameSite cookies + CSRF tokens + check Origin header."
Example: XSS → <script>fetch('/steal?c='+document.cookie)</script> in a comment.
Mistake: confusing the two — different attacks, different fixes.
HTTP/1.1 vs HTTP/2 vs HTTP/3?
1.1: text, one req per connection (pipelining broken). 2: binary, multiplexed streams over one TCP connection, server push. 3: built on QUIC/UDP, eliminates TCP head-of-line blocking.
Differentiator: "HTTP/2 still has HoL at TCP layer — packet loss blocks all streams. HTTP/3 solves that by doing transport over UDP."
Example: Cloudflare + Google largely ran the HTTP/3 migration.
Mistake: saying HTTP/2 is encrypted — it's not required by spec but in practice yes (browsers require TLS).
What's CDN and how does it speed things up?
Content Delivery Network: geo-distributed cache of static assets. User hits nearest edge, reducing latency + origin load.
Differentiator: "Also DDoS absorption, TLS termination at edge, WAF rules. Cache-Control + ETag / s-maxage drive CDN caching."
Example: Cloudflare, Fastly, CloudFront.
Mistake: thinking CDN only caches — modern CDNs run edge workers for dynamic logic too.
Symmetric vs Asymmetric encryption?
Symmetric: one shared key (AES). Fast. Key distribution problem. Asymmetric: public + private key pair (RSA/ECC). Slower. Solves key distribution.
Differentiator: "TLS combines both — asymmetric to exchange a symmetric session key, then symmetric for data. Best of both."
Example: SSH uses asymmetric auth, symmetric channel.
Mistake: thinking RSA is used for bulk encryption — too slow.
What is hashing? How is it different from encryption?
Hash = one-way, fixed-size digest. Encryption = two-way, with key. Hashing for integrity + passwords; encryption for confidentiality.
Differentiator: "Password hashes must use bcrypt/argon2 (slow, salted, memory-hard) — not SHA256. MD5/SHA1 are broken for security use."
Example: commit hash in git = SHA1 of content + metadata.
Mistake: "hashing encrypts the password" — no, it digests.
Explain rate limiting strategies.
Token bucket (refill rate + burst), leaky bucket (fixed outflow), fixed window, sliding window log, sliding window counter.
Differentiator: "Sliding window log is accurate but memory-heavy. Token bucket is the production-favorite — used by AWS, Stripe."
Example: Redis + Lua script for atomic token bucket across a cluster.
Mistake: implementing fixed-window and not realizing it allows 2× burst at window boundary.
12

Graphs — BFS & DFS

Friday, May 1

DSAAptiMERNInterview
DSA · 2 hrs · Graph Traversals
  • Representations: adjacency list (sparse, O(V+E) space), adjacency matrix (dense, O(V²)).
  • BFS: queue + visited set. Shortest path in unweighted graph. O(V+E).
  • DFS: recursion or stack + visited. Connected components, cycle detection.
  • Cycle detection (undirected): DFS with parent tracking — visited neighbor != parent ⇒ cycle.
  • Cycle (directed): three-color DFS (white/gray/black) or back-edge detection.
  • Topological sort: Kahn's (BFS + in-degree 0 queue) or DFS post-order reversed.
  • Grid as graph: cells = nodes, 4-neighbors = edges. Island problems, word search.
Aptitude · 1 hr · Logical Reasoning — Series, Coding
  • Number series: check arithmetic → geometric → diff of diffs → squares/cubes → interleaved → Fib-like.
  • Letter series: A=1, Z=26. Look for shifts +1, +2, ×2.
  • Coding-Decoding: map letter → shifted letter. Verify with a second word.
  • Analogies: relationship between pair, apply to second pair.
  • Odd one out: find the common property → the exception.
MERN · 1 hr · Real-time with Socket.io
  • WebSocket: full-duplex over TCP after HTTP upgrade. Socket.io adds rooms, reconnection, fallback.
  • Server: io.on('connection', socket => ...). Emit to one: socket.emit. Broadcast to room: io.to(room).emit.
  • Client: socket.on('event', cb). Auto-reconnects on network hiccup.
  • Scaling: multiple nodes need Redis adapter to broadcast across instances.
  • Task: build a simple chat room — join by name, emit messages, show list in real-time.
Interview Q&A · 1 hr · System Design Basics
What's the difference between horizontal and vertical scaling?
Vertical: bigger machine (more CPU/RAM). Simple, limited by hardware. Horizontal: more machines behind a load balancer. Complex, theoretically unlimited.
Differentiator: "Vertical is where you start. Horizontal requires statelessness, shared session store, distributed caches, and a deployment story."
Example: RDS db.r5.24xlarge is peak vertical; a Cassandra cluster is peak horizontal.
Mistake: assuming horizontal always beats vertical — coordination cost is real.
What is a load balancer? Algorithms?
Distributes traffic across backend instances. Algos: round robin, least-connections, IP hash, weighted. Layer 4 (TCP) or Layer 7 (HTTP).
Differentiator: "Layer 7 LBs (ALB, Nginx, Envoy) can route by path/header/cookie. Sticky sessions for stateful servers — but prefer stateless."
Example: AWS ALB + health checks + target groups.
Mistake: forgetting health checks — traffic hits dead instances.
Caching strategies — where and how?
Cache layers: browser → CDN → API gateway → in-memory (Redis) → DB buffer pool. Patterns: cache-aside, read-through, write-through, write-behind.
Differentiator: "Cache-aside is the default — read cache, miss → DB → populate. Invalidation is hard — use TTL + event-driven invalidation."
Example: Redis cache for user profile, 5-min TTL, bust on profile update.
Mistake: caching without invalidation → stale data bugs.
What is the CAP theorem?
In a partitioned distributed system, you can have at most 2 of: Consistency, Availability, Partition tolerance. Real-world: P is mandatory → pick CP or AP per operation.
Differentiator: "Modern systems tune per-operation: e.g., DynamoDB offers strongly- or eventually-consistent reads. PACELC extends CAP by covering the no-partition case (latency vs consistency)."
Example: MongoDB default (majority write concern) = CP; DynamoDB default = AP.
Mistake: calling a system "CA" — not meaningful in distributed deploys.
Design URL shortener (tiny url) in 5 bullets.
(1) Hash/counter + base62 encoding → 6-7 char short code. (2) Table: short_code → long_url + metadata. (3) Redis cache for hot codes. (4) 301/302 redirect. (5) Track analytics via async write.
Differentiator: "Use a counter + base62 (not random hash) to avoid collisions. Pre-allocate ranges per app server for horizontal scale."
Example: TinyURL, bit.ly.
Mistake: using MD5 + truncate — collisions are inevitable.
Message queue vs pub/sub?
Queue: one consumer processes each message (work distribution). Pub/sub: every subscriber gets a copy (fanout).
Differentiator: "Kafka supports both via consumer groups. RabbitMQ has explicit exchanges for topic routing. SQS is queue-only; SNS is pub/sub; chain them for fanout + durable processing."
Example: Order placed → SNS fanout → Inventory service + Email service + Analytics service each get the event.
Mistake: using DB polling when a queue would be cleaner.
Why use a reverse proxy?
TLS termination, caching, compression, load balancing, security (hide backend), rate limiting, request rewriting.
Differentiator: "Nginx handles 50k+ req/sec on commodity hardware. Offloading TLS + gzip to proxy frees your Node/Python backend."
Example: Nginx in front of Node; Envoy in K8s service mesh.
Mistake: running Node directly on port 80 in prod.
SQL read replica vs sharding?
Read replicas: async copies for read scaling; writes go to primary. Sharding: partition data across shards by key; each shard handles subset of writes+reads.
Differentiator: "Replicas hit replication lag limits (typically sub-second but still). Shard when a single primary can't handle writes. Sharding is operationally painful — defer as long as possible."
Example: user_id mod N → shard N. Resharding is the hard part.
Mistake: sharding prematurely when read replicas would suffice.
13

Graphs — Weighted & Shortest Path

Saturday, May 2

DSAAptiMERNInterview
DSA · 2 hrs · Weighted Graphs
  • Dijkstra: single-source shortest path, non-negative weights. Min-heap + relaxation. O((V+E) log V).
  • Bellman-Ford: handles negative edges. Detects negative cycles. O(V·E).
  • Floyd-Warshall: all-pairs, O(V³). Good for small dense graphs.
  • Union-Find (DSU): find + union with path compression + rank. Nearly O(1) amortized.
  • MST — Kruskal: sort edges + DSU. MST — Prim: min-heap from starting vertex.
  • 0-1 BFS: deque — edges weight 0 push front, weight 1 push back. O(V+E) for 0/1 weights.
Aptitude · 1 hr · Data Interpretation
  • Tables: read totals first; compute row/col %. Eliminate answer choices by magnitude.
  • Bar/Pie charts: pie angles — 360° total. 10% = 36°. Segments add up.
  • Line graph: trends, peaks, % change between points.
  • Caselet: translate the words into a table or equation before answering.
  • Speed trick: ballpark first — often only one option is in range.
MERN · 1 hr · Middleware, Validation & Error Handling
  • Validation library: zod or joi. Parse req.body, throw on invalid.
  • Auth middleware: read Authorization header → verify JWT → attach user to req.usernext().
  • Error middleware: 4-arg signature. Centralize logging, mask internal errors in prod.
  • Async errors: wrap handlers in asyncHandler or use Express 5 (auto-forward).
  • Helmet, cors, rate-limit — always in a prod Express app.
Interview Q&A · 1 hr · Scalability & Distributed Systems
What is eventual consistency?
System will converge to consistent state, given no new writes. Readers might see stale data temporarily.
Differentiator: "DynamoDB, Cassandra, S3 are eventually consistent by default. Tradeoff: high availability + low latency for slightly stale reads."
Example: 'like' count updates propagating across regions — briefly different.
Mistake: using EC where strong consistency is required (bank balance).
Idempotency — why critical in distributed systems?
Network retries happen. Same operation run twice must yield same result. Use idempotency keys on POST, PUT (inherently idempotent), dedupe logic.
Differentiator: "Stripe's API requires Idempotency-Key header — server stores key+response for 24h. Safe retries."
Example: charge API retry = don't charge twice.
Mistake: building APIs that blow up on retry.
Consistent hashing — why and where?
Place nodes + keys on a ring; key goes to next node clockwise. Adding/removing a node only reshuffles 1/N of keys.
Differentiator: "Virtual nodes (~100 per physical) smooth out key distribution. Used by Cassandra, DynamoDB, Memcached clients, CDN routing."
Example: cache cluster — adding a node doesn't invalidate all keys.
Mistake: using mod hashing — every resize reshuffles 90% of keys.
What is a heartbeat / health check?
Periodic signal/request to detect liveness. LB removes unhealthy nodes; cluster managers restart them.
Differentiator: "Distinguish liveness (am I alive?), readiness (can I serve traffic?), startup (did I finish init?). K8s has all three."
Example: /health endpoint returns 200 if DB is reachable.
Mistake: making /health hit DB on every call — becomes an attack vector.
Circuit breaker pattern?
Wrap remote calls — after N failures, circuit opens → fail fast instead of cascading. After timeout, half-open → try one → close if OK.
Differentiator: "Prevents thread pool exhaustion during downstream outage. Hystrix (Netflix) popularized; Resilience4j is modern go-to in Java."
Example: payment service down → fail checkout fast with friendly error instead of hanging.
Mistake: not distinguishing transient vs permanent errors for the fallback.
What is Kafka at a high level?
Distributed log. Producers append to topics (split into partitions); consumers read at their own pace. Messages retained by time/size, not by ack.
Differentiator: "Ordering guaranteed within a partition, not across. Throughput via partitioning; consumer groups give competing consumers."
Example: click stream → Kafka → multiple downstream (analytics, ML, search).
Mistake: treating Kafka like a queue (no replay) — it's a log.
What is a 2-phase commit?
Distributed transaction protocol. Phase 1: coordinator asks all participants to prepare. Phase 2: if all yes, commit; else abort.
Differentiator: "Slow, blocking, and vulnerable to coordinator crash. Modern systems prefer Saga pattern (compensating txns) for long-running workflows."
Example: XA transactions in Java — rarely used in web apps today.
Mistake: recommending 2PC for micro-services — too brittle.
How would you design a rate limiter for an API?
Choose algorithm (token bucket per user-IP key). Store counter in Redis with TTL. Atomic increment with Lua script. On exceed → 429 + Retry-After.
Differentiator: "Global vs per-user vs per-endpoint tiers. Distributed rate limit needs a central store or sliding-window counters with sync lag tolerance."
Example: GitHub API: 5000 req/hr authenticated, 60 unauth.
Mistake: rate-limiting in the app memory on a multi-instance deploy — each instance has its own counter.
14

Dynamic Programming — 1D

Sunday, May 3

DSAAptiMERNInterview
DSA · 2 hrs · DP Foundations
  • When DP: overlapping subproblems + optimal substructure.
  • Two approaches: top-down (recursion + memo) OR bottom-up (iteration + table). Start top-down for clarity.
  • Define state: "dp[i] = answer for subproblem ending at/using i". If state has 2 params → 2D DP.
  • Fibonacci → climbing stairs → house robber: all same recurrence shape.
  • Coin change: min coins to make amount — dp[amt]=min(dp[amt-coin]+1).
  • LIS (longest increasing subseq): O(n²) DP or O(n log n) patience sort.
  • Space optimization: if dp[i] depends only on dp[i-1], dp[i-2] → two vars, O(1) space.
Aptitude · 1 hr · Mixed 30-Q Mock (Week 2 set)
  • Cover: P&C, Probability, Averages, Ages, Calendar, Clock, Series, DI.
  • Timebox 30 min. Then 30 min review — rewrite methods for all wrongs.
MERN · 1 hr · Deployment Intro
  • Env vars: never commit .env. Use dotenv locally; platform env in prod.
  • Build step: React → npm run build → static files. Serve via CDN or Express static.
  • Platforms: Render/Railway/Fly for backend; Vercel/Netlify for frontend; MongoDB Atlas for DB.
  • CORS in prod: whitelist only your frontend domain, not *.
  • Logging: Winston/Pino for structured logs. Ship to a service (Logtail, Axiom).
  • Task: deploy the Week 1 notes-api to Render + React frontend to Vercel.
Interview Q&A · 1 hr · Behavioral Round 2 + Situational
You're given a task with unclear requirements — what do you do?
(1) List assumptions, (2) confirm with stakeholder, (3) scope MVP, (4) check-in early with a working slice.
Differentiator: "I'd rather ask 5 dumb questions on day 1 than waste 5 days building the wrong thing."
Example: PM says "add search" — clarify: fuzzy? typo-tolerant? paginated? across which fields?
Mistake: charging in to code without clarifying.
Your code is in review and the senior disagrees with your approach. What do you do?
Ask for the reasoning. Evaluate on merit, not ego. If I'm still convinced, present evidence (benchmarks, references). Escalate only if it's a blocker.
Differentiator: "Strong opinions, loosely held. The goal is ship the right thing, not be right."
Example: I advocated for Redis cache; senior preferred in-memory map. I ran a benchmark — under our load, map was fine. Went with map.
Mistake: getting defensive. Or capitulating silently and shipping something you think is wrong.
Tight deadline, you can't finish everything — how do you decide what to cut?
Talk to the stakeholder. Rank by business value. Cut nice-to-haves. Never cut testing/monitoring from MVP.
Differentiator: "I keep a 'descope list' visible to PM. If we skip X today, it gets tracked for next sprint. No silent cuts."
Example: feature demo in 3 days — I shipped core flow + fake admin screen with placeholder data; real admin came week 2.
Mistake: shipping bugs because you didn't descope.
Give an example of when you had to learn something new under pressure.
Name the tech, why you needed it, timeline, how you ramped, outcome.
Differentiator: "I document as I learn — that doc becomes the team's reference. Turns learning into a team asset."
Example: needed to add Stripe webhooks in 2 days. Read docs, built with ngrok locally, shipped on day 2. Wrote a 1-page guide.
Mistake: vague story with no outcome.
How do you stay updated on tech?
Mix of sources — HN, official blogs, engineering blogs (Uber, Stripe, Figma), 1-2 newsletters, a curated Twitter list.
Differentiator: "I timebox this — 30 min/day. Most posts aren't useful. I save deep-dives for weekends."
Example: recently read Stripe's rate-limiter post — applied a similar pattern at work.
Mistake: saying "I watch YouTube" only.
How do you handle negative feedback?
Listen without defending. Ask for specifics. Acknowledge, form a plan, close the loop with the person.
Differentiator: "Feedback is data. I used to react emotionally — now I write it down, sit on it 24 hours, then act."
Example: got told my PRs are too big. Started breaking into 200-line diffs. Review speed doubled.
Mistake: hollow "I love feedback" — prove it with a behavior change.
Tell me about a time you disagreed with your manager.
Disagree with reasoning, not emotion. Present alternative. Commit to whatever is decided.
Differentiator: "Disagree and commit — Amazon's leadership principle. I voice concerns once, clearly. Then I execute fully."
Example: PM wanted a quick hack; I pushed for proper fix. We compromised — hack with a tracked tech debt ticket.
Mistake: bad-mouthing manager.
What kind of work environment do you thrive in?
Ownership, fast feedback loops, teammates who push back. Be honest — mismatch hurts everyone.
Differentiator: "I do my best work with small teams shipping to real users weekly. Less process, more accountability."
Example: ask about their team culture after answering.
Mistake: "any environment works" — sounds desperate / uninformed.
Week 3 — Advanced + Mock Sprint · May 4–10
Advanced patterns plus ruthless revision. 2D DP → Tries → Greedy → Bit Manipulation → Review → Mocks. Deploy the MERN app end-to-end. Interview block covers LLD/HLD, microservices, and the HR/behavioral round that every offer hinges on.
15

DP — 2D & Grid

Monday, May 4

DSAAptiMERNInterview
DSA · 2 hrs · 2D DP
  • Grid DP: dp[i][j] = unique paths / min cost / max value up to (i,j). Transition from top/left.
  • LCS (longest common subseq): dp[i][j] = match ? dp[i-1][j-1]+1 : max(dp[i-1][j], dp[i][j-1]).
  • Edit distance: three ops (insert/delete/replace) → dp[i][j] = min(three subproblems) + 1.
  • 0/1 Knapsack: dp[i][w] = best value with first i items, capacity w. Take or skip.
  • Unbounded knapsack (coin change): same but can reuse items.
  • Partition DP: dp[i][j] = best split of range [i,j] — matrix chain, palindrome partitioning.
  • Space optimize 2D → 1D when transitions use only prev row.
Aptitude · 1 hr · Boats, Trains, Races
  • Boats: d = b+s, u = b−s. b = (d+u)/2, s = (d−u)/2.
  • Trains crossing: stationary pole → just train length. Platform → train + platform. Another train → sum of lengths / relative speed.
  • Races: A beats B by x m → in the time A finishes the track, B is x m behind.
  • Circular track: meet-time formula — track length / relative speed.
MERN · 1 hr · React Performance
  • React.memo: skip re-render if props unchanged (shallow compare).
  • useMemo: cache expensive computation across renders. Only when it's actually expensive.
  • useCallback: memoize function identity for child memoized components.
  • Code splitting: React.lazy(() => import('./Heavy')) + <Suspense>.
  • Virtualization: react-window for long lists — render only visible rows.
  • Profile: React DevTools Profiler flame chart → find slow renders.
Interview Q&A · 1 hr · Tough DSA / Coding Round
Longest substring without repeating characters — approach?
Sliding window + HashMap of last seen index. On repeat, move left to max(left, lastSeen+1). Update answer.
Differentiator: "Two variants — indexed last-seen (O(n), 1 pass) vs set with shrink-while-dup (O(n), 2 pointer moves). Both O(n)."
Example: "abcabcbb" → 3 ("abc").
Mistake: resetting left to lastSeen+1 unconditionally — left may already be past.
Median of two sorted arrays in O(log(min(m,n)))?
Binary search on partition of smaller array. Pick i from A, j = (m+n+1)/2 - i from B. Check left_max ≤ right_min on both sides.
Differentiator: "Trick is binary-searching on the partition index, not the values. O(log min) — interviewer gold."
Example: [1,3] + [2] → median 2.
Mistake: merging and sorting — O(m+n), fails the follow-up.
Trapping Rain Water — two pointer approach?
l, r pointers. Track leftMax, rightMax. Move the smaller side. Water at index = max − height.
Differentiator: "O(n) time, O(1) space — beats the 2-pass prefix approach (O(n) space)."
Example: [0,1,0,2,1,0,1,3,2,1,2,1] → 6.
Mistake: moving both pointers unconditionally — you must pick the side with smaller wall.
Serialize/deserialize a binary tree.
Preorder with null markers: 1,2,#,#,3,4,#,#,5,#,#. Deserialize with index pointer + recursion.
Differentiator: "Level order works too. Preorder is more compact and simpler to deserialize with a recursive consumer."
Example: LC 297.
Mistake: using inorder alone — ambiguous without structure info.
Word Break — given a string, can it be segmented using dict?
1D DP: dp[i] = true if some j<i has dp[j] true AND s[j..i] in dict. O(n²·L).
Differentiator: "For very long strings, use a trie + BFS from start — prunes branches early."
Example: "leetcode" + ["leet","code"] → true.
Mistake: pure recursion without memo — exponential.
LRU Cache — implement get/put in O(1).
HashMap<Key, Node> + Doubly Linked List. On get: move node to front. On put (new): add to front, evict tail if over capacity.
Differentiator: "Java's LinkedHashMap with removeEldestEntry override = LRU for free. Mention if interviewer pushes for shortest code."
Example: LC 146. Know this by heart.
Mistake: using array + shift — O(n) per op.
Merge K sorted lists — best approach?
Min-heap of size K (one node per list). Pop min, push its next. O(N log K).
Differentiator: "Divide-and-conquer merge pairs: also O(N log K), no heap needed. Choose based on k."
Example: LC 23.
Mistake: merging one-by-one — O(N·K).
Number of islands — DFS or BFS?
Either. Iterate grid, when land found: DFS/BFS to sink entire island (mark visited), increment counter.
Differentiator: "Union-Find also works and is useful for dynamic island counting."
Example: LC 200.
Mistake: forgetting to mark visited → infinite loop or double-counting.
16

Tries & Advanced Strings

Tuesday, May 5

DSAAptiMERNInterview
DSA · 2 hrs · Trie + String Algorithms
  • Trie node: children map (or array[26]) + isEnd flag.
  • Insert: walk/create nodes. Search: walk; return isEnd. StartsWith: walk; return true if reached.
  • Use cases: autocomplete, prefix matching, word games (Boggle, Word Search II), spell check.
  • Space: O(N·L·26). Use HashMap children for sparse alphabets.
  • Rabin-Karp: rolling hash for substring search. Avg O(n+m).
  • Z-algorithm / KMP: build prefix-function array for O(n+m) matching.
Aptitude · 1 hr · Syllogisms & Statements
  • Syllogisms: draw Venn. "All A are B" → A inside B. "Some A are B" → overlap. "No A is B" → disjoint.
  • Check every valid diagram before marking a conclusion true.
  • Statement + conclusion: follows only if definitely true in every interpretation.
  • Cause-and-effect, strong/weak args: stick to the statement, don't assume beyond.
MERN · 1 hr · Testing — Jest & React Testing Library
  • Unit tests (Jest): describe / it / expect. Mock deps with jest.fn().
  • Backend: test pure logic + integration tests with supertest for Express.
  • RTL philosophy: test user behavior, not implementation. Query by role/text.
  • User events: userEvent.click(button), then assert screen state.
  • Coverage is not correctness — 100% cov with weak asserts is worthless.
  • Task: write 3 tests for your notes-api (happy, 400, 404).
Interview Q&A · 1 hr · Low-Level Design (LLD)
Design a Parking Lot.
Entities: ParkingLot, Floor, Spot (types), Vehicle (types), Ticket, Payment. Interfaces for pricing strategy. Enum for spot types.
Differentiator: "Focus on extensibility — new vehicle type shouldn't modify core code (OCP). Pricing is a Strategy."
Example: VehicleFactory → Car/Bike/Truck; Spot.canFit(vehicle).
Mistake: diving into DB schema. LLD is about objects + relationships first.
Design an Elevator system.
Elevator state (current floor, direction, queue). Scheduler that picks best elevator per request. Strategy: SCAN/LOOK algorithms.
Differentiator: "Externalize strategy so you can A/B test. Model buttons (internal, external) as separate event sources."
Example: look-ahead to batch same-direction requests.
Mistake: single elevator only — interviewer wants multi-elevator dispatch.
Design a Splitwise-like expense sharing.
User, Group, Expense (amount, paidBy, splits), Balance graph. Simplify debts via DFS/graph reduction.
Differentiator: "Keep pairwise balances (map of user→user→amount). Simplification is a graph min-cut — NP-hard exactly but greedy heuristic works fine."
Example: A→B 100, B→C 100 → simplify to A→C 100.
Mistake: storing transactions without aggregated balances — recomputing each view is slow.
Design a LRU cache (class level, not just code).
Class Cache<K,V>: capacity, Map<K,Node>, DLL. Operations: get, put, private addToHead/removeNode/moveToHead.
Differentiator: "Talk thread-safety — wrap with ReadWriteLock or use ConcurrentLinkedHashMap."
Example: Caffeine cache in Java — production-grade LRU with window TinyLFU.
Mistake: no doubly-linked list → O(n) moveToHead.
Design a Tic-Tac-Toe.
Board (n×n), Player, Move. Check win with 4 counters: rows[n], cols[n], diag, antiDiag; increment on X move, decrement on O. Win when |count|=n.
Differentiator: O(1) per move win-check. Generalize to N×N game. Strategy pattern for AI player.
Example: LC 348.
Mistake: scanning whole board on every move → O(n²).
Design a Logger rate limiter (LC 359).
Map<message, lastPrintedTimestamp>. Allow print if now - last > 10. Update timestamp.
Differentiator: "For high cardinality, use bloom filter + TTL or approximate hitrate structures to bound memory."
Example: deduping noisy error logs.
Mistake: unbounded map growth — add cleanup of old entries.
How do you approach any LLD problem in an interview?
(1) Clarify requirements, (2) enumerate entities & actors, (3) draft class diagram, (4) walk through core use case, (5) identify extension points & patterns, (6) tradeoffs.
Differentiator: "Explicitly name the SOLID principles and patterns you're applying. Interviewers grade on design vocabulary."
Example: "Payment is a Strategy; Notification is an Observer; creation via Factory."
Mistake: jumping into code before drawing classes.
When would you use composition over inheritance in design?
When behavior varies independently, when you need runtime swap, when the hierarchy would be deep/awkward.
Differentiator: "Deep inheritance chains are a smell. Two levels max in my codebase. After that, I reach for composition."
Example: game character with Weapon, Armor, Skill fields instead of WarriorWithSword < Warrior < Character.
Mistake: treating inheritance as the "OOP default."
17

Greedy Algorithms

Wednesday, May 6

DSAAptiMERNInterview
DSA · 2 hrs · Greedy Patterns
  • When greedy works: exchange argument proves local choice can replace optimal's choice. If it doesn't, use DP.
  • Interval scheduling: sort by end time, pick earliest-ending non-overlapping.
  • Minimum rooms / arrows / merge intervals: sort by start; heap of ends.
  • Jump Game: track max reachable; if i > max → false.
  • Jump Game II: greedy BFS — track current jump's end, expand farthest.
  • Huffman coding: min-heap of frequencies → MST-like merge.
  • Gas station: if total ≥ 0 answer exists; track running sum, reset start on negative.
Aptitude · 1 hr · Seating, Directions, Blood Relations
  • Seating: draw template. Start with most constrained person. Mark fixed, fill rest.
  • Directions: start facing North. Right = CW 90°. Track (x,y). Distance = Pythag.
  • Blood relations: family tree — one relation per step. Genders noted.
  • Coding pattern: for directions, draw arrows; for relations, draw parent→child.
MERN · 1 hr · Git + CI/CD + Docker Basics
  • Branching: feature branch → PR → review → merge. Commit hygiene matters in interviews.
  • GitHub Actions: .github/workflows/ci.yml — run tests on PR. Template with node setup + install + test.
  • Docker: Dockerfile = build recipe. FROM node:20-alpine → COPY → RUN npm ci → CMD.
  • docker-compose: orchestrate app + Mongo locally.
  • 12-factor app: config via env, stateless processes, dep isolation.
Interview Q&A · 1 hr · High-Level Design (HLD)
Design WhatsApp / a chat service.
WebSocket/MQTT for realtime. Message DB (Cassandra — wide rows per chat). Push via APNS/FCM when offline. Presence service. E2E encryption (Signal protocol).
Differentiator: "Sharding strategy: by chat_id or user_id. Storage: write-optimized (Cassandra), last-message in Redis for inbox listing."
Example: WhatsApp handles billions of messages/day on Erlang.
Mistake: suggesting MySQL for message storage at scale.
Design Instagram feed.
Two strategies: Fanout on write (pre-compute followers' feeds on post) vs Fanout on read (compute at read). Celebrities use hybrid — their posts pulled at read.
Differentiator: "Feed ranking via ML, not just chronological. Cache top N per user in Redis. Images in S3 + CDN."
Example: Twitter famously hybrid — celebrity tweets merged at read.
Mistake: ignoring the fanout problem for high-follower users.
Design a URL shortener at scale (100M req/day).
Counter-based base62 codes (pre-allocated ranges per app server). Redis cache (hot 1%). DB: Cassandra/DynamoDB. CDN + edge for redirect. Async analytics.
Differentiator: "100M/day = ~1200 QPS steady, ~5K peak — comfortably one Redis + app fleet. 99% reads; HTTP 301 cacheable by browser."
Example: bit.ly.
Mistake: using auto-increment PK — creates a write bottleneck at scale.
Design a Notification system (email + push + SMS).
API → message queue (Kafka) → per-channel workers (email, push, SMS). Retry + DLQ. Template service. User preferences + rate limit per user.
Differentiator: "Idempotency keys on the API so clients can retry. Priority queues for transactional vs marketing."
Example: Twilio for SMS, SendGrid for email, FCM for push.
Mistake: sync sending — any provider slowdown blocks your API.
Design Uber / ride matching.
Driver locations in geo-index (S2/QuadTree/Redis GEO). Rider request → find nearest drivers in radius → dispatch. ETA via map service. Persistent connection for driver app.
Differentiator: "Driver pings every 5s with location; heap of distances; match score includes ETA + driver rating + surge."
Example: Uber uses H3 hexagonal geo indexing.
Mistake: linear scan of all drivers — won't scale beyond a city.
Design Rate-limiter service for a public API.
Token bucket per API key in Redis with Lua atomic ops. Limits by tier. 429 + Retry-After header. Separate limits per endpoint category.
Differentiator: "Multi-region: local bucket with periodic reconciliation — accept some over-limit for lower latency."
Example: GitHub, Stripe, Twitter.
Mistake: storing counters per-instance — inconsistent across cluster.
How do you approach any HLD problem?
(1) Requirements (functional + non-functional + scale), (2) APIs + data model, (3) high-level diagram, (4) deep-dive bottlenecks, (5) tradeoffs & alternatives.
Differentiator: "Always quantify: QPS, storage/day, latency budget. Answering 'depends on scale' without numbers is a miss."
Example: "100M users × 2 posts/day × 1KB = 200GB/day → 6TB/month → yes, Cassandra."
Mistake: jumping to Kafka/Redis without justifying.
SQL or NoSQL for your system — how do you justify?
Answer: "Depends on access pattern." Relational → SQL. Flexible schema + horizontal write scale → NoSQL. Often both — Postgres + Redis + S3.
Differentiator: "Start with Postgres always. Add NoSQL when you hit a real scale wall. Polyglot persistence is the norm at scale."
Example: orders in Postgres, sessions in Redis, product images in S3, search in Elasticsearch.
Mistake: "I'll use MongoDB" as the default answer — signals inexperience.
18

Bit Manipulation

Thursday, May 7

DSAAptiMERNInterview
DSA · 2 hrs · Bit Tricks
  • XOR properties: a^a=0, a^0=a, commutative. Find single in pairs → XOR all.
  • Check bit i: (n >> i) & 1. Set: n | (1<<i). Clear: n & ~(1<<i). Toggle: n ^ (1<<i).
  • Count set bits: Brian Kernighan — n &= n-1 clears lowest set bit. Loop until 0.
  • Power of 2: n > 0 && (n & (n-1)) == 0.
  • Subsets via bitmask: 2^n masks, each bit = include/exclude. Used for n ≤ 20 DP.
  • Swap without temp: a^=b; b^=a; a^=b; (trick, avoid in real code).
  • Two's complement: -n flips bits and adds 1. Lowest set bit: n & -n.
Aptitude · 1 hr · Verbal + RC
  • Reading Comprehension: skim first, read question, then find the anchor paragraph. Never answer from memory.
  • Synonyms/antonyms: if unsure, use sentence context, eliminate obviously wrong.
  • Sentence correction: subject-verb agreement, tense consistency, parallelism, pronoun clarity.
  • Para-jumbles: find the intro sentence + conclusion first. Then logical chain.
MERN · 1 hr · Microservices & Monorepo Intro
  • Monolith vs Microservice: monolith = one deployable; micro = many small services, independently deployable.
  • When to split: team size > 2 pizzas; clear bounded contexts; different scale profiles.
  • Inter-service comms: sync (HTTP/gRPC) or async (Kafka/RabbitMQ). Favor async where possible.
  • API gateway: single entry → auth, rate-limit, route to right service. Kong/Tyk/AWS API Gateway.
  • Monorepo tools: Turborepo / Nx for MERN — share types/utils.
  • Anti-pattern: shared DB across services — defeats the purpose.
Interview Q&A · 1 hr · MERN-Specific Deep Dive
What's the virtual DOM? Why does React use it?
In-memory tree of React elements. React diffs previous vs next tree (reconciliation) and batches minimal DOM ops. Trades JS work for fewer (slow) DOM ops.
Differentiator: "Virtual DOM isn't inherently faster than raw DOM — it's faster than naive re-rendering of complex UIs. Svelte skips VDOM entirely and is often faster for simple UIs."
Example: keys help reconciliation identify which items moved.
Mistake: saying "VDOM is faster than DOM" — imprecise.
useEffect dependencies — what if I leave the array empty / missing?
Empty: runs once on mount. Missing: every render. Missing a dep you use: stale closures.
Differentiator: "ESLint exhaustive-deps rule is your friend. If you 'need' to omit, use useRef or functional setState."
Example: interval that reads stale state — classic bug.
Mistake: disabling the lint rule instead of fixing the root cause.
Controlled vs uncontrolled components?
Controlled: form state lives in React (value + onChange). Uncontrolled: state lives in DOM, read via ref.
Differentiator: "Controlled is default — enables validation, conditional UI. Uncontrolled for simple file inputs or libraries."
Example: react-hook-form uses uncontrolled inputs for perf on large forms.
Mistake: mixing — controlled input but with defaultValue.
How does Node handle concurrency if it's single-threaded?
Event loop + libuv thread pool. JS runs on one thread; I/O is non-blocking via OS async APIs. CPU-bound work → worker_threads or a separate service.
Differentiator: "CPU-bound loop (e.g., big JSON.parse) blocks everything. Monitor event loop lag with clinic.js or Prometheus."
Example: bcrypt's async variant uses the libuv pool, not the main thread.
Mistake: "Node is multi-threaded" — overstated.
Express middleware order — why does it matter?
Middleware runs in declaration order. Body parser before route using req.body. CORS before auth. Error middleware last.
Differentiator: "Logging first captures all requests. Rate limit before auth to shed load cheaply. Error middleware has 4 args (err,req,res,next) — otherwise Express doesn't recognize it."
Example: classic bug — cors() after auth → browser never gets headers.
Mistake: placing catch-all 404 before real routes.
Mongoose vs native MongoDB driver — which and why?
Mongoose: schemas, validation, hooks, populate. Native: faster, more control, no abstraction overhead.
Differentiator: "Mongoose for apps with strong schema needs. Native when perf is critical or you're doing aggregation-heavy analytics."
Example: Netflix uses native driver + Prisma-like internal layer for hot paths.
Mistake: using populate() on millions of docs — N+1 queries.
Server-side rendering (SSR) vs CSR vs SSG?
CSR: render in browser (slow first paint, fast nav). SSR: render on server per request (fast first paint, server cost). SSG: pre-render at build (fastest, limited to static content). Modern: hybrid (Next.js).
Differentiator: "SSR helps SEO + perceived perf. SSG for marketing pages. Client-side for app-like UIs. Hybrid (ISR, streaming SSR) is the new norm."
Example: Next.js getServerSideProps / getStaticProps.
Mistake: SSR-ing a dashboard nobody sees without auth — wasted cycles.
How do you secure a MERN app in prod?
HTTPS everywhere, Helmet headers, CORS whitelist, sanitized inputs, parameterized DB queries, bcrypt for passwords, JWT with short TTL + refresh, rate limiting, dependency audits.
Differentiator: "Don't log sensitive data. Store secrets in env, not code. Rotate keys. Use signed HTTP-only cookies for session. CSP header to kill XSS impact."
Example: npm audit + Dependabot + Snyk.
Mistake: "I use JWT therefore I'm secure."
19

Revision Day 1 + Mock Interview 1

Friday, May 8

ReviewAptiMERNMock
DSA Review · 2 hrs · Arrays, Strings, LL, Stack, Hash
  • Re-solve 2 problems per topic from memory. No peeking. Time yourself 20 min each.
  • Explain aloud the approach + complexity for each. Record yourself.
  • Weakness log: for each miss, write a 3-line note in a file. Reread before the interview.
  • Pattern triggers: rehearse the "signal → approach" mental map — sliding window, two pointer, HashMap, monotonic stack, DFS/BFS.
Aptitude · 1 hr · 40-Q Full Mock (Timed)
  • Simulate TCS/Infosys/Wipro style. 40 questions, 45 min. Mixed quant + LR.
  • Post-mock: rewrite every miss with the correct method. This document is your clutch asset.
MERN · 1 hr · Portfolio + Resume Review
  • Resume: 1 page. Projects section FIRST if you're a fresher. Quantify everything ("handled 50 concurrent users").
  • Tech keywords match the JD. ATS screens on them.
  • GitHub: pin your top 3 repos. Each has a README with screenshot, stack, setup, deploy link.
  • LinkedIn: headline + about, projects listed with links.
  • Portfolio site: 1 hour to make with Vercel template. Link every project live + source.
Mock Interview 1 · 1 hr · Simulate End-to-End
45-min recorded session: 5 min intro → 2 DSA (medium) → 10 min CS fundamentals rapid fire → 2 behavioral → Q&A. Then 15 min self-review.
Round 1 — DSA (pick 2): Two Sum variant, Valid Parens, LC Medium of choice.
Say the approach aloud before coding. Call out complexity without being asked. Handle edge cases: empty, single, overflow, negatives.
Differentiator: "Narrate — silence is a red flag. Even when you get stuck: 'Let me think about this differently — maybe I can sort first.'"
Example: Two Sum → brute O(n²) → HashMap O(n). State both, code the better.
Mistake: coding silently for 10 minutes, then getting wrong answer.
Round 2 — CS Fundamentals quick fire.
Sample hits: TCP vs UDP · ACID · Virtual memory · Polymorphism · Mutex vs semaphore · Index tradeoff · REST idempotency · JWT flow.
Differentiator: "2-sentence answers, not essays. Lead with the answer, follow with the nuance if asked."
Example: "ACID: atomicity, consistency, isolation, durability. Backed by undo logs, WAL, and MVCC/locks."
Mistake: rambling. If you don't know, say "I'm not sure, my guess would be X" — better than bluffing.
Round 3 — Project deep dive.
Pick your strongest project. Explain: problem, your role, tech stack with justifications, hardest problem, impact.
Differentiator: "Prepare 3 technical anecdotes — a bug you solved, a design decision, a tradeoff you made. Rehearse them cold."
Example: "Socket.io reconnection was losing state — I added event replay from Redis stream, fixed with under 30 lines."
Mistake: saying "I used MERN stack" without a single concrete decision point.
Round 4 — HR.
Rehearse: tell me about yourself, strength, weakness, why this company, 5-year plan, questions for us.
Differentiator: know 2 facts about the company (product, recent news). Reference them.
Example: "I read your engineering blog post on X — I'd love to work on systems like that."
Mistake: "What does your company do?" — instant no.
Self-review checklist.
Watch your recording. Score: (1) clarity of speech, (2) filler words, (3) body language, (4) correctness, (5) communication of tradeoffs. Identify 2 things to fix tomorrow.
Differentiator: "You will cringe. Everyone does. Fixing 2 things per mock is a massive improvement over 5 sessions."
Example: replace "um" with a small pause. Replace "I guess" with "I believe".
Mistake: skipping the review because it's uncomfortable.
20

Revision Day 2 + Mock Interview 2

Saturday, May 9

ReviewAptiMERNMock
DSA Review · 2 hrs · Trees, Graphs, DP, Greedy
  • Re-solve: 1 tree problem, 1 graph (BFS + weighted), 2 DP (1D + 2D), 1 greedy. Timed.
  • Explain amortized complexity for monotonic stack and union-find out loud.
  • Data structure recall: "when would I reach for X?" — HashMap, Heap, Trie, DSU, TreeMap, Deque.
  • Complexity drill: 10 random algos, state time/space in 3 seconds each.
Aptitude · 1 hr · Company-specific Mock (TCS/Infosys/Accenture)
  • Pick the target company style from PrepInsta. 60 min, full paper.
  • Identify pattern: e.g., Infosys loves logical pattern, TCS NQT weights quant higher.
MERN · 1 hr · Full-Stack Project Walk
  • Walk your project end-to-end: landing → signup → main feature → admin. Log every rough edge.
  • Fix top 3 polish items: loading states, error messages, empty states.
  • README upgrade: screenshot, stack list, local setup, architecture diagram (Excalidraw).
  • Demo video: 90-second Loom walkthrough. Attach to resume + LinkedIn.
Mock Interview 2 · 1 hr · Go Harder
Today — higher bar. 1 hard DSA, 1 system design (medium — URL shortener or rate limiter), 1 behavioral ("tell me about a time you failed").
DSA hard set — pick one: LRU Cache, Word Break, Word Ladder, Median of stream, Serialize tree.
Budget: 30 min max. Write full working code. Run through 2 test cases by hand.
Differentiator: "If you don't finish, discuss the plan and what's left. Interviewers grade on progress + clarity, not just correctness."
Example: LRU Cache — HashMap + DLL, walk through put evicting tail.
Mistake: giving up after 5 mins. Keep narrating.
System Design — design a URL shortener (15 min).
Requirements → API → data model → encoding scheme → scale → cache → redirect. Know numbers.
Differentiator: "Quantify: 100M/day = 1200 QPS avg, assume 10x peak. 1KB per record → 36GB/year. DB = KV store. Redis for hot 1%."
Example: see Day 17 Q&A.
Mistake: skipping the numbers layer.
Behavioral — tell me about a time you failed.
Pick a real story. Own the failure. Extract the lesson. Show applied learning.
Differentiator: name specific, technical. "Pushed without running migration — took down staging. Now I have a checklist before any deploy."
Example: shipped a feature without feature flag, had to rollback in production.
Mistake: fake failure, or blame externalized.
Curve ball: "You don't know X — can you learn it by Monday?"
"Yes, here's how I'd approach it in 48 hours: docs + minimal demo on day 1, integration day 2, ship with monitoring."
Differentiator: confidence + plan — not "I'll try my best."
Example: picked up GraphQL in a weekend for a project.
Mistake: overcommitting (saying yes to everything) or underselling.
Feedback loop.
Ask interviewer (or reviewer) for feedback. Write down 3 action items. Apply tomorrow.
Differentiator: "I ask 'what would have made me a strong yes?' — much more actionable than 'how did I do?'"
Example: after each mock, maintain a running improvement sheet.
Mistake: seeking validation instead of critique.
21

Final Polish · Ready to Interview

Sunday, May 10

ReviewAptiMERNChecklist
Light DSA · 1 hr · One of Each Pattern
  • Solve 5 easy problems — one per pattern. Confidence builder, not grind.
  • Arrays (Two Sum), LL (reverse), Tree (max depth), Graph (number of islands), DP (climbing stairs).
  • Do NOT attempt anything new today. Today is about feeling sharp.
Aptitude · 45 min · Warm-up Paper
  • 15-Q mixed paper, 15 min. Then quick review.
  • Review your personal "wrongs log" from the last 20 days. Skim everything.
MERN · 45 min · Deploy, Test Live, Screenshots
  • Click through every live link. Make sure it loads + works.
  • Fix one cosmetic issue. Commit, redeploy.
  • Capture fresh screenshots for resume/portfolio.
Final Interview Readiness Checklist
Print this. Tick each box.
Technical sheet check.
Can you solve LC Medium in ≤ 25 min? Can you state time/space unprompted? Do you know 5 patterns cold (sliding window, two-pointer, HashMap, DFS/BFS, DP)?
Differentiator: know where your ceiling is. If hards trip you, say so honestly — "I've focused on medium patterns; I'd need more prep for hard DPs."
Example: rehearse 1 tree problem, 1 graph, 1 DP — different subtypes each.
Mistake: cramming new topics 24 hrs before.
CS fundamentals 2-sentence check.
Can you answer these in 2 sentences each? OOP pillars · ACID · Process vs thread · TCP vs UDP · HashMap internals · BFS vs DFS · JWT flow · React re-render triggers.
Differentiator: rapid-fire prep with a friend. If you pause > 3 sec, that topic needs another pass.
Example: "ACID = atomicity, consistency, isolation, durability — guarantees in DB transactions."
Mistake: long rambling answers. 2 sentences, always.
Project story bank ready?
Have 3 stories rehearsed: (1) hardest technical problem, (2) teamwork example, (3) failure + learning. 90 seconds each.
Differentiator: STAR structure. Specific numbers. Name the tech.
Example: "reduced API latency by 60% by adding Redis cache on user lookups."
Mistake: vague stories without metrics.
Resume + LinkedIn + GitHub — one-hour audit.
Resume: 1 page, projects first, quantified, ATS-friendly. LinkedIn: photo + headline + projects. GitHub: pinned repos with READMEs + deploy links.
Differentiator: consistent branding across all three. Same project names, same description.
Example: "SyncSpace — real-time collab editor · Node/React/Socket.io · 50 concurrent users" — identical everywhere.
Mistake: outdated LinkedIn while resume is fresh.
Logistics check for interview day.
Stable wifi backup (hotspot). Notebook + 2 pens. Water. Camera + mic tested. Clothes ready. 10-min buffer before.
Differentiator: test the video platform they're using 1 day before. Do NOT test at the call.
Example: HackerRank CodePair, CoderPad, Google Meet — each has quirks.
Mistake: mic issues eating 10 min of a 45-min round.
Mindset.
You don't need to be perfect — you need to be the best candidate who walks in that room. Breathe. Think aloud. Stay curious. If you don't know, say "I'd approach it like this..."
Differentiator: energy matters. A candidate who's engaged and curious beats a stiff candidate with slightly better answers.
Example: smile on video calls. Recruiters feel it.
Mistake: treating it like a test instead of a conversation.
Last words, Harsha.
You did the work. 21 days of DSA + aptitude + MERN + interview prep. The hard part is behind you. Now go collect offers. Good luck. 🚀
Differentiator: the person who preps like this beats 80% of candidates — most wing it.
Example: reject first offer's initial number politely — leave room to negotiate.
Mistake: stopping after the first reject. It's a volume game.
Final Sprint — May 11–15
You're interview-ready. These 5 days push you to the top 10% of candidates. Advanced DSA (strings, segment trees, SCC), product-vs-service company differentiation, capstone polish, and launch. After this, you're not prepping — you're applying.
22

Advanced Strings & Hashing

Monday, May 11

DSAAptiMERNInterview
DSA · 2 hrs · String Algorithms Deep Dive
  • KMP (Knuth-Morris-Pratt): build LPS (Longest Prefix which is also Suffix) array. On mismatch, shift using LPS. O(n+m).
  • Z-algorithm: Z[i] = longest substring from i matching prefix. Pattern matching: build Z(pattern + '$' + text). O(n+m).
  • Rabin-Karp: rolling polynomial hash — hash(s[i..i+m]) computed from previous in O(1). Average O(n+m), worst O(nm). Watch for hash collisions — use double hashing.
  • Manacher's algorithm: longest palindromic substring in O(n). Dense material — know when to reach for it.
  • Suffix array (concept): all suffixes of a string sorted. Enables pattern search + LCP array. O(n log n) construction.
  • Trie with XOR: max XOR pair in array — insert bits in trie, greedily pick opposite bit at each level.
  • Aho-Corasick (concept): multiple-pattern matching. Trie + failure links. Used in grep, antivirus.
Product-company bar: you won't get a KMP-from-scratch question, but rolling hash and trie-with-XOR come up at Amazon, Flipkart, PhonePe. Know the idea cold.
Aptitude · 1 hr · Verbal Ability Deep Dive
  • Reading Comprehension: 2 long passages, 5 Qs each. Technique: read first and last paragraph, then skim middle.
  • Para-jumbles: identify opening (pronouns refer to nothing prior) and closing (conclusion words).
  • Sentence correction: scan for subject-verb, tense, parallelism, modifier placement.
  • Synonyms/antonyms: eliminate 2 obviously wrong; pick from remaining 2 by context.
  • Error spotting: one-of-four-parts contains an error. Check tenses + prepositions first.
  • Fill in the blanks: look for connecting words (however, moreover, despite) — they signal relationship between clauses.
MERN · 1 hr · Redis & Caching in Express
  • Redis data types: String, Hash, List, Set, Sorted Set, Stream. Each has its sweet spot.
  • Cache-aside: read cache → miss → DB → set cache with TTL. Standard pattern.
  • Session store: express-session + connect-redis. Stateless app servers.
  • Rate limiter: Redis INCR with TTL — atomic + fast. Lua script for sliding-window exactness.
  • Pub/Sub: Redis PUBLISH/SUBSCRIBE — good for Socket.io scaling across nodes.
  • Cache invalidation: TTL (lazy) + key pattern delete on writes (proactive). "There are only two hard things in CS..."
  • Task: add Redis to notes-api — cache GET /notes/:id with 5-min TTL, bust on PUT/DELETE.
Interview Q&A · 1 hr · Pseudocode + Service-Based Bar
Service companies (TCS/Infosys/Wipro/HCL/Accenture) test pseudocode + basic DSA. Product companies expect actual runnable code. Know both registers.
What is pseudocode? How does it differ from actual code?
Language-agnostic step-by-step algorithm. Uses English + math notation. No syntax errors possible — just logic. TCS NQT uses it specifically to test algorithm thinking.
Differentiator: "In TCS NQT, pseudocode Qs give 5-line snippets and ask 'what does this print.' Practice tracing variable values on paper."
Example: FOR i = 1 TO n: IF a[i] > max: max = a[i]. Trace with a={3,1,4,1,5,9,2}.
Mistake: treating pseudocode like Python — missing the FOR/WHILE/IF format service companies expect.
Trace this: x=5, y=0; while(x>0){y+=x; x-=2;} — final y?
Iter 1: y=5, x=3. Iter 2: y=8, x=1. Iter 3: y=9, x=-1. Loop ends. y=9.
Differentiator: write a 2-column table (x, y) as you trace. Faster + error-proof for OAs.
Example: similar pattern asked in Infosys, Cognizant online tests.
Mistake: mental arithmetic → off-by-one errors.
Write pseudocode for "second largest element in an array."
Track firstMax, secondMax. For each x: if x > firstMax → secondMax=firstMax, firstMax=x. Else if x > secondMax and x < firstMax → secondMax=x.
Differentiator: handle the "all-same" edge case — if no second distinct element exists, report. Also handle arrays with n<2.
Example: one pass, O(n) time, O(1) space.
Mistake: sorting and picking arr[n-2] — O(n log n), often disallowed.
Service-based HR: "Are you open to relocation? Bench? Night shifts?"
"Yes, I understand the nature of the industry. I'm open to relocation and flexible on shifts initially. I'd love to get on a project quickly."
Differentiator: service companies value fit more than skill. Show flexibility + willingness to learn their tech (even COBOL/SAP if needed).
Example: "I've been preparing on MERN, but I'm open to whichever stack my project needs."
Mistake: "I only want a specific tech stack" — instant reject at a service company.
Service-based: "Why TCS/Infosys and not a startup?"
Scale + training + exposure to enterprise systems. Career structure. Client variety. Mention actual programs (TCS Digital, Infosys DSE track).
Differentiator: reference the Ignite / Mysore training program — shows you researched.
Example: "TCS's Digital offer lets me work on live client systems from day 1."
Mistake: generic "good company" answer.
Product-based: "What's the difference in engineering culture vs a service company?"
Product: own the problem + system end to end, ship to users, impact = metrics. Service: delivery to client specs, tight timelines, multi-domain exposure.
Differentiator: "I'm applying to both because I value the technical depth of product work and the variety of service. My preference is product, but I'm pragmatic."
Example: Razorpay engineers own fraud detection end to end; TCS engineers build on client's SAP instance.
Mistake: dissing either — the interviewer may have come from the other side.
Rolling hash — when do you actually use it?
Substring search (Rabin-Karp), longest duplicate substring (binary search + RK), detecting plagiarism/near-duplicates (shingling), avoiding O(nm) in naive string problems.
Differentiator: "Use two independent hashes (mod p1, mod p2) to keep collision probability vanishingly small."
Example: Git's object storage uses SHA-1 content-hashing.
Mistake: single hash with small mod → birthday collisions.
Trie — where would you build one in production?
Autocomplete, T9-style input, IP routing tables (radix trie), spell check, contact search prefix.
Differentiator: "For very large dictionaries — use compressed tries (radix trees) or DAWGs to save memory."
Example: iPhone keyboard suggestions use a compressed trie + ML re-ranking.
Mistake: building a trie when a plain hashmap of prefixes works for small n.
23

Segment Trees & Range Queries

Tuesday, May 12

DSAAptiMERNInterview
DSA · 2 hrs · Range Query Data Structures
  • Segment tree: complete binary tree over array ranges. Build O(n), range query + point update O(log n). Space 4n.
  • Lazy propagation: for range updates — defer updates until a query reaches that node. Range update becomes O(log n).
  • Fenwick tree (BIT): simpler + less memory than segment tree. Prefix sum + point update, both O(log n). Uses i & -i bit trick.
  • Sparse table: idempotent range queries (min/max/gcd) in O(1) after O(n log n) preprocess. No updates.
  • Square root decomposition: divide into √n blocks. Query/update O(√n). Simpler than segment tree for offline problems.
  • Merge sort tree: segment tree where each node stores sorted subrange — for "count in range < k" queries.
  • Order statistic tree (C++ PBDS): supports rank + find_by_order in O(log n).
Reality check: segment trees rarely come up in standard placement interviews. They appear at Codeforces-grade competitive shops (Google, D.E. Shaw, Quadeye, Goldman) and in research-y coding rounds. Worth one read-through, not cramming.
Aptitude · 1 hr · Non-Verbal Reasoning + Data Sufficiency
  • Non-verbal: figure series, mirror images, paper folding, cube counting. Pattern recognition, not formulas.
  • Data sufficiency: "is statement(s) enough to answer?" — mark A (1 alone), B (2 alone), C (both together), D (either), E (neither).
  • DS trick: NEVER compute the final answer. Just check if you could compute it.
  • Figure series: track rotation (CW/CCW), reflection, element count, shading.
  • Cube problems: formula for painted cubes — 3-face (corners=8), 2-face (edges=12(n-2)), 1-face (faces=6(n-2)²), 0-face (inside=(n-2)³).
MERN · 1 hr · GraphQL (REST Alternative)
  • Why GraphQL: client specifies exactly what fields it needs. Eliminates over-fetching (REST) and under-fetching (multiple round-trips).
  • Schema: typed — Query, Mutation, Subscription root types. Fields have resolvers.
  • Resolvers: functions returning data for each field. Can call DB, other services, etc.
  • N+1 problem: naive resolvers query DB per item → use DataLoader for batching.
  • Apollo Server: most common Node.js impl. apollo-server-express for Express integration.
  • Tradeoff: great for mobile/complex frontends. Overkill for simple CRUD apps. REST still wins on simplicity + caching.
Interview Q&A · 1 hr · Hard System Design + Product Company Bar
Design Twitter feed — deep dive on timeline generation.
Hybrid: fanout-on-write for regular users (push tweet into followers' inboxes in Redis). Fanout-on-read for celebrities (pulled at read time). Merge at feed request.
Differentiator: "Celeb threshold ~10K followers. Inbox stored as Redis ZSET by timestamp. Trim to last 800 tweets. Async worker handles fanout."
Example: Twitter's actual architecture (public talks by Raffi Krikorian).
Mistake: pure fanout-on-write — crushes DB for celebrities with 100M followers.
Design a distributed cache (like Memcached/Redis Cluster).
Consistent hashing ring → shard by key. Replication for HA (primary-replica). Eviction policy (LRU/LFU). Client library handles resharding on node join/leave.
Differentiator: "Redis Cluster uses hash slots (16384) — keys map to slots, slots map to nodes. Adds flexibility over raw consistent hashing."
Example: Redis Cluster, ElastiCache, Aerospike.
Mistake: ignoring cache coherency when multiple writers.
Design an autocomplete system at scale.
Trie of top queries + frequencies. Build offline from query logs. Replicate to edge servers. Client sends prefix → gets top N.
Differentiator: "Update trie async via MapReduce on query logs (hourly/daily). Personalization layer re-ranks top-N. Also: LSM-like merge for rolling top-K."
Example: Google, YouTube, Amazon Search.
Mistake: building the trie live on every request.
Design a file storage service (Dropbox/Google Drive).
Client chunks file → uploads to blob store (S3). Metadata DB (file tree, ACL, versions). Delta sync for updates. CDN for read. End-to-end encryption optional.
Differentiator: "Chunking gives resumable uploads + dedup. Content-addressable storage — hash each chunk, store once even if N users upload same file."
Example: S3 + DynamoDB for metadata + CloudFront.
Mistake: storing files in DB as blobs.
Design a news feed ranking pipeline.
Event ingestion (Kafka) → feature store → ML model (logistic regression or deep net) → ranked candidates → cache per user. Online learning via feedback loop.
Differentiator: "Two-stage retrieval: recall (fast, wide) → re-rank (slow, accurate, few items). Cold-start fallback is content-based."
Example: Facebook News Feed, Instagram Reels.
Mistake: chronological-only feed at scale — engagement tanks.
How do you handle DB migrations at scale without downtime?
Expand-then-contract: (1) add new column nullable, (2) dual-write from app, (3) backfill, (4) switch reads, (5) stop writes to old, (6) drop old column.
Differentiator: "Never break backward compat in a single deploy. Use feature flags. Run migrations outside business hours for heavy ones."
Example: gh-ost / pt-online-schema-change for MySQL.
Mistake: ALTER TABLE on a 1B-row live MySQL = outage.
What's your approach to debugging a slow API in production?
(1) Quantify — p50/p95/p99 from APM. (2) Trace — distributed tracing to find slow segment. (3) Isolate — DB? External API? CPU? (4) Fix the hot spot, not guess.
Differentiator: "Look at p99, not avg — averages hide the long tail where users suffer. One slow dep in the critical path kills perceived perf."
Example: Datadog/New Relic traces showing DB query taking 2s.
Mistake: adding indexes blindly without checking the plan.
Explain database replication lag — why it happens, how to handle.
Async replication means replicas apply writes after primary. Under load, lag grows. Reads on replica → stale data. Fix: route critical reads to primary, or use synchronous/semi-sync replication for important tables.
Differentiator: "User-after-write anomaly — user creates post, refreshes, it's gone. Fix with 'read your writes' — pin user's reads to primary for 30s after their write."
Example: MySQL async default; Postgres supports sync replicas.
Mistake: treating replicas as equivalent to primary.
24

Advanced Graphs & DP

Wednesday, May 13

DSAAptiMERNInterview
DSA · 2 hrs · Advanced Graph + DP
  • Strongly Connected Components (SCC): Kosaraju — 2 DFS passes (original + transpose). Tarjan — single DFS with low-link.
  • Articulation points & bridges: Tarjan's — disc[] + low[]. Bridge: low[v] > disc[u]. AP: child with low ≥ disc OR root with >1 child.
  • Minimum Spanning Tree: Kruskal — sort edges + DSU (skip cycles). Prim — min-heap from start vertex. Both O(E log V).
  • Bellman-Ford: V-1 passes relax all edges. Vth pass detects negative cycle. O(VE).
  • 0-1 BFS: deque — edge weight 0 push front, 1 push back. O(V+E).
  • DP on trees: compute answer per subtree bottom-up. Re-rooting for all-node queries.
  • Bitmask DP (TSP): dp[mask][u] = min cost visiting set mask, ending at u. O(n²·2ⁿ).
  • Digit DP: count numbers in [L,R] satisfying a property. State: position + tight flag + extra constraints.
  • Matrix exponentiation: compute Fibonacci / linear recurrences in O(log n) via matrix^n.
Aptitude · 1 hr · Hard Mixed Mock (60-Q)
  • Simulate: 60 questions, 60 min, full quant + logical + verbal. TCS Ninja + Digital level.
  • Review discipline: on every miss, write the method you'll use next time, not just the answer.
  • Pattern tracking: which topics eat your time? Re-drill those.
MERN · 1 hr · SQL Mastery Sprint
  • LeetCode SQL 50: 30 min — solve 8-10 straight. JOINs, aggregates, window fns, CTEs.
  • Subquery vs CTE: CTE is readable; optimizer often treats them the same.
  • Indexes mental model: B+ tree. Composite index follows left-prefix. Covering index = query served from index alone.
  • Explain plans: read EXPLAIN output in Postgres/MySQL. Look for seq scans on large tables, mis-joins, filesort.
  • Common tasks: Nth highest, running total, rank within group, find gaps, pivot rows.
  • NoSQL parallel: MongoDB aggregation pipeline = SQL GROUP BY + JOIN.
Interview Q&A · 1 hr · Advanced LLD + Concurrency
Design a thread-safe Singleton in Java.
Best: enum singleton. Alternative: double-checked locking with volatile: if(instance==null){ synchronized(Class){ if(instance==null) instance=new X(); }}.
Differentiator: "Enum handles serialization + reflection attacks for free. DCL only works correctly with volatile since Java 5 (JMM fix)."
Example: Joshua Bloch's Effective Java item 3.
Mistake: DCL without volatile — broken due to instruction reordering.
Design a bounded blocking queue.
ReentrantLock + two Conditions (notFull, notEmpty). put: wait on notFull, add, signal notEmpty. take: wait on notEmpty, remove, signal notFull.
Differentiator: "Java has ArrayBlockingQueue built-in. Implementing it is a popular LLD question because it tests all primitive concurrency skills."
Example: LC #1188.
Mistake: using if instead of while to check — spurious wakeups will break you.
Design a Rate Limiter class (token bucket).
Fields: capacity, tokens, refillRate, lastRefillTime. allow(): refill based on elapsed time, if tokens ≥ 1 consume + return true, else false.
Differentiator: "Make it thread-safe with synchronized or use AtomicLong with CAS for lock-free. Distributed? Redis + Lua for atomicity."
Example: Guava's RateLimiter.
Mistake: naive sleep-based throttling — blocks caller thread.
Design an in-memory Key-Value store with TTL.
HashMap<K, Entry<V, expireAt>> + background cleanup thread OR lazy expiry on access. For at-scale: delay queue + eviction policy (LRU).
Differentiator: "Redis uses both: passive (on access) + active (random sample ~20 keys, evict expired). Balances CPU vs memory staleness."
Example: Caffeine for Java in-process cache.
Mistake: only doing lazy expiry — memory fills with dead keys nobody reads.
Design a Chess game (object model).
Board (8x8 Square[][]), Piece (abstract; King/Queen/Rook/Bishop/Knight/Pawn extend). Each piece has its own valid-move logic. Game class with turn, history, check detection.
Differentiator: "Strategy pattern for move validation per piece. Command pattern for move history → undo. Observer for UI updates."
Example: classic LLD interview at Uber, Oracle.
Mistake: giant switch in Piece.isValidMove — anti-OO.
Design an Event Emitter (pub/sub).
Map<String, List<Callback>>. on(event, cb) adds. emit(event, data) iterates and calls. off(event, cb) removes. once(event, cb) wraps.
Differentiator: "Thread-safe version: CopyOnWriteArrayList for listeners, or explicit lock. Also: memory leak from forgotten listeners — weak refs mitigate."
Example: Node's EventEmitter.
Mistake: mutating listener list during emit → ConcurrentModificationException.
Design Card Deck + Shuffle.
Enum Suit + Rank. Card = {suit, rank}. Deck: List<Card>. Shuffle: Fisher-Yates (uniform random in O(n)).
Differentiator: "Collections.shuffle uses Fisher-Yates. For crypto-grade (poker app) use SecureRandom."
Example: common opener Qs at gaming companies.
Mistake: Math.random() < 0.5 sort — biased, wrong.
Design a Bank Account class — concurrency edge cases?
Synchronize deposit/withdraw. Transfer between accounts needs lock on BOTH → risk deadlock. Fix: always acquire locks in deterministic order (by account id).
Differentiator: "In real systems, don't use in-memory locks — use DB row locks + transactions. SELECT FOR UPDATE or optimistic concurrency with version column."
Example: classic interview at Goldman, Morgan Stanley.
Mistake: forgetting the ordering rule → intermittent deadlock.
25

Full Mock Sprint + Capstone Polish

Thursday, May 14

MockAptiCapstoneDeep Mock
DSA · 2 hrs · Timed Contest Simulation
  • LeetCode Weekly-style: 4 problems, 90 minutes, no hints. Difficulty: easy-medium-medium-hard.
  • Alternatively: participate in an actual LC Weekly Contest if schedule aligns.
  • Post-contest: upsolve problems you couldn't finish. Time each.
  • Discipline: no Googling mid-contest. Treat it like the real thing.
  • Then: 30 min of typing speed drill — retype 5 solved problems. Muscle memory matters in 60-min OAs.
Aptitude · 45 min · Company-targeted Warm-up
  • Pick your actual interview target. Do that company's specific paper (PrepInsta has them all).
  • Don't study new topics. Only review your wrongs log.
MERN · 1 hr · Capstone Polish — "Wow Layer"
  • Pick ONE upgrade that takes you from "student project" to "hireable":
  • Option A — Search & filters: add full-text search (MongoDB text index or Meilisearch) with UI filters.
  • Option B — Real-time: add Socket.io for live updates (notes shared live, collab cursor).
  • Option C — AI feature: integrate Claude API — "summarize this note", "suggest tags". Demonstrates modern stack fluency.
  • Option D — Performance: add Redis cache + show before/after latency numbers. Interview-ready talking point.
  • Document it: before → after metric. Commit message with reasoning. Update README.
Full Interview Simulation · 90 min
Record. Watch it back. This is the closest thing to the real call.
Section 1 · DSA Round (45 min)
One medium + one hard. Write in your committed language. Narrate. State complexity. Test with edge cases. Finish with "what would change if input were 10× larger?"
Differentiator: don't optimize before solving. Ship brute-force, then ask "is this good enough given constraints?" — often it is, and you save time.
Example: LC 146 LRU Cache + LC 239 Sliding Window Max.
Mistake: hunting for the optimal on a medium when brute force clears constraints.
Section 2 · System Design (25 min)
Pick: Instagram / Uber / WhatsApp / Tiny URL / Rate Limiter. Requirements → APIs → data model → high-level diagram → 1-2 deep dives → tradeoffs.
Differentiator: quantify throughout. "1M DAU × 10 posts = 10M/day = 115 QPS avg, ~1K peak."
Example: ByteByteGo's templates are the model.
Mistake: jumping into database choice without listing requirements.
Section 3 · Project + Behavioral (20 min)
Walk capstone end-to-end. Explain tech choices. Describe hardest bug + how you fixed it. One STAR behavioral story (failure or conflict).
Differentiator: defend every tech choice. "Why Mongo not Postgres?" — have the 2-line answer.
Example: "I picked Mongo for schema flexibility — the notes structure evolved weekly."
Mistake: "it was in the tutorial I followed."
Self-review checklist (hard).
Watch recording. For each section: did you clarify? State complexity unprompted? Pause when stuck? Stay calm? Close with a good question?
Differentiator: score yourself on each. The sections where you lose points are your top fix targets for tomorrow.
Example: common fixes — filler words ("like", "um"), not thinking aloud, failing to test code.
Mistake: skipping the review because it's painful.
26

Launch — Offer Strategy & Career Toolkit

Friday, May 15

LaunchDeployFinal
Morning · 1 hr · Wrongs Log Re-read + Warmup
  • Solve 3 easy problems from any topic. Confidence, not grind.
  • Re-read your full wrongs log top to bottom. This is where your real edge lives.
  • Print the Framework cheat sheet + Interview Day Routine. Have physical copies.
Mid-day · 1 hr · Portfolio Final Audit
  • Click every link on resume + portfolio + LinkedIn. Each must load + work.
  • Record 90-sec Loom demoing capstone. Attach to resume & LinkedIn.
  • README upgrade: screenshots, architecture diagram, setup + deploy link, live demo button.
  • Resume ATS check: run through Jobscan or a free ATS scorer against a target JD.
Afternoon · 3 hrs · Career Launch Sprint
Referral outreach — send 10 today.
LinkedIn search for alumni at target companies. DM template: (1) mutual context, (2) what you want, (3) attached resume, (4) ask lightly. Short.
Differentiator: personalize 1 line per DM. "Saw you were on the payments team — would love your take on..." Mass-copy DMs get ignored.
Example: see Toolkit → Referral DM template.
Mistake: attaching resume PDF on cold first message — instant spam flag.
Apply to 20 positions — structured.
Split: 10 product companies (Flipkart, Razorpay, Zoho, Freshworks, PhonePe, Swiggy, etc.) + 10 service companies (TCS, Infosys, Wipro, CTS, Accenture, HCL, Capgemini).
Differentiator: tailor resume keywords to each JD. 10 min/application is plenty.
Example: maintain a Notion table: company, role, date applied, referred by, status, next action.
Mistake: blasting generic resume to 100 companies.
Negotiation rehearsal.
Practice: "Thanks for the offer. Based on market data and my skill set, I was targeting X. Is there flexibility on the base or the joining bonus?" — 2 minute rehearsal, 5 times out loud.
Differentiator: never accept on the call. "Can I get back to you by tomorrow with my decision?" — always say yes.
Example: written offer > verbal. Get everything in email.
Mistake: oversharing that you have no competing offers.
Set up tracking system.
Notion/Airtable/sheet — one row per application. Columns: company, role, applied date, source, status, interview dates, outcome, notes.
Differentiator: track response rate. If < 5% replies, your resume/outreach needs a tune-up, not more volume.
Example: 50 applications ~= 5-15 first interviews typically.
Mistake: applying without tracking — you'll forget who you DM'd and spam them twice.
The final reframe.
You've done in 26 days what most people do in 3 months. Your job now is volume + follow-through, not more prep. Every rejection teaches one thing — note it and move.
Differentiator: the first offer is rarely your best offer. Keep interviewing even after signing — use competing offers to negotiate.
Example: typical fresher pipeline — 50 applied → 10 first rounds → 4 full loops → 1-2 offers.
Mistake: stopping after first reject.
Last word, Harsha. 🚀
You built a capstone, solved 200+ problems, rehearsed 220+ Q&A, did multiple mocks. Most candidates wing it. You prepared. The rest is noise + luck + numbers. Go collect the offer.
Differentiator: keep the wrongs log alive post-offer. Junior devs who keep learning become senior devs fast.
Example: your capstone + this sprint → 3-year head start over peers who only did coursework.
Mistake: treating the offer as the finish line. It's the start.
The Interview Answering Framework
Frameworks > Memorization. These cheat sheets are for before-interview review and during-interview thinking.

The Universal Answering Framework

For Any Interview Question
  • 1 · Clarify: restate the question. Ask 1-2 clarifying questions. Shows you listen.
  • 2 · Answer in 1 sentence. Lead with the punch line. Then justify.
  • 3 · Give an example. Concrete beats abstract. A code snippet, a real system, a past project.
  • 4 · State a tradeoff. "This is better for X, worse for Y." Shows judgement.
  • 5 · Acknowledge what you don't know. "I haven't used Z, but I'd expect it to behave like Y."
Senior dev signal: junior answers list facts. Senior answers present tradeoffs + name the context. Always say "it depends" — then justify the choice.
For Coding Questions (DSA)
  • 1 · Clarify: input size, constraints, edge cases (empty, single, duplicates, negatives).
  • 2 · Brute force: state it aloud with complexity. "Naive is O(n²)..."
  • 3 · Optimize: spot the redundancy. Name the pattern. State new complexity.
  • 4 · Dry-run: walk through the sample input step by step. Interviewer sees your logic.
  • 5 · Code: clean names, guard clauses up top, return types consistent.
  • 6 · Test: 1 normal + 1 edge case. Trace by hand.

Pattern Recognition — Problem Signals

Array / String Signals
  • "Max/min subarray of size k" → Fixed sliding window
  • "Longest substring with condition" → Variable sliding window
  • "Find pair summing to X" → HashMap (unsorted) or Two Pointer (sorted)
  • "Range sum queries" → Prefix sum
  • "Max contiguous subarray sum" → Kadane's
  • "Next greater element" → Monotonic stack
  • "Is anagram/permutation" → Frequency map compare
  • "Palindromic substring" → Expand from center
  • "Search in sorted/rotated" → Modified binary search
Tree, Graph & DP Signals
  • "Level-by-level" / "shortest unweighted" → BFS (queue)
  • "Max depth / diameter / path sum" → DFS bottom-up
  • "Valid BST" → DFS with min/max range constraints
  • "Shortest path weighted" → Dijkstra (non-negative) / Bellman-Ford
  • "Connected components / cycle" → DFS with visited, or Union-Find
  • "Topological order / course schedule" → Kahn's BFS or DFS post-order
  • "Min/max ways to reach X" → 1D DP
  • "Take or skip each element" → DP take/skip recurrence
  • "LCS / edit distance" → 2D DP on two strings
  • "Interval scheduling" → Greedy sort by end time

Aptitude Formula Arsenal

Quantitative
  • HCF/LCM: gcd(a,b)=gcd(b,a%b). LCM = a·b/HCF.
  • %: x% of y = xy/100. % change = (new−old)/old·100. Successive: multiply factors.
  • P&L: P% on CP. SP = CP(1+P/100). Two discounts: 1−(1−d₁)(1−d₂).
  • SI & CI: SI = PNR/100. CI = P(1+R/100)ⁿ − P. CI−SI(2y) = P(R/100)².
  • Speed: D=ST. km/h↔m/s: ×5/18 / ×18/5. Avg = 2s₁s₂/(s₁+s₂).
  • Work: combined = 1/A + 1/B. Time = AB/(A+B).
  • P&C: nPr = n!/(n−r)!. nCr = n!/r!(n−r)!.
  • Probability: P(A∪B)=P(A)+P(B)−P(A∩B). Complement for "at least 1".
Logical Reasoning
  • Syllogism: Venn diagrams always. Check every valid diagram.
  • Seating: template first. Most constrained first.
  • Series: arithmetic → geometric → diff-of-diff → squares/cubes → interleaved.
  • Directions: start North. Right = CW 90°. Distance = Pythag.
  • Blood relations: draw tree. One relationship per step.
  • Coding-decoding: find shift. Verify with 2 words.

Big-O & Data Structure Cheat Sheet

Complexity Classes
  • O(1): array[i], map get/put, push/pop.
  • O(log n): binary search, heap op, balanced BST.
  • O(n): single loop, prefix sum, HashMap scan.
  • O(n log n): sorting (merge/quick), sort + scan.
  • O(n²): nested loops, brute-force pairs.
  • O(2ⁿ): all subsets, naive recursion.
  • O(n!): all permutations.
Data Structure Ops
  • Array: access O(1); search/insert/del middle O(n); append amortized O(1).
  • HashMap: get/put/del O(1) avg, O(n) worst. Space O(n).
  • Stack/Queue: push/pop/enqueue/dequeue O(1).
  • Heap: insert/extract O(log n), peek O(1), build-heap O(n).
  • BST (balanced): search/insert/delete O(log n).
  • Trie: insert/search O(L). Space O(N·L·alphabet).
  • DSU (union-find): nearly O(1) amortized per op.
  • Graph BFS/DFS: O(V+E).

MERN Interview Cheat Sheet

Rapid Recall
  • Event loop phases: timers → pending → poll → check → close. Microtasks between.
  • React re-render triggers: state change, prop change, parent re-render, context change.
  • useEffect deps: [] once; [x] when x changes; none = every render.
  • JWT structure: header.payload.signature, base64-url. Signature prevents tampering.
  • CORS preflight: OPTIONS request for non-simple cross-origin.
  • Mongo indexes: default _id. Compound follows left-prefix rule.
  • Express middleware order: body parser → cors → auth → routes → error handler (4-arg).
  • HTTP status quick: 200/201/204/301/400/401/403/404/409/422/429/500/503.

Behavioral — STAR Templates

STAR in 90 seconds
  • S (Situation) · 15s: scope the context. Who, when, what project.
  • T (Task) · 15s: your specific role + goal.
  • A (Action) · 40s: what YOU did. Decisions, tradeoffs, tools. The meat.
  • R (Result) · 20s: outcome with numbers. Lesson learned if failure.
Prep 5 stories: (1) technical challenge, (2) team conflict, (3) leadership/initiative, (4) failure, (5) learning something new. Rehearse out loud until under 2 min.
The Career Toolkit — Templates, Rules, Scripts
Everything the daily plan references. Print these. Bookmark them. Use them before every interview round.

Day 0 — Setup Before You Start

Pick ONE Language. Stick With It.
  • Java: verbose but interview-common. Rich stdlib (ArrayList, HashMap, PriorityQueue). Best for service-company OAs.
  • Python: concise, fastest to write. Best for speed on contests. Missing some features (no native ordered map).
  • C++: competitive-programming king. STL is powerful. Hard-mode unless you already know it.
  • JavaScript: fine if you're MERN-deep. Some interviewers push back — have a reason ready ("I'm strongest in JS and I can solve faster").
  • Decision rule: pick the language you're already fastest in. Don't learn one for interviews. Commit and build fluency.
Create These Files on Day 1
  • wrongs.md — every DSA miss, aptitude miss, interview Q miss. Entry format: topic · what tripped me · correct method · link.
  • stories.md — 5 STAR stories. Hardest bug, team conflict, failure + lesson, initiative, learning under pressure.
  • tradeoffs.md — running list of "we chose X because Y" for every project. Interview gold.
  • applications.csv — company, role, applied date, source, contact, status, notes.
  • mocks.md — every mock interview: date, score, 2 things to fix next time.
Daily Warmup Rule (5 min)
  • Before every day's DSA block: re-solve one random problem from 3+ days ago.
  • From memory. No peeking. If you can't finish in 10 min → that topic goes back in rotation.
  • Why it works: spaced repetition beats re-reading. The thing you relearn sticks for months.
  • Tool: Anki deck of problem names with approach notes.

Service-Based vs Product-Based — The Split

Service-Based (TCS, Infosys, Wipro, CTS, Accenture, HCL, Capgemini)
  • Selection process: Aptitude (quant + LR + verbal) → Pseudocode / basic coding → Technical interview → HR.
  • Bar: easy-to-medium DSA. Focus on basics done well (strings, arrays, loops, recursion).
  • Critical topics: OOP, DBMS basics, basic SQL, OS fundamentals, pseudocode tracing, English grammar.
  • HR expectations: flexibility (relocation, shifts, any tech stack), loyalty signals, genuine interest in the company.
  • Offers: TCS Digital ~₹7L, Infosys DSE ~₹6.5L, Wipro WILP ~₹3.5L, Accenture ASE ~₹4.5L. Negotiation minimal.
  • Win strategy: clear the paper. Don't overthink. Speak clearly. Don't over-engineer answers.
Product-Based (Flipkart, Razorpay, Zoho, Freshworks, PhonePe, Swiggy, Cred, Zeta)
  • Selection: Online coding assessment (2-3 medium-hard) → 2-4 tech rounds (DSA + DS-design + system design for senior) → HM round → HR.
  • Bar: LC-medium fluency. One LC-hard attempt. Clean code + complexity + testing.
  • Critical topics: everything + LLD + HLD + one deep project. Concurrency & distributed basics for better offers.
  • HR expectations: technical curiosity, ownership mindset, can defend choices, won't break under ambiguity.
  • Offers: ₹12–25L for freshers depending on tier. Negotiable. Joining bonus + ESOPs common.
  • Win strategy: depth over breadth. Have 1 project you can defend for 30 minutes. Know your language cold.
Startups + Mid-Stage (Uber India, Atlan, Postman, Chargebee, Hasura)
  • Bar is product-like but process varies. Often one take-home project + 2 interviews.
  • Extra signal: open-source contribution, side projects, blog posts.
  • Culture fit matters disproportionately: research the team, read engineering blog, reference it in HR.
  • Compensation: wide range. Cash lower, equity higher. Evaluate total comp.

Interview Day — Morning Routine

30-Min Pre-Interview Routine
  • T-120 min — Warmup: solve one LC easy. Just to feel sharp, not to learn.
  • T-60 min — Company research: refresh 2 facts about the company, check LinkedIn of interviewer, look at recent engineering blog post.
  • T-30 min — Environment: test wifi, mic, camera. Backup hotspot ready. Water on desk. Notebook + 2 pens. Phone silenced.
  • T-20 min — Mental prep: read your stories.md. Read top 5 entries from wrongs.md. Breathe.
  • T-10 min — Environment: lighting on your face, neutral background, camera at eye level. Good audio beats everything.
  • T-2 min — Join early. Show up 2 min before, not on the dot, not 5 min early.
Eat. Seriously — low blood sugar wrecks mid-interview thinking. Protein + carb ~60 min before. No caffeine overload.
During the Call — Physical
  • Camera on, always. Smile on first sight.
  • Mute when not speaking. Background noise = distraction.
  • Think aloud. Silence > 10 seconds → say "let me think about that" then narrate.
  • Ask clarifying questions. Shows engagement, buys thinking time.
  • Write on paper for DSA — saves screen real estate for code.
After the Call
  • Within 1 hour: write everything you remember in mocks.md. Questions, your answers, feedback, timing.
  • Within 24 hours: send thank-you email (template below).
  • Within 48 hours: if no update in a week, polite follow-up.

Email & LinkedIn Templates

Referral DM (LinkedIn) — Cold Ask
Hi [Name], I'm Harsha, final-year CSE at [College]. Saw you're on the [Team] team at [Company] — congrats on the [recent launch / blog post / promo], that was a great read. I'm targeting SDE roles and would love to apply to your team. If you think my profile is a fit ([1-line pitch of your top skill + project]), would you be open to a referral? Happy to share resume + GitHub if helpful. Totally fine if not — appreciate you reading this. — Harsha [portfolio link]
Rules: under 100 words. 1 specific compliment. 1 concrete ask. Don't attach resume in first message. Don't send the same copy-paste to 50 people.
Thank-You Email (Post-Interview)
Subject: Thanks — [Your Name], [Role] Interview Hi [Interviewer], Thanks for your time today. I really enjoyed digging into [specific topic you discussed — e.g., the rate-limiter question / their observability stack]. [One sentence showing you learned something or thought more about it afterward.] Excited about the possibility of joining [Team/Company]. Please let me know if you need anything else from my side. Best, Harsha
Follow-Up After Silence (1 week)
Subject: Re: [Role] interview — quick check-in Hi [Recruiter], Just checking in on the [Role] position. I remain very interested and wanted to see if there's an update or anything else you need from me. Thanks, Harsha
Cadence: one follow-up per week. Max 2. After that, move on — but leave the door open.
Cold Application Email
Subject: SDE Application — [Your Name], [Uni] Hi [Hiring Manager / Recruiter], I'm Harsha, final-year CSE student at [Uni]. I'm applying for [Role at Company]. In short: [1 line about top strength]. I recently built [capstone] — [1-line description + 1 concrete metric]. Code: [GitHub link]. Live: [deploy link]. I'd love 15 minutes to learn more about the role. Resume attached. Thanks for your time. Harsha

Offer Negotiation — Scripts & Rules

Golden Rules
  • 1 · Never accept on the call. "Thanks so much — this is exciting. Can I take until [date] to review and get back?"
  • 2 · Get it in writing. Total comp: base, bonus, joining bonus, ESOPs (with vesting + strike), relocation, variable pay.
  • 3 · Research before negotiating. Levels.fyi, AmbitionBox, Glassdoor. Know the ±20% band for the role and company.
  • 4 · Negotiate once, cleanly. Don't go back twice. Give a number or range and explain why.
  • 5 · Competing offers are leverage. Mention them truthfully. Don't fabricate.
  • 6 · Be polite but firm. "I'm really keen to join — is there flexibility on X?"
Script — Asking For More
"Thank you for the offer — I'm really excited about the team and the product. Based on the market data I've gathered for this role and the skills I bring ([briefly: your capstone / competing offer / LC profile / GitHub]), I was hoping for a total comp closer to [X]. Is there flexibility on the base, the joining bonus, or the ESOP grant?"
Shut up after asking. Silence is uncomfortable but they're working the phones. Let them come back with a number.
Script — Competing Offer
"Quick update — I have another offer from [Company] at [range]. I strongly prefer [your company] because [genuine reason]. If you can come closer to [target number], I'd commit today."
What to Negotiate (Ranked)
  • 1 · Base salary (affects everything else + future raises).
  • 2 · Joining bonus (easiest for them to flex).
  • 3 · ESOP/RSU grant size or vesting acceleration.
  • 4 · Start date (if you need time).
  • 5 · Role / team placement if pre-allocation is possible.
  • Avoid negotiating benefits. They're fixed and it signals you missed the point.

Open Source & GitHub Green Squares

Why It Matters
  • Green GitHub graph signals consistency — recruiters skim. A dense graph beats a flat one.
  • One merged OSS PR on your resume beats three more toy projects. Means you navigated real code + review.
  • Good first PRs are often docs fixes — that's fine. Don't overthink the first one.
Starter Projects
  • First-timers-only: firsttimersonly.com — curated beginner issues.
  • MERN-friendly: Strapi, Excalidraw, TanStack Query, Chakra UI, Next.js docs.
  • Indian OSS: Appsmith, Hasura, Postman learning center. Good vibes, lots of mentors.
  • Small & approachable: typeshed (Python types), DefinitelyTyped (TS types), MDN docs.
Realistic Cadence
  • 15 min/day on GitHub: commit to your own repo, comment on OSS issue, or review a PR.
  • 1 OSS contribution/month is plenty. Don't force it to fit a narrative.
  • Pin your top 3 repos on profile. Each has a README with screenshot, stack, deploy link.

LC Contests + Weekly Speed Drill

Why Contests
  • Timed + unseen problems — the exact interview skill that most prep misses.
  • LC Weekly Contest: Sundays 8am IST (90 min, 4 problems).
  • LC Biweekly: alternate Saturdays 8pm IST.
  • Codeforces Div 3/4 for easy-medium problems at speed.
How to Use Contests
  • Participate live even if you only finish 1-2. The rating isn't the point — the timer is.
  • Upsolve within 48 hours. Every problem you couldn't solve = learning.
  • Target: LeetCode rating 1700+ = solid for Indian product companies. 1900+ = strong signal for Flipkart/Swiggy/PhonePe.
Typing + IDE Speed
  • MonkeyType for general speed. Target: 60+ WPM comfortable.
  • LeetCode playground for language-specific practice — retype 5 solutions/day, muscle memory.
  • Keyboard shortcuts: learn your IDE's duplicate-line, multi-cursor, search, go-to-line. Saves minutes in a timed OA.

Sustainability — Health, Sleep, Routine

Rules
  • Sleep 7+ hrs. Non-negotiable. Tired debugging is slow debugging.
  • 20-min exercise daily. Walk, stretch, anything. Moves blood, clears head.
  • Social break: 1 meal/day eaten with family, not at the screen.
  • One full day off per week. Sunday afternoon = decompression, not study.
  • No screens 30 min before bed. Reading wrongs.md on phone is still screen.
The 5-Hour Day — Sample Split
  • 7:00 – 7:30: wake, 10-min warmup problem, coffee, breakfast.
  • 8:00 – 10:00: DSA (2 hrs — core focus block).
  • 10:00 – 10:30: break. Step outside.
  • 10:30 – 11:30: Aptitude (1 hr).
  • 12:30 – 1:30: MERN build time (1 hr).
  • 3:00 – 4:00: Interview Q&A (1 hr).
  • Evening: free. Recharge. Socialize. Walk.
Bank the wins. At day's end, write 1 line in a journal: "What did I learn today?" Small practice, big compounding.

Wrongs Log — Template

Format — one entry per miss
## [Date] · [Topic] · [Problem/Q name] **What I tried:** [your attempt — 1 line] **Where it broke:** [the specific step that was wrong / missing insight] **Correct approach:** [bullet points — the method that works] **Lesson:** [one-liner so future you doesn't repeat this] **Link:** [LC link or notes ref] ---
Read it once a week. Re-read the FULL log the night before any interview. The errors you've already made are the ones you're most likely to repeat.
Full 26-Day Overview
#DateDSAAptitudeMERNInterview Focus
Week 1 · Foundations
01Apr 20 MonArrays + Big-ONumbers, HCF/LCMJS & ES6OOP Pillars
02Apr 21 TueStrings + Sliding Window% + P&LNode.js & NPMOperating Systems
03Apr 22 WedHashing & HashMapRatio + MixtureExpress.jsDBMS / SQL
04Apr 23 ThuTwo Pointers + SortTime/Speed/DistMongoDBNetworks
05Apr 24 FriLinked ListsTime & WorkReact — JSXDSA Concepts
06Apr 25 SatStacks & QueuesSI/CIReact HooksBehavioral / HR
07Apr 26 SunRecursion + ReviewMixed MockExpress CRUDWeek 1 Mock
Week 2 · Intermediate
08Apr 27 MonBinary SearchP&CReact ContextOOP Advanced
09Apr 28 TueBacktrackingProbabilityREST API DesignSQL Deep Dive
10Apr 29 WedBinary TreesAverage + AgesJWT AuthOS + Concurrency
11Apr 30 ThuBST + HeapCalendar + ClockMongooseNetworks + Security
12May 1 FriGraphs — BFS/DFSLR SeriesSocket.ioSystem Design Basics
13May 2 SatGraphs — WeightedData InterpretationMiddleware + ValidationDistributed Systems
14May 3 SunDP 1DWeek 2 MockDeploymentBehavioral Round 2
Week 3 · Advanced + Mock Sprint
15May 4 MonDP 2D / GridBoats/Trains/RacesReact PerformanceTough DSA
16May 5 TueTries + StringsSyllogismsTesting — JestLow-Level Design
17May 6 WedGreedySeating + DirectionGit + Docker + CIHigh-Level Design
18May 7 ThuBit ManipulationVerbal + RCMicroservicesMERN Deep Dive
19May 8 FriReview — Arrays→Hash40-Q MockPortfolio + ResumeMock Interview 1
20May 9 SatReview — Tree/Graph/DPCompany MockFull-Stack WalkMock Interview 2
21May 10 SunLight RevisionWarm-up 15-QDeploy + ScreenshotsFinal Checklist
Final Sprint · May 11–15
22May 11 MonKMP · Z · Rolling Hash · TriesVerbal / RCRedis + CachingPseudocode + Service Bar
23May 12 TueSegment Tree · BIT · Sparse TableNon-Verbal + DSGraphQLHard System Design
24May 13 WedSCC · MST · Bitmask DP · Digit DP60-Q Hard MockSQL 50 SprintAdvanced LLD + Concurrency
25May 14 ThuTimed Contest (4 Qs, 90 min)Company-Target PaperCapstone "Wow" LayerFull 90-min Mock
26May 15 FriWarmup · Wrongs LogRestPortfolio Audit + LoomLaunch: 10 Referrals + 20 Apps
Resources + Practice Hubs
Curated list — no filler. Use these daily, not occasionally.

DSA Practice

  • NeetCode 150 neetcode.io — curated by pattern, with video explanations
  • LeetCode leetcode.com — company tags, daily problems, contests
  • HackerRank hackerrank.com/domains/algorithms — topic-wise
  • GeeksforGeeks geeksforgeeks.org — company-tagged problems + writeups
  • CodeChef / Codeforces for speed + contest reps

Aptitude

  • IndiaBix indiabix.com — daily 20Q per topic, mobile-friendly
  • PrepInsta prepinsta.com — TCS/Infosys/Wipro full mocks
  • Feel Free Apti (YT) solid shortcut tricks
  • HackerEarth AMCAT-style assessments

MERN Stack

  • javascript.info the best JS textbook, free
  • React Docs (new) react.dev — hook-first, excellent
  • Express Docs expressjs.com — small, canonical
  • MongoDB University learn.mongodb.com — free courses
  • FullStackOpen fullstackopen.com — free, end-to-end MERN
  • The Net Ninja (YT) crisp MERN tutorials

Interview Prep

  • Striver's Sheet takeuforward.org — DSA order
  • Grokking the Coding Interview educative.io — patterns
  • Designing Data-Intensive Applications Kleppmann — the system design book
  • ByteByteGo (YT) high-quality system design explainers
  • Exponent / Pramp free/cheap mock interviews

Resume + Portfolio

  • OverLeaf / Jake's CV clean LaTeX resume template
  • Vercel Portfolio Templates 1-hour deploy
  • Readme.so GitHub README builder
  • Excalidraw architecture diagrams for README
  • Loom 90-sec project demos

Daily Discipline Rules

  • Read constraints first Determines complexity target before approach
  • State brute force aloud Always, before optimizing
  • Name complexity unprompted "O(n log n) time, O(n) space because..."
  • Draw it LL/tree/graph — never in your head
  • Think aloud Silence is a red flag
  • Clarify before coding "Can input be negative? Duplicates OK?"
  • Edge cases first Empty, single element, overflow
  • Never "I don't know" Say "Let me think through it..."

Code Quality

  • Meaningful names maxSum not ms, leftPointer not l
  • Guard clauses at top null/empty checks before main logic
  • One function, one job Extract helpers when fn does two things
  • No magic numbers const ALPHABET_SIZE = 26
  • Consistent style Prettier + ESLint in every project

Mindset

  • Volume game Apply to 50+. Don't let rejects spiral.
  • Feedback ≠ worth Interviews measure fit in a 45-min slice. Not you.
  • Fix 2 things per mock Compound improvement beats cramming.
  • Rest matters Don't prep past 9pm the night before.
  • Negotiate First offer is rarely final. Be polite + firm.