Design Circular Deque — Array-Based Implementation (LeetCode 641)
Design a Circular Deque with front/rear pointers on a fixed-size array. Python solution with all O(1) operations, visual trace, and edge case handling.
12 posts · page 1 of 1
Design a Circular Deque with front/rear pointers on a fixed-size array. Python solution with all O(1) operations, visual trace, and edge case handling.
Design Front Middle Back Queue using two balanced deques. Python solution with O(1) operations, step-by-step trace, and complexity analysis for LeetCode 1670.
Design a Flatten Nested List Iterator using a stack for lazy flattening. Python solution with iterator protocol, step-by-step trace, and design analysis.
Maximum Frequency Stack solved with HashMap and stack groups by frequency. Python implementation with step-by-step trace, complexity analysis, and design insights.
Design and implement an LRU Cache from scratch using a HashMap and Doubly Linked List for O(1) get and put, with Python code, OrderedDict shortcut, and real-world context.
Compare soft and hard deletes across recovery, compliance, indexing, and query complexity to pick the right deletion strategy.
Use the CSS clamp function to build fluid typography and spacing that scales smoothly between breakpoints without media queries or jarring jumps.
A practical tour of modern CSS color: oklch, color-mix, relative color syntax, and wide-gamut color spaces. Learn how to pick palettes that stay perceptually even and accessible across themes.
How to design multi-turn LLM conversations that stay coherent, respect context limits, handle long histories, and support useful features like summarization and recall.
Solve Find Median from Data Stream with two heaps. Learn the balance invariant, why it gives O(log n) inserts and O(1) median, and the common pitfalls.
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.
Field-tested REST API design — resource naming, versioning, pagination, filtering, sorting, idempotency, and consistent error envelopes. Conventions that age well in production.