Faang

57 articles

dsa6 min read

BFS and DFS on Graphs and Grids — The Complete Interview Guide

Master BFS and DFS on graphs and grids with the seven core patterns that show up in 90 percent of FAANG graph interviews. Learn flood fill, multi-source BFS, shortest path on unweighted graphs, and connected components with Python and JavaScript code.

Read →
dsa7 min read

Clone Graph — Deep Copy with BFS, DFS and HashMap Bookkeeping

Master Clone Graph (LeetCode 133): a FAANG favorite that tests BFS, DFS, graph traversal, hash map state, and cycle handling. We trace it step by step, derive the optimal pattern, and fortify you against the classic mistakes interviewers love to spot.

Read →
dsa6 min read

Mock Week 1 — Easy and Medium Problems with Communication Focus

Week 1 of the FAANG mock interview program pairs easy and medium problems from arrays and trees. The goal is not ceiling testing — it is installing the think-aloud habits that distinguish passing candidates before difficulty ramps up in week 2.

Read →
dsa6 min read

Mock Week 2 — Medium Problems with an Optimization Round

Week 2 of the FAANG mock program pairs Number of Islands and Longest Increasing Subsequence. Solve each correctly, then deliver one optimization upgrade and handle a live follow-up question — the pattern that separates "passes" from "strong hire" ratings.

Read →
dsa7 min read

Mock Week 3 — Hard Problems Under Time Pressure

Week 3 of the FAANG mock program pairs Burst Balloons and Word Ladder II as hard problems under timed pressure. Learn the stuck-recovery protocol, the inversion insight, and why partial credit plus continuous communication beats silence every time.

Read →
dsa6 min read

Mock Week 5 — System Design and Coding Combined Session

Week 5 combines a 15-minute system design phase with a 30-minute coding implementation of one core component. This mirrors the senior-level interview format at Google, Meta, and Amazon where design breadth and implementation depth are tested together.

Read →
dsa6 min read

Time Management in Coding Interviews — The 45-Minute Breakdown

Exact time allocation for a 45-minute FAANG coding interview covering one hard problem or two mediums. Includes the five common time traps, a stuck-recovery escalation protocol, and the 5-minute warning procedure that protects your score when you run out of time.

Read →
dsa6 min read

Behavioral Interview STAR Framework — Stories with Technical Depth

Master the STAR method for FAANG behavioral interviews. Covers the 10 must-prepare stories, how to connect technical decisions to measurable outcomes, answer length guidelines by interview type, and the red flags that cost candidates offers at the behavioral stage.

Read →
dsa6 min read

Amazon Leadership Principles — DSA Interview Alignment Guide

Map Amazon's 16 Leadership Principles to coding and behavioral interview behaviors. Includes the LP-to-question mapping, how to weave LP language naturally into technical explanations, the Bar Raiser format, and a per-LP preparation template.

Read →
dsa7 min read

Final Week Preparation Guide — The 7-Day Interview Countdown

The complete 7-day countdown plan for the week before a FAANG coding interview. Daily focus areas, what to review, what to skip, how to peak on interview day, and a pre-interview checklist covering logistics, mindset, and warm-up protocol.

Read →
dsa7 min read

Word Search II — Trie + Backtracking on a Grid

LeetCode 212 — find every dictionary word hidden in a board. The optimal solution builds a trie over the words and DFS-traverses the grid once, pruning entire branches the moment the path leaves the trie. A textbook FAANG hard problem.

Read →
dsa6 min read

Replace Words — Trie for Shortest Root Replacement

LeetCode 648 — replace each word in a sentence with the shortest dictionary root that prefixes it. The trie walks one character at a time, returning the first isEnd we hit. A clean autocomplete-style problem.

Read →
dsa7 min read

Maximum XOR of Two Numbers in an Array — Binary Trie

LeetCode 421 — find the maximum XOR pair in an array of integers in O(N times 32) using a binary trie. The classic introduction to bit-trie pattern that powers competitive programming and database query optimisers.

Read →
dsa7 min read

Search Suggestions System — Trie Powered Autocomplete

LeetCode 1268 — return up to three lexicographically smallest products for every prefix of a search query. The trie autocomplete pattern that backs Google search, Amazon product search, and command palettes everywhere.

Read →
dsa7 min read

Prefix and Suffix Search — Combined Key Trie Trick

LeetCode 745 — design a structure that returns the highest-indexed word matching a given prefix and suffix. The combined-key trie inserts every (suffix#word) variant, turning a 2D query into a 1D trie walk.

Read →
dsa6 min read

Sum of Prefix Scores of Strings — Counted Trie Aggregation

LeetCode 2416 — for each word, sum the scores of all its non-empty prefixes where score = number of words sharing that prefix. The counted trie pattern aggregates O(N times L) work into O(N times L) trie nodes with a count counter.

Read →
dsa7 min read

Concatenated Words — Trie + Word Break DP

LeetCode 472 — find every word that can be formed by concatenating two or more shorter words from the same list. Trie accelerates the prefix-membership test inside a Word Break DP, turning O(2^L) brute force into O(N times L^2).

Read →
dsa7 min read

Short Encoding of Words — Reverse Trie Suffix Deduplication

LeetCode 820 — encode a list of words into the shortest reference string where each word appears as a suffix terminated by #. Build a trie of reversed words; only words at trie leaves contribute their length plus one to the answer.

Read →
dsa6 min read

Map Sum Pairs — Trie with Cumulative Sum Propagation

LeetCode 677 — design a structure supporting insert(key, value) and sum(prefix) returning the total of values for all keys with that prefix. The key trick is propagating delta sums along the trie path so prefix queries become a single O(L) walk.

Read →
dsa8 min read

Maximum XOR With an Element From Array — Offline Binary Trie

LeetCode 1707 — for each query (xi, mi), find max xi XOR nums[j] where nums[j] does not exceed mi. Sort queries by mi, sort nums, insert lazily into a binary trie, answer each query in O(32). The offline-trie pattern unlocks bounded XOR queries.

Read →
dsa7 min read

Find the Length of the Longest Common Prefix — Digit Trie

LeetCode 3043 — find the longest common prefix length between any number in arr1 and any number in arr2 (compared as digit strings). A digit trie of arr1 makes each arr2 lookup O(D) where D is the number of digits.

Read →
dsa6 min read

Count Distinct Substrings — Suffix Trie Node Counting

Count the number of distinct substrings of a string. The elegant trick: every substring is a prefix of some suffix, so a suffix trie has exactly one node per distinct non-empty substring. Count nodes during insertion in O(N^2).

Read →