Letter Combinations of a Phone Number: Index Backtracking
Solve Letter Combinations of a Phone Number with backtracking. Mapping setup, recursive enumeration, complexity, and interview walkthrough.
442 posts · page 7 of 10
Solve Letter Combinations of a Phone Number with backtracking. Mapping setup, recursive enumeration, complexity, and interview walkthrough.
Solve Longest Consecutive Sequence in O(n) using a hash set and a start-of-run check. Walkthrough, edge cases, and interview script.
Longest Increasing Subsequence in detail — the O(n^2) DP, the O(n log n) patience-sorting trick with binary search, and when each one matters.
Walk through the Longest Palindromic Substring problem using the expand-around-center technique. Compare brute force, DP, and the optimal approach with examples.
Solve Longest Substring Without Repeating Characters using a sliding window with a hash map. We go from brute force to a clean O(n) sweep.
Why BST ordering collapses LCA into a one-line traversal, and the iterative version that needs zero extra space.
Design LRU Cache with a hash map and a doubly linked list to get O(1) get and put, with a clean implementation and interview tips.
Compute tree depth with a three-line recursive DFS and an iterative BFS alternative, with complexity analysis and interview tips.
A clear walkthrough of Maximum Subarray. We build Kadane's algorithm from first principles and contrast it with the divide and conquer approach.
Solve Merge Two Sorted Lists with the dummy-head pointer pattern, plus a recursive variant, edge cases, and interview explanation tips.
Design a stack that supports push, pop, top, and getMin in constant time. Walkthrough of the two-stack and pair-stack solutions with edge cases and interview tips.
Solve Number of Islands with grid DFS and BFS, including a union-find variant, edge-case handling, and clear interview talking points.
Why reverse traversal beats per-cell flood fill, and how the intersection of two reach sets gives the answer.
The DFS-with-decrement trick, why the leaf condition is the whole problem, and the variants that build on it.
Solve Permutations with backtracking and a used array. Compare swap-in-place vs used-array, walkthrough, complexity, and interview tips.
Solve Product of Array Except Self in O(n) without division using prefix and suffix passes. Clean walkthrough plus interview script.
Walk through Reverse Linked List with iterative pointer flipping and a clean recursive solution, plus complexity and interview talking points.
Rotate an n by n matrix 90 degrees in place by transposing and reversing each row. Walkthrough, edge cases, complexity, and interview script.
Solve Search in Rotated Sorted Array in O(log n) with modified binary search. Pivot detection, half-decision logic, and interview talking points.
The preorder-with-nulls encoding, the iterator-driven decoder, and why level-order is a worse choice than it looks.
Solve Sliding Window Maximum in O(n) using a monotonic deque. Step-by-step walkthrough, interview script, and complexity analysis.
Generate all subsets of an array using backtracking and iterative bit-mask approaches. Includes complexity analysis and interview script.
Solve Spiral Matrix with the four-boundary walk pattern. Clean implementation, edge cases for rectangles, complexity, and interview tips.
Solve Top K Frequent Elements with both a min-heap and a bucket sort approach. Trade-offs, complexity, and interview-ready walkthrough.
Solve Trapping Rain Water in linear time and constant space using the two-pointer technique. Brute force, optimal walkthrough, and interview talk track.
Unique Paths in two ways — the O(m * n) grid DP that interviewers expect and the binomial-coefficient closed form that surprises them.
A complete walkthrough of the Valid Anagram problem. Compare the sorting approach with the optimal hash map counting solution and learn how to explain it in interviews.
A clean walkthrough of Valid Parentheses with the optimal stack solution. Covers edge cases, complexity, and how to explain the approach in interviews.
The seductive wrong answer, the correct min/max bounds approach, and how to defend it in an interview.
Solve Word Break with bottom-up dynamic programming. Includes brute force, edge cases, complexity analysis, and an interview script.
The wildcard-pattern adjacency trick, why BFS is mandatory, and the bidirectional speedup.
The essential math toolkit for interviews: Euclidean GCD, sieve of Eratosthenes, modular exponentiation, modular inverses, and common pitfalls.
Learn segment trees for fast range sum, min, and max queries with point updates, including a clean iterative Python implementation.
Compare Kahn's BFS-based topological sort with DFS-based postorder, with Python implementations, complexity, and cycle detection.
Learn the union-find data structure with union by rank and path compression, why it runs in near-O(1) amortized, and how it powers Kruskal and islands.
Learn Helm fundamentals: helm install, charts, values.yaml, templating, releases, and when to choose Helm over plain Kubernetes YAML manifests.
Master scheduled tasks on Linux. Learn crontab syntax, fix common PATH and environment pitfalls, and use systemd timers as a modern alternative.
A practical guide to modern Linux networking tools. Learn ip, ss, curl, and dig to diagnose connectivity, inspect sockets, and resolve DNS issues fast.
A practical tour of the Anthropic Python SDK: messages, streaming, tool use, prompt caching, and patterns for shipping Claude in production.
Learn LangChain by building real components in Python: prompt templates, chains, tool calling, and memory. Practical patterns you can ship today.
A practical tutorial on text embeddings: vector intuition, calling an embeddings API, choosing dimensions, computing cosine similarity, and caching the results.
A working tour of the OpenAI Python SDK: chat completions, streaming, structured output, embeddings, tool calls, and production-grade error handling.
Learn how logistic regression turns a linear score into a probability, how to train it with scikit-learn, and how to evaluate binary classifiers using ROC-AUC.
Master the Next.js Metadata API with static and dynamic titles, OpenGraph tags, sitemaps, and robots.txt to ship pages that rank and share well.
Use pgvector to run embeddings, similarity search, and hybrid retrieval inside Postgres. Schemas, indexes, and a working Python pipeline.
Build a working vector search pipeline with Pinecone in Python. Indexes, upserts, metadata filters, hybrid search, and patterns for production RAG.
A practical introduction to Python asyncio: the event loop, async/await, asyncio.run, gather, create_task, and when to pick async over threads.
A practical introduction to Python regex with the re module: match, search, findall, sub, groups, named groups, raw strings, and compiling patterns for speed.