Language preparation
Coding interview preparation by programming language
Prepare for coding interviews in ten languages with collection guides, worked algorithms, runtime pitfalls, and linked practice exercises.
Start with the preparation guide for a language you can use comfortably, then practice its collections and implementation details. Each guide links to relevant exercises. A lesson’s editor shows which languages are available for that exercise. Use the study-plan builder to reserve learning and review time.
JavaScript
JavaScript coding interview preparation
Practice the data structures, language behavior, asynchronous utilities, and testing habits that support clear JavaScript interview solutions.
GuidesDebounce vs. throttle in JavaScript
Build both functions, compare leading and trailing calls, and test timing behavior with an interactive event timeline.
GuidesImplement Promise.all in JavaScript
Write a Promise.all implementation that preserves input order, handles empty iterables, and rejects correctly.
GuidesThe JavaScript event loop, explained with execution traces
Trace synchronous code, promise microtasks, timers, and async functions. Work through examples before checking their output.
Interactive toolsDebounce and throttle visualizer
Send events and compare immediate, debounced, and throttled callbacks. Adjust the wait and leading/trailing options and inspect exact timelines.
TopicsJavaScript interview utilities and concepts
Practice promises, closures, array methods, event emitters, debounce, and throttle with guides and coding lessons.
GuidesImplement a JavaScript queue for BFS without repeated shift calls
Build a FIFO queue with bounded compaction, distinguish empty results from undefined values, and use it in a cyclic graph traversal.
Interactive toolsJavaScript output quiz: 12 snippets with explained answers
Predict JavaScript output for closures, this, copies, Map keys, defaults, sorting, and promises. Compare explanations and retry missed snippets.
GuidesJavaScript closures and this: state, receivers, and callback lifetimes
Explain closure bindings, independent instances, receiver loss, arrow functions, listener cleanup, and callback lifetime through tested JavaScript examples.
GuidesDesign an accessible autocomplete: state, stale requests, and keyboard behavior
Work through query state, cancellation, stale-response guards, keyboard focus, combobox semantics, caching, and test cases for a frontend autocomplete.
GuidesDOM event delegation: boundaries, nested targets, and cleanup
Build a delegated button handler with explicit container boundaries, nested targets, disabled controls, keyboard activation, and listener cleanup.
ReferenceInterview collection operations across ten programming languages
Compare map presence, queues, copying, numeric boundaries, and text units across JavaScript, TypeScript, Python, Java, C++, C#, Go, Kotlin, Swift, and Rust.
GuidesRetry with exponential backoff in JavaScript
Build a bounded retry loop with full jitter, cancellation, explicit retry policy, and deterministic timing tests.
GuidesLimit promise concurrency in JavaScript
Run lazy task factories in an ordered worker pool, stop new work after failure, and drain active tasks before settling.
GuidesDeep clone JavaScript data: cycles, aliases, and property contracts
Copy a supported object graph without losing cycles, shared references, sparse holes, or property flags, and compare with structuredClone.
GuidesFlatten nested JavaScript arrays with an explicit stack
Preserve left-to-right order, distinguish holes from undefined, reject cycles, and expand repeated references correctly.
GuidesImplement currying in JavaScript with an explicit arity
Collect grouped arguments, reuse partial applications safely, and define receiver, excess-argument, and exception behavior.
GuidesJavaScript memoization: keys, invalidation, and rejected promises
Build receiver-aware argument caching and pending-promise deduplication with explicit identity, retention, and failure rules.
GuidesBuild a JavaScript event emitter with reliable cleanup
Implement duplicate subscriptions, recursive once listeners, dispatch mutation rules, and idempotent unsubscription.
Interactive toolsAccessible tabs, modal focus, and React state lab
Practice tab keyboard navigation, native modal focus, and queued React state updates in three working browser examples.
GuidesJavaScript prototypes: lookup, ownership, and method receivers
Trace inherited properties, shadowing, accessors, constructor prototypes, and dictionary ownership with executable examples.
GuidesJavaScript equality, coercion, and object identity
Compare strict equality, Object.is, Map keys, falsy values, and object identity through tested cases and practical API contracts.
Worked lesson walkthroughs
66 reading lessons with code examples in this language.
Two Sum in JavaScript: return every matching index pair
Solve the all-pairs Two Sum exercise with a JavaScript Map. Trace complement lookups, handle index zero, preserve indexes, and test numeric assumptions.
Practice walkthroughValid brackets in JavaScript: a stack that ignores ordinary text
Validate nested parentheses, brackets, and braces with a JavaScript array stack. Trace mismatched closers, ignore other characters, and test nesting and empty input.
Practice walkthroughProduct of array except self in JavaScript without division
Build the product array with prefix and suffix passes in JavaScript. Trace the output in place, handle zeros, avoid fill aliasing mistakes, and explain numeric limits.
TypeScript
TypeScript coding interview preparation
Use precise types for maps, trees, unions, and asynchronous functions while keeping your interview implementation readable and testable.
GuidesTypeScript collections: missing values, keys, and readonly contracts
Model lookup presence explicitly, handle unchecked indexes, preserve zero and undefined, and write a typed frequency counter and graph BFS.
ReferenceInterview collection operations across ten programming languages
Compare map presence, queues, copying, numeric boundaries, and text units across JavaScript, TypeScript, Python, Java, C++, C#, Go, Kotlin, Swift, and Rust.
Worked lesson walkthroughs
66 reading lessons with code examples in this language.
Two Sum in TypeScript: all index pairs with typed Maps
Return every matching index pair using Map<number, number>, tuple results, strict null checks, and safe index handling in TypeScript.
Practice walkthroughValid brackets in TypeScript: a typed stack for matching delimiters
Validate nesting in TypeScript with an explicitly typed stack. Handle missing pop results, ignore ordinary text, and test crossing brackets.
Practice walkthroughProduct of array except self in TypeScript: prefix and suffix passes with strict indexing
Build products without division in TypeScript. Use strict array access, explain prefix/suffix invariants, and test zeros and numeric limits.
Python
Python coding interview preparation
Choose lists, dictionaries, sets, deque, and heaps deliberately. Practice readable Python solutions with clear time and memory analysis.
ReferencePython collections for interviews: dict, Counter, deque, and heapq
Choose Python collections by operation, write counts and adjacency lists, and test queue, heap, missing-key, and copying behavior.
GuidesCount islands in Python with iterative flood fill
Solve a four-neighbor binary-grid problem with an explicit stack, visited-set and in-place variants, complexity analysis, and boundary tests.
ReferenceInterview collection operations across ten programming languages
Compare map presence, queues, copying, numeric boundaries, and text units across JavaScript, TypeScript, Python, Java, C++, C#, Go, Kotlin, Swift, and Rust.
Worked lesson walkthroughs
58 reading lessons with code examples in this language.
Two Sum in Python: all index pairs with a dictionary
Use enumerate and a dictionary to return every matching pair of indexes. Follow the invariant, distinguish missing keys from index zero, and test the unique-integer contract.
Practice walkthroughValid brackets in Python: matching delimiters with a list stack
Write a Python bracket validator using append, pop, and a closer-to-opener dictionary. Follow a nesting trace and test text, missing openers, and crossing brackets.
Practice walkthroughProduct of array except self in Python: two passes, no division
Solve Product Array using Python lists and running prefix and suffix products. Explain the invariant, zeros, negative numbers, and the cost of large integer arithmetic.
Java
Java coding interview preparation: collections, numbers, and traversal
Prepare with HashMap, ArrayDeque, safe comparators, UTF-16 text, and tested Java implementations of Two Sum and graph traversal.
GuidesJava PriorityQueue: top-K values, comparators, and stable ties
Retain top-K stream values, process jobs with explicit tie order, and test Java heap ranking separately from iteration and sorted output.
ReferenceInterview collection operations across ten programming languages
Compare map presence, queues, copying, numeric boundaries, and text units across JavaScript, TypeScript, Python, Java, C++, C#, Go, Kotlin, Swift, and Rust.
Worked lesson walkthroughs
58 reading lessons with code examples in this language.
Two Sum in Java: all index pairs with HashMap
Build a Java HashMap solution for every matching index pair. Handle Integer null checks, avoid complement overflow, and convert the result to int[][] with tests.
Practice walkthroughValid brackets in Java: ArrayDeque and ordered matching
Use ArrayDeque as a stack to validate brackets in Java. Handle pop safely, choose character types, ignore ordinary text, and verify a complete set of edge cases.
Practice walkthroughProduct of array except self in Java with long arrays
Implement prefix and suffix products with long[] in Java. Initialize the output correctly, handle zeros without division, and state the overflow assumptions with tests.
C++
C++ coding interview preparation: STL, ownership, and boundaries
Use vectors, hash maps, queues, and priority queues while handling iterator invalidation, integer overflow, and safe index boundaries.
GuidesC++ lower_bound and upper_bound: counts, neighbors, and record ranges
Use C++ search boundaries for duplicate counts, strict predecessors and successors, and custom record keys without invalid iterator operations.
ReferenceInterview collection operations across ten programming languages
Compare map presence, queues, copying, numeric boundaries, and text units across JavaScript, TypeScript, Python, Java, C++, C#, Go, Kotlin, Swift, and Rust.
Worked lesson walkthroughs
58 reading lessons with code examples in this language.
Two Sum in C++: all index pairs with unordered_map
Solve the all-pairs Two Sum exercise with unordered_map in C++. Preserve indexes, check complement range, and avoid insertion during lookup.
Practice walkthroughValid brackets in C++: a vector stack that preserves nesting
Use a vector as a stack to validate parentheses, brackets, and braces in C++. Guard empty access, ignore text, and test nesting.
Practice walkthroughProduct of array except self in C++: prefix and suffix products without division
Compute product of array except self with two C++ passes. Handle unsigned reverse indexing, zeros, input preservation, and signed overflow assumptions.
Go
Go coding interview preparation: slices, maps, and text
Practice Go slice ownership, map presence checks, byte and rune boundaries, and queue-based graph traversal with worked code.
GuidesLongest unique substring in Go: bytes, runes, and Unicode
Implement rune and ASCII sliding windows, reject invalid input, preserve forward-only boundaries, and test Unicode length assumptions.
ReferenceInterview collection operations across ten programming languages
Compare map presence, queues, copying, numeric boundaries, and text units across JavaScript, TypeScript, Python, Java, C++, C#, Go, Kotlin, Swift, and Rust.
Worked lesson walkthroughs
58 reading lessons with code examples in this language.
Two Sum in Go: all index pairs with checked integer arithmetic
Find every matching index pair in Go with map comma-ok lookups. Guard int subtraction overflow and preserve the original slice and indexes.
Practice walkthroughValid brackets in Go: ASCII delimiters and UTF-8 text
Validate nested brackets in Go using an explicit rune stack. Distinguish byte offsets from runes, ignore other text, and test Unicode and nesting.
Practice walkthroughProduct of array except self in Go: int64 slices and two directional passes
Build product of array except self in Go with an int64 result slice. Explain make, append versus indexing, slice aliasing, and numeric bounds.
Rust
Rust coding interview preparation: borrowing and collections
Write interview algorithms with borrowed slices, explicit Option results, HashMap entries, VecDeque, and min-heap priority through Reverse.
GuidesRust BFS shortest paths with borrowed graph labels
Return a shortest unweighted route using borrowed string labels, a FIFO frontier, explicit parents, and a lifetime that matches the source graph.
ReferenceInterview collection operations across ten programming languages
Compare map presence, queues, copying, numeric boundaries, and text units across JavaScript, TypeScript, Python, Java, C++, C#, Go, Kotlin, Swift, and Rust.
Worked lesson walkthroughs
58 reading lessons with code examples in this language.
Two Sum in Rust: all index pairs with HashMap and checked conversions
Use Rust HashMap to return every matching index pair. Handle borrowed lookups, checked narrowing, original indexes, and the course result type.
Practice walkthroughValid brackets in Rust: ASCII bytes and a Vec stack
Validate ASCII brackets in Rust with byte iteration and Vec::pop. Handle Option safely, ignore other text, and test deep nesting without recursion.
Practice walkthroughProduct of array except self in Rust: owned vectors and prefix products
Build products without division in Rust using an output Vec<i64>. Explain ownership, reverse ranges, integer bounds, zeros, and input allocation.
C#
C# coding interview preparation: collections, tuples, and traversal
Practice C# dictionary presence, nullable tuple results, widened arithmetic, queue traversal, priority ordering, and UTF-16 text contracts.
ReferenceInterview collection operations across ten programming languages
Compare map presence, queues, copying, numeric boundaries, and text units across JavaScript, TypeScript, Python, Java, C++, C#, Go, Kotlin, Swift, and Rust.
Worked lesson walkthroughs
58 reading lessons with code examples in this language.
Two Sum in C#: all index pairs with Dictionary
Return all index pairs with a C# Dictionary and TryGetValue. Widen complement arithmetic, preserve index zero, and produce an int[][] result.
Practice walkthroughValid brackets in C#: matching delimiters with Stack<char>
Validate bracket nesting with Stack<char> in C#. Guard Pop, compare delimiters in order, ignore other characters, and keep calls independent.
Practice walkthroughProduct of array except self in C#: long arrays and prefix products
Solve Product Array in C# with long[], prefix/suffix passes, and no division. Explain initialization, checked arithmetic, zeros, and input preservation.
Kotlin
Kotlin coding interview preparation: arrays, nullability, and JVM collections
Use primitive arrays, nullable results, map presence, JVM queues, safe comparisons, and explicit collection-sharing assumptions in Kotlin.
ReferenceInterview collection operations across ten programming languages
Compare map presence, queues, copying, numeric boundaries, and text units across JavaScript, TypeScript, Python, Java, C++, C#, Go, Kotlin, Swift, and Rust.
Worked lesson walkthroughs
58 reading lessons with code examples in this language.
Two Sum in Kotlin: all index pairs with nullable map lookups
Solve all-pairs Two Sum with Kotlin HashMap, safe nullable lookups, widened complement arithmetic, and an Array<IntArray> result.
Practice walkthroughValid brackets in Kotlin: ArrayDeque and matching delimiters
Use Kotlin ArrayDeque<Char> to match brackets in order. Guard removal, ignore non-bracket text, and test empty input and deep nesting.
Practice walkthroughProduct of array except self in Kotlin: LongArray and constant working state
Use LongArray to compute prefix and suffix products in Kotlin without division. Handle zeros, range boundaries, overflow assumptions, and content comparison.
Swift
Swift coding interview preparation: value semantics, optionals, and text
Prepare Swift algorithms with optional results, checked arithmetic, collection value semantics, FIFO traversal, and Unicode-aware text choices.
ReferenceInterview collection operations across ten programming languages
Compare map presence, queues, copying, numeric boundaries, and text units across JavaScript, TypeScript, Python, Java, C++, C#, Go, Kotlin, Swift, and Rust.
Worked lesson walkthroughs
58 reading lessons with code examples in this language.
Two Sum in Swift: all index pairs with Dictionary and overflow checks
Return all matching index pairs in Swift with Dictionary optional binding. Detect complement overflow and keep the original array unchanged.
Practice walkthroughValid brackets in Swift: Unicode scalars and a safe array stack
Validate bracket nesting with Swift Unicode-scalar iteration and popLast. Ignore ordinary text, recognize brackets beside combining marks, and test empty-stack handling.
Practice walkthroughProduct of array except self in Swift: two passes with value-semantic arrays
Compute product of array except self in Swift with two passes. Explain reversed indices, value semantics, zeros, and trapping integer overflow.