
C# for Coding Interviews: The Collections That Win and the Traps That Don't
C# for coding interviews: every collection you need, five gotchas that cause silent bugs, and code patterns for Dictionary, PriorityQueue, and SortedSet.
Page 46 of 61 · Ideas for curious minds in tech.
Back to the archive
C# for coding interviews: every collection you need, five gotchas that cause silent bugs, and code patterns for Dictionary, PriorityQueue, and SortedSet.

Ruby for coding interviews: Enumerable power, no native heap, and the five gotchas that will burn you. The complete guide to Array, Hash, and more.

Swift for coding interviews: build your own heap, avoid O(n) string traps, and dodge five crashes that hit iOS engineers in live interviews.

Kotlin for coding interviews: ArrayDeque vs Stack, min/max heaps, TreeMap navigation, Int overflow, and tailrec. Every gotcha in one cheat sheet.

Your complete guide to Rust for coding interviews: collections, entry API, sorting, usize gotchas, and the patterns that save time under pressure.

Go for coding interviews: container/heap boilerplate, nil map traps, slice copy bugs, and the five gotchas that cost engineers real interview problems.

How the Fisher-Yates shuffle algorithm produces a uniform random permutation in O(n) with O(1) space, and why the naive shuffle is provably biased.

TypeScript for coding interviews: typed containers, five runtime traps, and a cheat sheet for interview day. For engineers who write TS daily.

C++ for coding interviews: master STL containers, priority_queue syntax, iterator invalidation, and the five traps that catch even fluent C++ developers.

JavaScript for coding interviews: the built-ins worth knowing, five gotchas that trip up engineers, and how to fill the missing heap and sorted map.

Java for coding interviews: collections decision table, five hidden traps, and a cheat sheet. HashMap, TreeMap, PriorityQueue, ArrayDeque, and sorting gotchas.

The Python interview cheat sheet for DSA: collections, heapq, bisect, lru_cache, and the gotchas that quietly wreck otherwise correct solutions.

Reservoir sampling picks k items uniformly from a stream of unknown length in one pass with O(k) space. Proof, implementations, and interview patterns.

Binary lifting algorithm: O(n log n) build, O(log n) LCA and k-th ancestor queries. Proof, worked examples, and 14 language implementations.

The sieve of Eratosthenes finds all primes up to n in O(n log log n). Proof, the overflow bug to avoid, and 14 language implementations.

Binary exponentiation reduces x^n to O(log n) multiplications. Learn the iterative form, modular version, INT_MIN trap, and matrix exponentiation.

Morris traversal achieves O(1) space binary tree traversal by temporarily threading null pointers. Inorder, preorder, postorder in 14 languages.

Dijkstra's Dutch national flag problem: four-zone invariant, O(n) exact time, O(1) space, 14 language implementations, and quicksort duplicate handling.

The cyclic sort algorithm sorts arrays in [1,n] in O(n) time, O(1) space. Learn the pattern, the duplicate trap, and six LeetCode problems it solves.

Kadane's algorithm finds the maximum subarray sum (LeetCode 53) in O(n) time, O(1) space. Proof, variants, the all-negative bug, and 14 implementations.

Manacher's algorithm finds every palindromic substring in O(n). Mirror insight, O(n) proof, and 14 language implementations with worked examples.

The KMP algorithm finds all pattern matches in O(n+m) time. Learn how the LPS failure table works, why i never goes backward, and 14 implementations.

The Z-algorithm finds every pattern occurrence in O(n+m). Learn the Z-box invariant, 14 language implementations, and the period detection trick.

The Rabin-Karp algorithm finds patterns in O(n+m) using a rolling hash. Learn the formula, spot spurious hits, and see 14 language implementations.