Permutations: Backtracking With Used Array
Solve Permutations with backtracking and a used array. Compare swap-in-place vs used-array, walkthrough, complexity, and interview tips.
442 posts · page 7 of 10
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.
Solve Spiral Matrix with the four-boundary walk pattern. Clean implementation, edge cases for rectangles, complexity, and interview tips.
Generate all subsets of an array using backtracking and iterative bit-mask approaches. Includes complexity analysis and interview script.
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.
A practical guide to Go error handling: the error interface, sentinel values, custom types, wrapping with fmt.Errorf %w, and errors.Is and errors.As.
Learn Go concurrency from the ground up: launching goroutines, communicating via channels, using select, range, and building a worker pool pattern.
A practical tour of Go packages and modules: go mod init, imports, internal packages, semantic versioning, and the replace directive for local development.
A clear guide to Go structs and methods: literal forms, defining methods, choosing value vs pointer receivers, and using embedding for composition.
Pick the right Java collection by performance and semantics. ArrayList vs LinkedList, HashMap vs TreeMap, immutability, and iteration without surprises.
Use extends, super, and method overriding without painting yourself into a corner. When to inherit, when to compose, and how sealed types help.
Choose between interfaces and abstract classes with confidence. Default methods, sealed interfaces, functional interfaces, and concrete decision rules.
Transform collections with lambdas and the Stream API. Map, filter, reduce, collectors, parallel streams, and the pitfalls of lazy pipelines.
Learn Helm fundamentals: helm install, charts, values.yaml, templating, releases, and when to choose Helm over plain Kubernetes YAML manifests.
A practical guide to JavaScript closures, lexical scope, the classic loop bug, and the patterns that make closures genuinely useful in production code.
A modern guide to vanilla DOM manipulation: query selectors, creating and inserting nodes, event handling, delegation, and when a framework is actually worth it.
Build an accurate mental model of the JavaScript event loop, the call stack, web APIs, the task and microtask queues, and why setTimeout zero is not really zero.
A practical guide to the Fetch API: GET and POST requests, JSON, headers, error handling, AbortController, and the 4xx/5xx rejection gotcha that bites everyone.
Understand the JavaScript prototype chain, how Object.create works, what class syntax desugars to, and why this still matters in modern code.
Demystify the JavaScript this keyword with clear rules, arrow vs normal functions, bind/call/apply, class methods, and the bugs that catch every developer.
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.
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.
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.
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.