Archives
All the articles I've archived.
-
LeetCode 1970 Last Day Where You Can Still Cross
Solutions for LeetCode 1970, hard, tags: binary search, breadth-first search, union find, matrix.
-
System Design - How Kubernetes StatefulSets Keep Pod Identity and Storage
Learn how a Kubernetes StatefulSet connects stable pod names and persistent storage to ordered creation, scaling, and rolling updates.
-
TiKV Source Walkthrough - How Raft Log Garbage Collection Works
Follow a TiKV Raft leader from its periodic log-GC check to the asynchronous Raft Engine cleanup, including the replication checks and key configuration limits.
-
LeetCode 1291 Sequential Digits
Solutions for LeetCode 1291, medium, tags: array, breadth-first search, queue, string.
-
System Design - How the Model Context Protocol Connects AI Apps to Tools
A beginner-friendly tour of MCP's host, client, and server roles, capability discovery, JSON-RPC messages, transports, and trust boundaries.
-
System Design - How TiDB Executes UPDATE in Source Code
Follow one UPDATE from TiDB's selection plan through UpdateExec, row validation, secondary-index maintenance, and transactional writes.
-
LeetCode 328 Odd Even Linked List
Solutions for LeetCode 328, medium, tags: linked list, two pointers.
-
System Design - How AWS Lambda Reuses Execution Environments
Follow a Lambda request through initialization, invocation, freezing, and reuse, and learn which state can safely survive between calls.
-
System Design - How TiDB Executes AS OF TIMESTAMP Reads
Trace one historical SELECT through TiDB's stale-read processor, transaction provider, and TiKV's safe timestamp and MVCC reader.
-
LeetCode 136 Single Number
Solutions for LeetCode 136, easy, tags: array, bit manipulation, hash table.
-
System Design - How KVM Runs a Virtual Machine
How Linux KVM and QEMU work together to create a virtual machine: vCPU execution, guest memory, VM exits, virtual devices, and the settings that choose hardware acceleration.
-
System Design - How TiDB's DELETE Executor Removes Rows
Follow one single-table DELETE through TiDB's DeleteExec: how child rows become handles, how the table layer removes row and index keys, and why deprecated batch-delete settings change transaction boundaries.
-
LeetCode 117 Populating Next Right Pointers in Each Node II
Solutions for LeetCode 117, medium, tags: tree, breadth-first search, linked list, binary tree.
-
System Design - How MQTT Routes Messages Through a Broker
Follow an IoT message from publisher to subscriber, then compare MQTT QoS, retained messages, and persistent sessions.
-
System Design - How TiKV Applies Committed Raft Entries in Source Code
Trace a committed TiKV Raft entry through the Peer, ApplyFsm, ApplyDelegate, and KV engine, including the apply index and worker settings.
-
LeetCode 1306 Jump Game III
Solutions for LeetCode 1306, medium: breadth-first and iterative depth-first search on an implicit graph of array indices.
-
System Design - How Java Virtual Threads Work
How Java virtual threads let blocking request code handle more concurrent I/O by parking on a small set of carrier threads, and where CPU work, pinning, and resource limits still matter.
-
TiDB Source Walkthrough - How PLAN REPLAYER DUMP EXPLAIN Works
Follow TiDB's PLAN REPLAYER DUMP EXPLAIN from PlanReplayerExec through the archive builder to the download handler, and see which schema, statistics, bindings, and settings help reproduce a plan.
-
LeetCode 2405 Optimal Partition of String
Solutions for LeetCode 2405, medium, tags: hash table, string, greedy.
-
AI/ML - How Mixture of Experts Models Work
A beginner-friendly tour of MoE routers, sparse expert activation, load balancing, and why more model capacity brings memory and communication costs.
-
System Design - How TiDB Handles Prepared Statements in the MySQL Binary Protocol
Follow COM_STMT_PREPARE, COM_STMT_EXECUTE, and COM_STMT_CLOSE through TiDB's connection, session, parameter decoder, and configuration.
-
LeetCode 2367 Number of Arithmetic Triplets
Solutions for LeetCode 2367, easy, tags: array, hash table.
-
System Design - How TiDB ANALYZE TABLE Builds Statistics in Source
Updated:Trace TiDB ANALYZE TABLE from planner tasks through TiKV scans and TiDB statistics executors to persisted histograms, Top-N values, and optimizer estimates.
-
System Design - How Webhooks Deliver Events Reliably
Updated:Follow an order event from a producer to a webhook receiver, then learn how durable queues, signatures, acknowledgments, retries, deduplication, and replay make delivery dependable.
-
LeetCode 1653 Minimum Deletions to Make String Balanced
Solutions for LeetCode 1653, medium, tags: string, dynamic programming.
-
System Design - How HashiCorp Vault Issues Dynamic Database Credentials
Follow a database credential from workload authentication through Vault policies, a secrets engine, and a renewable lease to expiration and revocation.
-
System Design - How TiDB Implements SHOW WARNINGS
Trace a TiDB diagnostic from StatementContext through its warning handler into SHOW WARNINGS, including SQL mode, warning counts, and the ShowExec output path.
-
LeetCode 3042 Count Prefix and Suffix Pairs I
Count prefix and suffix pairs by checking each ordered index pair.
-
System Design - How Erasure Coding Protects Stored Data
Learn how storage systems combine data and parity fragments to recover lost data, and why the space savings come with repair and placement trade-offs.
-
System Design - How TiDB TableDual Produces Rows Without a Table
Trace TiDB's TableDual from a logical plan to an executor, including zero-column rows, empty results, and chunk settings.
-
LeetCode 2369 Check if There is a Valid Partition For The Array
Solution for LeetCode 2369, medium, tags: array, dynamic programming.
-
System Design - How RabbitMQ Confirms and Acknowledgements Work
Follow a RabbitMQ message from publisher to worker: routing, publisher confirms, quorum queues, manual acknowledgements, prefetch, and why retries still require idempotent processing.
-
System Design - How TiDB ADMIN CHECKSUM TABLE Works in Source
Trace TiDB's ADMIN CHECKSUM TABLE through five structs in TiDB and TiKV: snapshot selection, table and index tasks, CRC64-XOR scanning, result reduction, and concurrency settings.
-
LeetCode 2090 K Radius Subarray Averages
Updated:Solutions for LeetCode 2090, medium, tags: array, sliding window, prefix sum.
-
System Design - How Redis Cluster Routes Keys and Survives Failures
A guided tour of Redis Cluster's hash slots, client routing, resharding redirects, gossip, replica elections, and write-safety trade-offs.
-
System Design - How TiDB Parallel Hash Aggregation Works in Source
A source-level tour of TiDB's root HashAgg plan, partial and final workers, group-key routing, result chunks, and memory spill settings.
-
LeetCode 2592 Maximize Greatness of an Array
Solutions for LeetCode 2592, medium, tags: array, two pointers, greedy, sorting.
-
System Design - How Kubernetes Operators Reconcile Applications
A beginner-friendly walkthrough of Kubernetes operators, custom resources, reconciliation loops, status, ownership, and the settings that shape a controller.
-
System Design - How TiDB Isolates a Failed Statement Inside a Transaction
A source walkthrough of TiDB's LazyTxn and MemBuffer staging: how a successful statement joins a transaction while a failed statement's writes are discarded.
-
LeetCode 1358 Number of Substrings Containing All Three Characters
Solutions for LeetCode 1358, medium, tags: string, sliding window, counting.
-
System Design - How Apache Pulsar Stores and Delivers Messages
Follow a message through Apache Pulsar's broker, BookKeeper ledger, and subscription cursor to see how durable storage and independent consumers fit together.
-
System Design - How TiKV Checks and Splits Large Regions
Trace TiKV's classic Raftstore split check from an encoded TiDB key to a validated BatchSplit request, including the worker, thresholds, and key configs.
-
LeetCode 1658 Minimum Operations to Reduce X to Zero
Solutions for LeetCode 1658, medium, tags: array, sliding window, prefix sum, hash table.
-
System Design - How Apache Spark Executes a Job
Follow an Apache Spark job from a lazy RDD transformation through stages, shuffle boundaries, tasks, executors, retries, and scheduling settings.
-
TiDB Source Walkthrough - How CREATE TABLE Becomes a DDL Job
Trace a regular TiDB CREATE TABLE statement through DDLExec, job submission, the DDL owner scheduler, metadata changes, and schema synchronization.
-
LeetCode 1208 Get Equal Substrings Within Budget
Solutions for LeetCode 1208, medium, tags: string, sliding window.
-
AI/ML - How LLM Tool Calling Works
Follow a model tool call from a structured request through application validation and execution, then back into the conversation as evidence for an answer.
-
System Design - How TiDB Retries Coprocessor Tasks After Region Splits
Trace one TiDB coprocessor scan from key ranges to region tasks, then follow an EpochNotMatch response through the region cache and task rebuild.
-
LeetCode 2736 Maximum Sum Queries
Solutions for LeetCode 2736, hard, tags: array, sorting, offline queries, Fenwick tree.
-
System Design - How CUDA GPU Kernels Execute Work
Trace a CUDA vector addition from the CPU's kernel launch into GPU blocks and warps, then see how synchronization, memory, and scheduling shape performance.
-
System Design - How TiDB Runaway Query Watch Works in Source Code
Follow TiDB's runaway-query rules from SQL configuration through the local watch cache and per-query checker to the coprocessor request path.
-
System Design - How TiDB SQL Bindings Reach the Optimizer
Updated:Trace a TiDB global SQL binding from CREATE BINDING through mysql.bind_info and per-instance caches to optimizer hint application.
-
System Design - How Temporal Durable Execution Works
Updated:Follow a long-running Temporal workflow through event history, worker replay, activities, retries, and durable timers.
-
LeetCode 2012 Sum of Beauty in the Array
Solutions for LeetCode 2012, medium, tags: array, prefix maximum, suffix minimum.
-
LeetCode 992 Subarrays with K Different Integers
Count subarrays with exactly k distinct values by subtracting two sliding-window counts.
-
System Design - How OpenTelemetry Collector Pipelines Work
A practical walkthrough of how the OpenTelemetry Collector receives telemetry, runs it through ordered pipelines, and exports it to observability backends.
-
System Design - How TiDB AUTO_RANDOM IDs Work in Source Code
A small TiDB source walkthrough of AUTO_RANDOM: how an insert combines a shard prefix with an allocated counter, and how that changes clustered row keys.
-
LeetCode 1248 Count Number of Nice Subarrays
Solutions for LeetCode 1248, medium, tags: array, hash table, prefix sum, sliding window.
-
System Design - How Redis Streams and Consumer Groups Work
Follow a Redis Stream from XADD through consumer-group delivery, pending entries, acknowledgements, and recovery after a worker fails.
-
System Design - How TiDB Index Merge Combines Index Scans
Trace TiDB's union-type Index Merge from a physical plan through parallel index scans, duplicate-handle removal, and a table lookup.
-
LeetCode 1748 Sum of Unique Elements
Use a bounded frequency table in O(n) time, or sort and scan duplicate groups in O(n log n) time.
-
AI/ML - How Diffusion Models Generate Images
A beginner-friendly walkthrough of diffusion image generation: how models learn to remove noise, use text prompts, and generate images in compressed latent space.
-
System Design - How TiDB Dynamically Prunes Table Partitions
A source-code walkthrough of TiDB dynamic partition pruning: how a plan carries predicates to execution, selects physical partitions, and builds scans for them.
-
LeetCode 274 H-Index
Solutions for LeetCode 274, medium, tags: array, counting sort, sorting.
-
System Design - How TiDB Transactionally Backfills an Index
Trace TiDB's transactional ADD INDEX worker from schema-state changes through row decoding, uniqueness checks, and batched KV writes.
-
System Design - How WireGuard Builds a Secure IP Tunnel
Follow an IP packet through WireGuard's peer routing, Noise handshake, encrypted transport, replay protection, and NAT keepalives.
-
LeetCode 70 Climbing Stairs
Solution for LeetCode 70, easy, tags: dynamic programming, math.
-
System Design - How Terraform Plan and Apply Work
A beginner-friendly walkthrough of Terraform's plan and apply workflow: providers, state, dependency graphs, saved plans, and the API operations that change infrastructure.
-
System Design - How TiDB AUTO_INCREMENT Cache Works in Source Code
A focused TiDB source walkthrough of AUTO_ID_CACHE=1: how table metadata selects the allocator service, how it reserves ID ranges, and why failover can leave gaps.
-
LeetCode 1718 Construct the Lexicographically Largest Valid Sequence
Backtracking solutions for LeetCode 1718, medium, tags: array, backtracking.
-
System Design - How TiDB Cancels a Query with KILL QUERY
Trace TiDB's KILL QUERY path from SQL execution through global connection routing, session cancellation, and the SQLKiller signal.
-
System Design - How GraphQL Executes a Query
Follow a GraphQL request from its typed schema through validation and resolver execution to a nested response, including batching and partial errors.
-
System Design - How a TiKV Coprocessor DAG Request Works in Source
A source-code tour of TiKV's coprocessor DAG read path: KvService receives the RPC, Endpoint validates and schedules it, and DagHandlerBuilder turns a protobuf plan plus snapshot into execution.
-
LeetCode 1624 Largest Substring Between Two Equal Characters
Solutions for LeetCode 1624, easy, tags: hash table, string.
-
System Design - How SLO Error Budgets Work
How service-level objectives turn availability targets into an error budget, how to calculate and measure it, and how teams use it to balance reliability and delivery speed.
-
System Design - How TiKV Raftstore's Batch System Dispatches Messages
A source-code walk through TiKV Raftstore's BatchSystem, RaftPoller, StoreFsm, and PeerFsm: how messages become bounded batches of per-Region work without one busy Region starving the rest.
-
System Design - How Structured Concurrency Works
Structured concurrency makes concurrent tasks belong to a lexical scope: the scope waits for them, propagates failure, and cancels unfinished siblings so work cannot quietly outlive its request.
-
LeetCode 94 Binary Tree Inorder Traversal
Solutions for LeetCode 94, easy, tags: tree, depth-first search, stack, binary tree.
-
How TiDB's Optimized Hash Join Builds and Probes in Source Code
A focused walkthrough of TiDB's optimized hash join: HashJoinV2Exec, its context, build workers, probe workers, partitions, and spill-to-disk behavior.
-
How API Gateways Work: One Front Door for Many Services
How an API gateway routes requests, centralizes cross-cutting concerns, protects backend services, and avoids becoming a bottleneck.
-
LeetCode 1013 Partition Array Into Three Parts With Equal Sum
Solutions for LeetCode 1013, easy, tags: array, greedy, prefix sum.
-
LeetCode 1003 Check If Word Is Valid After Substitutions
Solutions for LeetCode 1003, medium, tags: string, stack.
-
System Design - How Email Delivery Works: SMTP, DNS, SPF, DKIM, and DMARC
A practical guide to Internet email delivery: how SMTP servers discover recipients with DNS, how message transfer differs from mailbox access, and how SPF, DKIM, and DMARC reduce spoofing.
-
System Design - How TiDB INSERT VALUES Writes Rows in Source Code
A focused TiDB source walkthrough of INSERT ... VALUES: how InsertExec turns expressions into rows, batches optional large inserts, and delegates record and index writes to TableCommon.
-
System Design - How TiDB SET Updates Session State in Source Code
A focused TiDB source walkthrough of SET: how session.ExecuteStmt compiles a Set plan, how SetExecutor evaluates assignments, and how SessionVars validates and stores user, session, global, and instance variables.
-
System Design - How NTP Keeps Computer Clocks in Sync
How Network Time Protocol (NTP) estimates clock offset and network delay, selects trustworthy servers, disciplines a local clock, and copes with jitter, asymmetric paths, and failures.
-
LeetCode 1768 Merge Strings Alternately
Solution for LeetCode 1768, easy, tags: string, two pointers.
-
System Design - How HTTP Caching Works
A practical mental model for HTTP caching: freshness, validation, Cache-Control, validators, and safe policies for versioned assets and dynamic responses.
-
System Design - How TiDB Statement Summary Works in Source Code
Follow one completed TiDB statement into the bounded digest map, interval history, and statement-summary tables, with the key source types and configuration controls.
-
LeetCode 1700 Number of Students Unable to Eat Lunch
Solutions for LeetCode 1700, easy, tags: array, queue, simulation, counting.
-
LeetCode 1963 Minimum Number of Swaps to Make the String Balanced
An O(n)-time, O(1)-space solution to LeetCode 1963 using unmatched brackets.
-
System Design - How a Count-Min Sketch Estimates Frequencies
Follow a small stream through the counters of a count-min sketch, see why collisions only overestimate counts, and learn when its memory and error guarantees are useful.
-
System Design - How TiDB's EXPLAIN Executor Produces Plan Rows
Trace a SELECT's EXPLAIN and EXPLAIN ANALYZE through TiDB's planner, executor builder, and ExplainExec to see when SQL runs and how plan rows reach the client.
-
LeetCode 2215 Find the Difference of Two Arrays
Solution for LeetCode 2215, easy, tags: array, hash table.
-
System Design - How Backpressure Protects a Flink Stream Pipeline
Follow a slow Flink sink backward through network buffers, receiver credits, and upstream tasks to see why bounded queues protect a streaming pipeline.
-
System Design - How TiDB Batch Point Get Fetches Unique Keys
Walk through TiDB's BatchPointGetPlan, executor builder, and BatchPointGetExec as an IN-list on a unique secondary index becomes two KV batch reads.
-
LeetCode 2000 Reverse Prefix of Word
Solution for LeetCode 2000, easy, tags: string, two pointers.
-
System Design - How Fencing Tokens Stop Stale Lock Holders
Why a distributed lease cannot stop a paused worker from writing, and how ordered fencing tokens let a storage system reject stale requests.
-
System Design - How TiDB Checks a Scalar Subquery's Row Count
Follow TiDB's LogicalMaxOneRow, PhysicalMaxOneRow, executor builder, and MaxOneRowExec through the zero-, one-, and many-row cases.
-
LeetCode 1034 Coloring A Border
Iterative BFS solution for LeetCode 1034, Coloring A Border.
-
System Design - How TiDB's Parallel Sort Executor Merges Rows
Trace TiDB's PhysicalSort, SortExec, parallelSortWorker, and multiWayMerger as they sort chunks and merge worker results, with memory and spill settings.
-
System Design - How Database Group Commit Amortizes fsync
Follow three concurrent PostgreSQL commits through WAL positions, one shared flush, and the latency-throughput trade-off of commit_delay.
-
LeetCode 2485 Find the Pivot Integer
Solutions for LeetCode 2485, easy, tags: math, prefix sum.
-
System Design - How TiDB's Apply Executor Runs a Correlated Subquery
Trace one outer row through PhysicalApply, the executor builder, NestedLoopApplyExec, and ApplyCache to see how TiDB evaluates correlated subqueries.
-
System Design - How PostgreSQL SKIP LOCKED Powers a Job Queue
Follow two workers claiming jobs with PostgreSQL row locks, then add leases and fencing to survive crashes without promising exactly-once execution.
-
LeetCode 1047 Remove All Adjacent Duplicates In String
Solution for LeetCode 1047, easy, tags: string, stack, simulation.
-
System Design - How Hedged Requests Reduce Tail Latency
Follow a slow read through a hedged RPC, from the delayed second attempt to cancellation, deadlines, and the cost of duplicate work.
-
System Design - How TiDB Stream Aggregation Carries a Group Across Chunks
A small source-code tour of TiDB's PhysicalStreamAgg, executor builder, VecGroupChecker, and StreamAggExec, including chunk boundaries, empty input, and useful settings.
-
LeetCode 1657 Determine if Two Strings Are Close
Solution for LeetCode 1657, medium, tags: hash table, string, sorting, counting.
-
System Design - How TiDB's Table Reader Streams Rows from TiKV
Follow one TiKV range scan from TiDB's TableReader builder through a DAG request, SelectResult, ordered result handler, and output chunks.
-
System Design - How Idempotency Keys Make Retries Safe
Follow a payment request whose response is lost: how a stable request key, atomic result recording, and careful retry boundaries prevent a second charge.
-
LeetCode 946 Validate Stack Sequences
Solution for LeetCode 946, medium, tags: array, stack, simulation.
-
System Design - How PostgreSQL Index-Only Scans Use the Visibility Map
Why a covering index does not always avoid heap visits: follow one PostgreSQL index-only scan through the visibility map, VACUUM, and EXPLAIN's Heap Fetches counter.
-
System Design - How TiDB's UNION ALL Executor Merges Chunks
Trace TiDB's root UnionAllExec from planner to worker goroutines, reusable chunks, error delivery, and the session concurrency knob.
-
LeetCode 2574 Left and Right Sum Differences
Solution for LeetCode 2574, easy, tags: array, prefix sum.
-
System Design - How Sagas Coordinate Distributed Transactions
Follow an order through inventory reservation, payment, and compensation to understand what a saga guarantees, what it cannot undo, and how to make retries safe.
-
System Design - How TiDB's Projection Executor Runs Expressions
Trace a root TiDB Projection from physical plan to child chunks, expression evaluation, and ordered parallel workers; learn why it sometimes runs sequentially.
-
LeetCode 2140 Solving Questions With Brainpower
Solution for LeetCode 2140, medium, tags: array, dynamic programming.
-
System Design - How TiDB's TopN Executor Keeps Only the Best Rows
Trace ORDER BY with OFFSET and LIMIT through TiDB's PhysicalTopN, executor builder, TopNExec, and chunk heap, including memory and spill settings.
-
System Design - How HyperLogLog Counts Distinct Values
Follow a visitor from a hash to a HyperLogLog register, then see how Redis estimates and merges distinct counts without keeping the visitors themselves.
-
LeetCode 1696 Jump Game VI
Solutions for LeetCode 1696, medium, tags: array, dynamic programming, sliding window, monotonic queue, heap.
-
System Design - How TiDB's Selection Executor Filters Chunks
Trace a root Selection from PhysicalSelection through executorBuilder and SelectionExec to a vectorized filter, including its row-at-a-time fallback and chunk controls.
-
System Design - How TLS Certificate Revocation Reaches a Browser
Follow a compromised TLS certificate from CA revocation through CRLs and OCSP to browser checks, and see why freshness and privacy complicate the design.
-
LeetCode 2419 Longest Subarray With Maximum Bitwise AND
Solution for LeetCode 2419, medium, tags: array, bit manipulation.
-
System Design - How TiDB's LIMIT Executor Reads Only Enough Rows
Trace LIMIT with OFFSET through TiDB's PhysicalLimit, executorBuilder, LimitExec, and Chunk, including how chunk demand and session settings affect reads.
-
System Design - How Kubernetes Horizontal Pod Autoscaling Works
Follow a traffic spike through Kubernetes' HPA control loop: metric collection, replica calculations, the scale subresource, and the safeguards against noisy measurements.
-
LeetCode 1480 Running Sum of 1d Array
Solutions for LeetCode 1480, easy, tags: array, prefix sum.
-
System Design - How a TCP Connection Opens and Closes
Follow one TCP connection from SYN to TIME-WAIT: sequence numbers, the three-way handshake, half-close, FIN versus RST, and why the active closer lingers.
-
System Design - How TiDB Writes and Reads Its Slow Query Log
A source-level tour of TiDB's slow SQL path: ExecStmt's duration gate, SlowQueryLogItems formatting, the file logger, and the SLOW_QUERY virtual table.
-
LeetCode 2053 Kth Distinct String in an Array
Solutions for LeetCode 2053, easy, tags: array, hash table, string.
-
System Design - How Apache Airflow Schedules a DAG
A beginner-friendly explanation of Apache Airflow's DAG processor, scheduler, executor, and workers—and how a task becomes eligible to run.
-
System Design - How TiDB Locks Rows for SELECT FOR UPDATE
Trace a pessimistic SELECT FOR UPDATE from TiDB's executor through the TiKV MVCC lock command, including lock waits, timestamp conflicts, and the settings that control them.
-
LeetCode 1493 Longest Subarray of 1's After Deleting One Element
Solutions for LeetCode 1493, medium, tags: array, sliding window, prefix sum.
-
System Design - How Apache Arrow Works: Columnar Data in Memory
A practical guide to Apache Arrow's in-memory columnar format: arrays, record batches, validity bitmaps, offsets, IPC, Flight, and when zero-copy data sharing is possible.
-
System Design - How TiDB Tracks Query Memory in Source Code
Follow TiDB's memory trackers from StatementContext to the session quota and OOM action, with a focused walkthrough of the current source code and its key settings.
-
System Design - How TiDB Async Commit Works in Source Code
A focused source walkthrough of TiDB Async Commit: how a SQL COMMIT reaches tikv/client-go, how TiKV stores async-commit lock metadata and a minimum commit timestamp, and why TiDB can acknowledge before background lock finalization.
-
AI/ML - How Speculative Decoding Speeds Up LLM Generation
A practical explanation of speculative decoding: how a small draft model proposes tokens, a larger model verifies them in parallel, and rejection sampling preserves the target model's output distribution.
-
LeetCode 1207 Unique Number of Occurrences
Solutions for LeetCode 1207, easy, tags: array, hash table.
-
System Design - How TiDB GC Safe Points Protect MVCC Reads
A source-code walkthrough of TiDB's MVCC garbage collection: how GCWorker advances a safe point and how TiKV turns it into region cleanup.
-
System Design - How WebRTC Connects Two Peers
How WebRTC sets up a real-time connection: signaling, ICE candidates, STUN and TURN, and encrypted media transport.
-
LeetCode 2352 Equal Row and Column Pairs
Solutions for LeetCode 2352, medium, tags: array, hash table, matrix.
-
System Design - How OAuth 2.0 Authorization Code with PKCE Works
A beginner-friendly walkthrough of OAuth 2.0 authorization code with PKCE: redirects, one-time codes, proof keys, client types, token exchange, and the boundary between authorization and authentication.
-
System Design - How TiDB Prepared Plan Cache Reuses Plans Safely
A source walkthrough of TiDB's prepared plan cache: PlanCacheStmt, LRUPlanCache, PlanCacheValue, environment keys, parameter-type matching, range rebuilding, and the configurations that control reuse.
-
LeetCode 1827 Minimum Operations to Make the Array Increasing
Solution for LeetCode 1827, easy, tags: array, greedy. One pass in Java, Python, C++, and Rust.
-
System Design - How TiKV Scheduler Latches Protect TiDB Writes
Follow two competing TiDB storage commands through five TiKV latch types: sorted key hashes, per-command ownership, bucket queues, wakeup retries, completion, and the configuration knobs that do not remove hot-key contention.
-
System Design - How PostgreSQL HOT Updates Work
Why PostgreSQL can sometimes update a row without adding new index entries: heap pages, HOT chains, snapshot visibility, pruning, fillfactor, and the source-code checks that make the optimization safe.
-
LeetCode 2530 Maximal Score After Applying K Operations
Solution for LeetCode 2530, medium, tags: array, greedy, heap (priority queue).
-
System Design - How TiDB TTL Workers Delete Expired Rows
Follow an expired row through five TiDB TTL worker types: key-range scanning, the delete-task channel, guarded DELETE transactions, retry handling, and the settings that control their impact on TiKV.
-
System Design - How the Transactional Outbox Works
Why saving a database row and publishing an event can fail, and how a transactional outbox connects PostgreSQL, Debezium, Kafka, and an idempotent consumer without pretending delivery happens exactly once.
-
LeetCode 1129 Shortest Path with Alternating Colors
Solutions for LeetCode 1129, medium, tags: graph, breadth-first search.
-
System Design - How Kubernetes Deployment Rolling Updates Work
A beginner-friendly walkthrough of how a Kubernetes Deployment replaces Pods gradually, using ReplicaSets, readiness, maxSurge, and maxUnavailable.
-
System Design - How TiDB Auto Analyze Works
A source-code walkthrough of TiDB auto analyze, from the stats-owner scheduler and priority queue to TiDB's Analyze executor and TiKV coprocessor.
-
System Design - How TiDB Point Get Works
Trace a TiDB Point_Get query from planner eligibility through PointGetExecutor to TiKV's snapshot Get, with source links, diagnostics, and relevant controls.
-
System Design - How WebAuthn Passkeys Work
A beginner-friendly walkthrough of passkey registration and sign-in, including WebAuthn challenges, public-key signatures, phishing resistance, and device sync.
-
LeetCode 2602 Minimum Operations to Make All Array Elements Equal
Solutions for LeetCode 2602, medium, tags: array, binary search, sorting, prefix sum.
-
LeetCode 2730 Find the Longest Semi-Repetitive Substring
Solutions for LeetCode 2730, medium, tags: string, sliding window, two pointers.
-
System Design - How Apache Iceberg Works
A beginner-friendly walkthrough of Apache Iceberg's catalog, metadata, snapshots, manifests, file pruning, commits, and the trade-offs of building reliable tables on object storage.
-
System Design - How TiDB Index Lookup Pushdown Works
A source-code walkthrough of TiDB's double-read IndexLookUp plan, how TiDB and TiKV cooperate to push local row lookups down, and the policy, hint, and affinity settings that control it.
-
LeetCode 3066 Minimum Operations to Exceed Threshold Value II
A min-heap simulation that repeatedly combines the two smallest values, with overflow-safe implementations in four languages.
-
AI/ML - How the LLM KV Cache Works
How the LLM key-value cache speeds up token-by-token generation, what it stores, why it consumes GPU memory, and how paged allocation helps serving systems.
-
LeetCode 945 Minimum Increment to Make Array Unique
Solutions for LeetCode 945, medium, tags: array, greedy, sorting, counting.
-
LeetCode 1094 Car Pooling
Solutions for LeetCode 1094, medium, tags: array, sorting, heap, simulation, prefix sum.
-
System Design - How Unicode and UTF-8 Encoding Work
How Unicode and UTF-8 encoding work: the journey from ASCII to a universal character set, UTF-8's variable-length encoding scheme, byte structure, self-synchronization, and why it became the dominant encoding on the web.
-
LeetCode 289 Game of Life
Solutions for LeetCode 289, medium, tags: array, matrix, simulation.
-
LeetCode 983 Minimum Cost For Tickets
Solutions for LeetCode 983, medium, tags: dynamic programming.
-
LeetCode 189 Rotate Array
Solutions for LeetCode 189, medium, tags: array, math, two pointers.
-
LeetCode 1202 Smallest String With Swaps
Solutions for LeetCode 1202, medium, tags: array, hash table, string, depth-first search, breadth-first search, union find, sorting.
-
AI/ML - How Reinforcement Learning from Human Feedback (RLHF) Works
How RLHF works end to end: supervised fine-tuning, reward model training, PPO optimization, and the math behind aligning large language models with human preferences.
-
System Design - How Debuggers Work
How debuggers like GDB and LLDB work under the hood: ptrace system call, INT3 software breakpoints, hardware watchpoints, single-stepping, DWARF debug info, and source code walkthrough from the GDB and Linux kernel.
-
LeetCode 395 Longest Substring with At Least K Repeating Characters
Solutions for LeetCode 395, medium, tags: hash table, string, divide and conquer, sliding window.
-
LeetCode 241 Different Ways to Add Parentheses
Solutions for LeetCode 241, medium, tags: math, dynamic programming, string, recursion, memoization.
-
LeetCode 1448 Count Good Nodes in Binary Tree
Solutions for LeetCode 1448, medium, tags: tree, depth-first search, breadth-first search, binary tree.
-
System Design - How SQLite Works Internally
How SQLite works internally: the tokenizer, parser, bytecode compiler, virtual machine (VDBE), B-tree storage engine, pager, and WAL — a complete walkthrough of how a SQL statement travels from text to disk in the world's most deployed database.
-
LeetCode 503 Next Greater Element II
Solutions for LeetCode 503, medium, tags: array, stack, monotonic stack.
-
System Design - How Linux Signals Work
How Linux signals work: signal delivery from kernel to userspace, signal dispositions, the sigaction machinery, signal masks, real-time vs standard signals, and a source code walkthrough of the Linux kernel signal path.
-
LeetCode 542 01 Matrix
Solutions for LeetCode 542, medium, tags: array, dynamic programming, bfs, matrix.
-
LeetCode 229 Majority Element II
Solutions for LeetCode 229, medium, tags: array, hash table, sorting, counting.
-
System Design - How Diff Algorithms Work
How diff algorithms work: the edit graph model, shortest edit script, Myers' O(ND) algorithm with greedy snakes and D-contours, git's diff strategies (Myers, patience, histogram), and a source code walkthrough of xdiff in the git codebase.
-
LeetCode 377 Combination Sum IV
Solutions for LeetCode 377, medium, tags: array, dynamic programming.
-
LeetCode 2439 Minimize Maximum of Array
Solutions for LeetCode 2439, medium, tags: array, binary search, greedy, prefix sum.
-
System Design - How Object Storage (S3) Works Internally
How object storage systems like Amazon S3 work under the hood: flat namespace design, metadata separation, data placement with consistent hashing, erasure coding for durability, multipart uploads, consistency models, and how it all compares to file and block storage.
-
System Design - How Floating Point Arithmetic Works (IEEE 754)
How IEEE 754 floating point works: the sign-exponent-mantissa bit layout, normalization, special values (infinity, NaN, denormals), rounding modes, and why 0.1 + 0.2 != 0.3 — with binary walkthroughs and real source code.
-
LeetCode 226 Invert Binary Tree
Solutions for LeetCode 226, easy, tags: tree, depth-first search, breadth-first search, binary tree.
-
LeetCode 451 Sort Characters By Frequency
Solutions for LeetCode 451, medium, tags: hash table, string, sorting, heap, bucket sort.
-
System Design - How Hardware Interrupts and Trap Handling Work
How hardware interrupts work: the interrupt lifecycle from electrical signal to handler execution, IDT, IRQs, top-half/bottom-half processing, and a Linux kernel source code walkthrough.
-
LeetCode 2130 Maximum Twin Sum of a Linked List
Solutions for LeetCode 2130, medium, tags: linked list, two pointers, stack.
-
LeetCode 442 Find All Duplicates in an Array
Solutions for LeetCode 442, medium, tags: array, hash table.
-
LeetCode 930 Binary Subarrays With Sum
Solutions for LeetCode 930, medium, tags: array, hash table, sliding window, prefix sum.
-
System Design - How Database Vacuum and Garbage Collection Works
How PostgreSQL's VACUUM and garbage collection works: why MVCC creates dead tuples, the lazy vacuum and full vacuum algorithms, visibility maps, freeze maps, transaction ID wraparound, and autovacuum tuning — with source code walkthrough.
-
LeetCode 2962 Count Subarrays Where Max Element Appears at Least K Times
Solutions for LeetCode 2962, medium, tags: array, sliding window, binary search.
-
System Design - How Distributed Stream Processing Works (Apache Flink)
How distributed stream processing works: dataflow graphs, event time vs processing time, windowing, watermarks, state management, checkpointing, and exactly-once semantics — with source code walkthrough from Apache Flink.
-
LeetCode 338 Counting Bits
Solutions for LeetCode 338, easy, tags: dynamic programming, bit manipulation.
-
System Design - How Regex Engines Work
How regex engines work under the hood: Thompson's NFA construction, NFA-to-DFA conversion, backtracking, and how real implementations like RE2 and PCRE differ in their approach to matching.
-
LeetCode 211 Design Add and Search Words Data Structure
Solutions for LeetCode 211, medium, tags: string, depth-first search, design, trie.
-
LeetCode 974 Subarray Sums Divisible by K
Solutions for LeetCode 974, medium, tags: array, hash table, prefix sum.
-
LeetCode 572 Subtree of Another Tree
Solutions for LeetCode 572, easy, tags: tree, dfs, string matching, binary tree, hash function.
-
LeetCode 904 Fruit Into Baskets
Solutions for LeetCode 904, medium, tags: array, hash table, sliding window.
-
System Design - How Compilers Turn Source Code into Machine Code
How compilers work: the full pipeline from source code to executable — lexing, parsing, AST construction, semantic analysis, intermediate representation, optimization passes, and code generation, with source code examples from real compilers.
-
LeetCode 167 Two Sum II - Input Array Is Sorted
Solutions for LeetCode 167, medium, tags: array, two pointers, binary search.
-
LeetCode 224 Basic Calculator
Solutions for LeetCode 224, hard, tags: math, string, stack, recursion.
-
LeetCode 32 Longest Valid Parentheses
Solutions for LeetCode 32, hard, tags: string, stack, dynamic programming.
-
LeetCode 234 Palindrome Linked List
Solutions for LeetCode 234, easy, tags: linked list, two pointers, stack, recursion.
-
System Design - How Time-Series Compression Works
How time-series databases compress timestamps and floating-point values: delta-of-delta encoding, XOR-based float compression, the Facebook Gorilla paper, and a source code walkthrough of Prometheus TSDB's chunk encoding.
-
LeetCode 96 Unique Binary Search Trees
Solutions for LeetCode 96, medium, tags: math, dynamic programming, tree, binary search tree.
-
AI/ML - How Neural Network Backpropagation Works
How backpropagation trains neural networks: the chain rule on computational graphs, forward pass, backward pass, gradient flow, vanishing gradients, and a source code walkthrough of PyTorch's autograd engine.
-
LeetCode 1679 Max Number of K-Sum Pairs
Solutions for LeetCode 1679, medium, tags: array, hash table, two pointers, sorting.
-
LeetCode 802 Find Eventual Safe States
Solutions for LeetCode 802, medium, tags: depth-first search, breadth-first search, graph, topological sort.
-
System Design - How the Linux Boot Process Works
How a Linux machine boots: from pressing the power button through firmware (BIOS/UEFI), bootloader (GRUB2), kernel decompression, the init process, and systemd — with source code walkthrough from the Linux kernel.
-
LeetCode 692 Top K Frequent Words
Solutions for LeetCode 692, medium, tags: hash table, string, trie, sorting, heap, bucket sort, counting.
-
System Design - How the ELF Binary Format and Program Loading Work
How the ELF binary format works on Linux: file structure, headers, sections vs segments, how the kernel loads a program via execve and load_elf_binary, dynamic linking with PLT/GOT, and the journey from ./a.out to the first instruction.
-
LeetCode 1004 Max Consecutive Ones III
Solutions for LeetCode 1004, medium, tags: array, binary search, sliding window, prefix sum.
-
System Design - How RCU (Read-Copy-Update) Works
How Linux's RCU (Read-Copy-Update) synchronization mechanism works: the publish-subscribe pattern, grace periods, quiescent states, memory barriers, and a source code walkthrough of the Linux kernel's Tree RCU implementation.
-
LeetCode 662 Maximum Width of Binary Tree
Solutions for LeetCode 662, medium, tags: tree, depth-first search, breadth-first search, binary tree.
-
LeetCode 309 Best Time to Buy and Sell Stock with Cooldown
Solutions for LeetCode 309, medium, tags: array, dynamic programming.
-
System Design - How the ARIES Recovery Algorithm Works
How the ARIES recovery algorithm works: WAL, steal/no-force buffer management, LSN-based tracking, fuzzy checkpointing, and the three-pass recovery protocol (analysis, redo, undo) with source code references from PostgreSQL and InnoDB.
-
LeetCode 103 Binary Tree Zigzag Level Order Traversal
Solutions for LeetCode 103, medium, tags: tree, breadth-first search, binary tree.
-
LeetCode 64 Minimum Path Sum
Solutions for LeetCode 64, medium, tags: array, dynamic programming, matrix.
-
System Design - How Content Delivery Networks (CDNs) Work
How Content Delivery Networks (CDNs) work: architecture, DNS-based routing, anycast, edge caching, cache hierarchies, TLS termination, cache invalidation strategies, and source code walkthrough from Varnish Cache.
-
LeetCode 120 Triangle
Solutions for LeetCode 120, medium, tags: array, dynamic programming.
-
LeetCode 40 Combination Sum II
Solutions for LeetCode 40, medium, tags: array, backtracking, sorting.
-
System Design - How the Python GIL (Global Interpreter Lock) Works
How CPython's Global Interpreter Lock works: the GIL data structure, eval loop integration, tick vs timeout-based switching, GIL release during I/O, impact on threading, and the road to removing it (PEP 703, free-threaded Python 3.13+).
-
LeetCode 50 Pow(x, n)
Solutions for LeetCode 50, medium, tags: math, recursion.
-
LeetCode 213 House Robber II
Solutions for LeetCode 213, medium, tags: array, dynamic programming.
-
System Design - How Database Buffer Pool Management Works
How database buffer pools work: page abstraction, InnoDB buffer pool architecture, LRU with midpoint insertion, dirty page flushing, adaptive checkpointing, and source code walkthrough from MySQL/InnoDB.
-
LeetCode 1046 Last Stone Weight
Solutions for LeetCode 1046, easy, tags: array, heap, simulation.
-
System Design - How CPU SIMD and Vector Instructions Work
How CPU SIMD (Single Instruction, Multiple Data) works: the evolution from MMX to AVX-512, register layouts, data-parallel execution, auto-vectorization, intrinsics, and real-world source code examples from databases and machine learning libraries.
-
LeetCode 1838 Frequency of the Most Frequent Element
Solutions for LeetCode 1838, medium, tags: array, binary search, greedy, sliding window, sorting, prefix sum.
-
LeetCode 2251 Number of Flowers in Full Bloom
Solutions for LeetCode 2251, hard, tags: array, binary search, sorting, prefix sum, ordered set.
-
System Design - How the Linux Virtual File System (VFS) Works
How the Linux Virtual File System works: the abstraction layer that lets Linux support ext4, XFS, tmpfs, procfs, and hundreds of other filesystems through a single unified interface. Covers inodes, dentries, superblocks, file operations, and a source code walkthrough.
-
LeetCode 1268 Search Suggestions System
Solutions for LeetCode 1268, medium, tags: array, string, binary search, sorting, trie, heap (priority queue).
-
LeetCode 97 Interleaving String
Solutions for LeetCode 97, medium, tags: string, dynamic programming.
-
LeetCode 208 Implement Trie (Prefix Tree)
Solutions for LeetCode 208, medium, tags: hash table, string, design, trie, companies: pinterest.
-
LeetCode 179 Largest Number
Solutions for LeetCode 179, medium, tags: array, string, greedy, sorting.
-
System Design - How Serializable Snapshot Isolation (SSI) Works
How Serializable Snapshot Isolation (SSI) works: the theory behind detecting dangerous read-write conflicts in MVCC databases, how PostgreSQL implements it, and why it matters for correctness without sacrificing concurrency.
-
LeetCode 1011 Capacity To Ship Packages Within D Days
Solutions for LeetCode 1011, medium, tags: array, binary search, greedy.
-
LeetCode 85 Maximal Rectangle
Solutions for LeetCode 85, hard, tags: array, dynamic programming, stack, matrix, monotonic stack.
-
LeetCode 142 Linked List Cycle II
Solutions for LeetCode 142, medium, tags: hash table, linked list, two pointers.
-
System Design - How the Linux I/O Scheduler Works
How the Linux I/O scheduler works: the block layer, request merging and sorting, multi-queue architecture, mq-deadline, BFQ, kyber, and how schedulers interact with storage devices.
-
LeetCode 740 Delete and Earn
Solutions for LeetCode 740, medium, tags: array, hash table, dynamic programming.
-
System Design - How Hash Tables Work Internally
How hash tables work under the hood: hash functions, collision resolution (chaining vs open addressing), load factors, resizing strategies, Robin Hood hashing, and a source code walkthrough of Go's built-in map.
-
LeetCode 528 Random Pick with Weight
Solutions for LeetCode 528, medium, tags: array, math, binary search, prefix sum, randomized.
-
LeetCode 785 Is Graph Bipartite
Solutions for LeetCode 785, medium, tags: graph, depth-first search, breadth-first search, union find.
-
LeetCode 323 Number of Connected Components in an Undirected Graph
Solutions for LeetCode 323, medium, tags: depth-first search, breadth-first search, union find, graph.
-
LeetCode 240 Search a 2D Matrix II
Solutions for LeetCode 240, medium, tags: array, binary search, matrix, divide and conquer.
-
System Design - How CPU Out-of-Order Execution Works
How modern CPUs execute instructions out of order: the fetch-decode-rename-dispatch-execute-retire pipeline, register renaming, reservation stations, reorder buffer, and how it all maintains the illusion of sequential execution.
-
System Design - How Service Meshes Work (Envoy & Istio)
How service meshes work: sidecar proxy architecture, Envoy's threading model, xDS dynamic configuration, Istio control plane, mTLS, traffic management, and observability — with ASCII diagrams and source code references.
-
LeetCode 253 Meeting Rooms II
Solutions for LeetCode 253, medium, tags: array, sorting, heap, sweep line.
-
LeetCode 846 Hand of Straights
Solutions for LeetCode 846, medium, tags: array, hash table, greedy, sorting.
-
LeetCode 2 Add Two Numbers
Solutions for LeetCode 2, medium, tags: linked list, math, recursion.
-
LeetCode 45 Jump Game II
Solutions for LeetCode 45, medium, tags: array, dynamic programming, greedy.
-
System Design - How Linux cgroups Work
How Linux control groups (cgroups) work: resource isolation and limiting for processes, the filesystem interface, v1 vs v2 architecture, memory/cpu/io/pids controllers, kernel internals, OOM killer integration, and how Docker and Kubernetes use cgroups to build containers.
-
LeetCode 169 Majority Element
Solutions for LeetCode 169, easy, tags: array, hash table, divide and conquer, sorting, counting.
-
System Design - How Filesystem Journaling Works
How filesystem journaling works: the crash consistency problem, write-ahead logging in ext4/jbd2, journal transactions, checkpointing, ordered vs writeback vs journal modes, and a source code walkthrough from the Linux kernel.
-
LeetCode 2385 Amount of Time for Binary Tree to Be Infected
Solutions for LeetCode 2385, medium, tags: tree, depth-first search, breadth-first search, binary tree.
-
LeetCode 863 All Nodes Distance K in Binary Tree
Solutions for LeetCode 863, medium, tags: tree, DFS, BFS, binary tree.
-
System Design - How Distributed File Systems Work (GFS/HDFS)
How distributed file systems work: the architecture of Google File System and Hadoop HDFS, chunk-based storage, metadata management, replication, read/write flows, and fault tolerance — with source code references.
-
LeetCode 355 Design Twitter
Solutions for LeetCode 355, medium, tags: hash table, linked list, design, heap.
-
LeetCode 1482 Minimum Number of Days to Make m Bouquets
Solutions for LeetCode 1482, medium, tags: array, binary search.
-
System Design - How Kubernetes Networking Works
How Kubernetes networking works: the flat network model, pod-to-pod communication via CNI plugins, Service abstraction with kube-proxy iptables/IPVS, DNS resolution with CoreDNS, and how packets actually flow from one pod to another.
-
LeetCode 1162 As Far from Land as Possible
Solutions for LeetCode 1162, medium, tags: array, dynamic programming, breadth-first search, matrix.
-
LeetCode 2300 Successful Pairs of Spells and Potions
Solutions for LeetCode 2300, medium, tags: array, binary search, sorting.
-
LeetCode 456 132 Pattern
Solutions for LeetCode 456, medium, tags: array, stack, monotonic stack.
-
System Design - How RocksDB Compaction Works
How RocksDB compaction works under the hood: leveled compaction scheduling, file picking, merge-sort mechanics, write amplification tradeoffs, and a source code walkthrough from the facebook/rocksdb repository.
-
System Design - How Search Engines Work (Inverted Indexes and Ranking)
How search engines work: inverted indexes, TF-IDF/BM25 scoring, query processing with skip pointers, distributed scatter-gather, and how Lucene organizes segments for near-real-time search.
-
LeetCode 986 Interval List Intersections
Solutions for LeetCode 986, medium, tags: array, two pointers.
-
LeetCode 227 Basic Calculator II
Solutions for LeetCode 227, medium, tags: math, string, stack.
-
LeetCode 2616 Minimize the Maximum Difference of Pairs
Solutions for LeetCode 2616, medium, tags: array, binary search, greedy, sorting.
-
LeetCode 221 Maximal Square
Solutions for LeetCode 221, medium, tags: dynamic programming, matrix.
-
System Design - How CPU Memory Ordering and Memory Models Work
How CPU memory ordering works: why instructions execute out of order, store buffers, the x86-TSO and ARM/RISC-V relaxed models, memory barriers, and how languages like C++ and Go map atomic operations to hardware fences.
-
LeetCode 332 Reconstruct Itinerary
Solutions for LeetCode 332, hard, tags: graph, depth-first search, Eulerian path.
-
System Design - How etcd Works
How etcd works: Raft consensus, bbolt storage engine, MVCC revisions, watch mechanism, lease system, linearizable reads, and how Kubernetes depends on it.
-
LeetCode 934 Shortest Bridge
Solutions for LeetCode 934, medium, tags: array, depth-first search, breadth-first search, matrix.
-
LeetCode 90 Subsets II
Solutions for LeetCode 90, medium, tags: array, backtracking, bit manipulation.
-
LeetCode 279 Perfect Squares
Solutions for LeetCode 279, medium, tags: dynamic programming, math.
-
System Design - How Load Balancers Work
How load balancers work: L4 vs L7, algorithms (round-robin, least-connections, consistent hashing), health checks, connection draining, and source code walkthrough from HAProxy and Nginx.
-
LeetCode 410 Split Array Largest Sum
Solutions for LeetCode 410, hard, tags: array, binary search, dynamic programming, greedy, prefix sum.
-
System Design - How Kubernetes Pod Scheduling Works
How Kubernetes pod scheduling works: the scheduling queue, filtering (predicates), scoring (priorities), binding, preemption, and a source code walkthrough from the kubernetes/kubernetes repository.
-
LeetCode 1438 Longest Continuous Subarray With Absolute Diff Less Than or Equal to Limit
Solutions for LeetCode 1438, medium, tags: array, queue, sliding window, ordered set, monotonic queue.
-
LeetCode 1048 Longest String Chain
Solutions for LeetCode 1048, medium, tags: array, hash table, two pointers, string, dynamic programming.
-
LeetCode 452 Minimum Number of Arrows to Burst Balloons
Solutions for LeetCode 452, medium, tags: array, greedy, sorting.
-
System Design - How the Linux OOM Killer Works
How the Linux Out-of-Memory (OOM) Killer works: when it triggers, how it scores processes, the kill decision algorithm, cgroup-aware behavior, and a source code walkthrough from the Linux kernel.
-
LeetCode 19 Remove Nth Node From End of List
Solutions for LeetCode 19, medium, tags: linked list, two pointers.
-
System Design - How Lamport Clocks and Vector Clocks Work
How logical clocks solve the ordering problem in distributed systems: Lamport clocks, vector clocks, causal ordering, happens-before relation, and real-world usage in databases like DynamoDB, Riak, and CockroachDB.
-
LeetCode 131 Palindrome Partitioning
Solutions for LeetCode 131, medium, tags: string, dynamic programming, backtracking.
-
LeetCode 1514 Path with Maximum Probability
Solutions for LeetCode 1514, medium, tags: graph, heap, shortest path, bellman-ford.
-
LeetCode 739 Daily Temperatures
Solutions for LeetCode 739, medium, tags: array, stack, monotonic stack.
-
System Design - How WebAssembly (Wasm) Works
How WebAssembly works: binary format, stack-based virtual machine, module structure, linear memory model, compilation from source languages, and the security sandbox.
-
LeetCode 316 Remove Duplicate Letters
Solutions for LeetCode 316, medium, tags: string, stack, monotonic stack, greedy.
-
LeetCode 778 Swim in Rising Water
Solutions for LeetCode 778, hard, tags: array, binary search, depth-first search, breadth-first search, union find, heap (priority queue), matrix.
-
LeetCode 678 Valid Parenthesis String
Solutions for LeetCode 678, medium, tags: string, greedy, stack, dynamic programming.
-
LeetCode 337 House Robber III
Solutions for LeetCode 337, medium, tags: tree, dfs, dynamic programming, binary tree.
-
System Design - How the QUIC Protocol Works
How QUIC works: connection establishment, 0-RTT handshake, stream multiplexing without head-of-line blocking, loss detection, congestion control, and connection migration. A walkthrough of the protocol that powers HTTP/3.
-
LeetCode 41 First Missing Positive
Solutions for LeetCode 41, hard, tags: array, hash table.
-
LeetCode 767 Reorganize String
Solutions for LeetCode 767, medium, tags: hash table, string, greedy, sorting, heap, counting.
-
System Design - How Linux System Calls Work
How Linux system calls work: the x86-64 syscall instruction, kernel entry/exit, the syscall dispatch table, vDSO optimization, and a source code walkthrough from the Linux kernel.
-
LeetCode 1584 Min Cost to Connect All Points
Solutions for LeetCode 1584, medium, tags: array, union find, graph, minimum spanning tree.
-
LeetCode 148 Sort List
Solutions for LeetCode 148, medium, tags: linked list, two pointers, divide and conquer, sorting, merge sort.
-
System Design - How Rust's Borrow Checker Works
How Rust's borrow checker enforces memory safety without garbage collection: ownership rules, borrowing, lifetimes, the NLL (Non-Lexical Lifetimes) algorithm, and a source code walkthrough from the rust-lang/rust compiler.
-
System Design - How Memory-Mapped Files (mmap) Work
How memory-mapped files (mmap) work: virtual memory mapping, page faults, kernel page cache interaction, copy-on-write semantics, and why databases love and hate them.
-
LeetCode 399 Evaluate Division
Solutions for LeetCode 399, medium, tags: array, string, depth-first search, breadth-first search, union find, graph, shortest path.
-
LeetCode 373 Find K Pairs with Smallest Sums
Solutions for LeetCode 373, medium, tags: array, heap.
-
System Design - How Futexes Work (The Foundation of Every Lock You Use)
How Linux futexes work: the hybrid userspace/kernel synchronization primitive that powers every mutex, condition variable, and semaphore in modern programs. Covers the fast-path CAS, slow-path syscall, kernel hash table, the three-state mutex optimization, and a source code walkthrough from the Linux kernel and glibc.
-
LeetCode 901 Online Stock Span
Solutions for LeetCode 901, medium, tags: stack, design, monotonic stack, data stream.
-
System Design - How Apache ZooKeeper Works
How Apache ZooKeeper works: the coordination service behind Kafka, Hadoop, and HBase. Covers ZAB consensus protocol, znodes, watches, ephemeral nodes, leader election, sessions, and a source code walkthrough from the apache/zookeeper repository.
-
LeetCode 437 Path Sum III
Solutions for LeetCode 437, medium, tags: tree, depth-first search, binary tree, prefix sum, hash table.
-
LeetCode 310 Minimum Height Trees
Solutions for LeetCode 310, medium, tags: graph, topological sort, BFS.
-
AI/ML - How BPE Tokenization Works in Large Language Models
How Byte Pair Encoding (BPE) tokenization works in large language models: the training algorithm, encoding and decoding, tiktoken and sentencepiece implementations, vocabulary construction, and why subword tokenization strikes the right balance between characters and words.
-
LeetCode 543 Diameter of Binary Tree
Solutions for LeetCode 543, easy, tags: tree, depth-first search, binary tree.
-
System Design - How the Linux Kernel Network Stack Works
How a packet travels from NIC hardware to your application's socket: interrupts, NAPI, sk_buff, protocol layers, and socket receive queues — a walkthrough of the Linux kernel network stack.
-
LeetCode 127 Word Ladder
Solutions for LeetCode 127, hard, tags: hash table, string, breadth-first search.
-
LeetCode 2131 Longest Palindrome by Concatenating Two Letter Words
Solutions for LeetCode 2131, medium, tags: array, hash table, string, greedy, counting.
-
System Design - How Protocol Buffers (Protobuf) Encoding Works
How Protocol Buffers encoding works internally: wire types, varint encoding, field tags, length-delimited records, and a byte-level walkthrough showing why protobuf messages are compact and fast to parse.
-
LeetCode 210 Course Schedule II
Solutions for LeetCode 210, medium, tags: depth-first search, breadth-first search, graph, topological sort.
-
LeetCode 2101 Detonate the Maximum Bombs
Solutions for LeetCode 2101, medium, tags: array, math, depth-first search, breadth-first search, graph.
-
System Design - How Database Connection Pooling Works
How database connection pooling works: the cost of raw connections, pool lifecycle, idle/active management, connection multiplexing modes, HikariCP internals, and PgBouncer architecture with source code walkthrough.
-
LeetCode 4 Median of Two Sorted Arrays
Solutions for LeetCode 4, hard, tags: array, binary search, divide and conquer.
-
LeetCode 752 Open the Lock
Solutions for LeetCode 752, medium, tags: array, hash table, string, breadth-first search.
-
LeetCode 841 Keys and Rooms
Solutions for LeetCode 841, medium, tags: depth-first search, breadth-first search, graph.
-
LeetCode 547 Number of Provinces
Solutions for LeetCode 547, medium, tags: depth-first search, breadth-first search, union find, graph.
-
System Design - How Paxos Consensus Works
How Paxos distributed consensus works: the protocol phases, roles (proposer, acceptor, learner), Multi-Paxos optimization, comparison with Raft, and real-world implementations in Google Chubby, Apache ZooKeeper, and Spanner.
-
LeetCode 494 Target Sum
Solutions for LeetCode 494, medium, tags: array, dynamic programming, backtracking.
-
LeetCode 918 Maximum Sum Circular Subarray
Solutions for LeetCode 918, medium, tags: array, dynamic programming, divide and conquer, queue, monotonic queue.
-
System Design - How Gossip Protocols Work
How gossip protocols propagate information across distributed systems: epidemic dissemination, SWIM failure detection, push/pull/push-pull strategies, convergence analysis, and real-world implementations in Cassandra, Consul, and Redis Cluster.
-
LeetCode 130 Surrounded Regions
Solutions for LeetCode 130, medium, tags: array, depth-first search, breadth-first search, union find, matrix.
-
System Design - How Coroutines and Async/Await Work Under the Hood
How coroutines power async/await: the difference between stackful and stackless coroutines, how Python transforms async functions into state machines, how Go's goroutines use stack-copying, and how the event loop ties it all together.
-
LeetCode 518 Coin Change II
Solutions for LeetCode 518, medium, tags: array, dynamic programming.
-
System Design - How HTTP/2 Multiplexing and Flow Control Works
How HTTP/2 multiplexing works: binary framing, streams, flow control, HPACK header compression, and server push — with ASCII diagrams and source code references from the Go net/http2 implementation.
-
LeetCode 75 Sort Colors
Solutions for LeetCode 75, medium, tags: array, two pointers, sorting.
-
LeetCode 1631 Path With Minimum Effort
Solutions for LeetCode 1631, medium, tags: array, binary search, depth-first search, breadth-first search, union find, heap (priority queue), matrix.
-
LeetCode 36 Valid Sudoku
Solutions for LeetCode 36, medium, tags: array, hash table, matrix.
-
System Design - How Circuit Breakers Work in Distributed Systems
How circuit breakers protect distributed systems from cascading failures: state machine design, failure detection, recovery probing, and a source code walkthrough of real implementations.
-
LeetCode 25 Reverse Nodes in k-Group
Solutions for LeetCode 25, hard, tags: linked list, recursion.
-
System Design - How Copy-on-Write (COW) Works
How Copy-on-Write works across operating systems, databases, and filesystems: the core mechanism behind fork(), Redis snapshots, LMDB reads, B-tree databases, and modern filesystems like Btrfs and ZFS.
-
LeetCode 329 Longest Increasing Path in a Matrix
Solutions for LeetCode 329, hard, tags: array, dynamic programming, depth-first search, breadth-first search, graph, topological sort, memoization, matrix.
-
LeetCode 2542 Maximum Subsequence Score
Solutions for LeetCode 2542, medium, tags: array, greedy, sorting, heap (priority queue).
-
LeetCode 150 Evaluate Reverse Polish Notation
Solutions for LeetCode 150, medium, tags: array, math, stack.
-
System Design - How Database Deadlock Detection Works
How databases detect deadlocks: the wait-for graph algorithm, cycle detection via DFS, InnoDB's implementation, victim selection strategies, and how distributed databases like TiDB handle cross-node deadlocks.
-
LeetCode 55 Jump Game
Solutions for LeetCode 55, medium, tags: array, dynamic programming, greedy.
-
System Design - How SSDs Work Internally (NAND Flash, FTL, and Write Amplification)
How Solid-State Drives work internally: NAND flash physics, pages and blocks, the Flash Translation Layer (FTL), garbage collection, wear leveling, write amplification, TRIM, and why understanding SSDs matters for database engineers.
-
System Design - How CPU Branch Prediction Works
How modern CPUs predict branch outcomes: pipeline stalls, static vs dynamic prediction, branch history tables, two-level adaptive predictors, branch target buffers, and real-world performance implications with code examples.
-
LeetCode 71 Simplify Path
Solutions for LeetCode 71, medium, tags: string, stack.
-
LeetCode 31 Next Permutation
Solutions for LeetCode 31, medium, tags: array, two pointers.
-
LeetCode 57 Insert Interval
Solutions for LeetCode 57, medium, tags: array.
-
System Design - How JIT (Just-In-Time) Compilation Works
How JIT compilation works: interpreter warm-up, profiling, tiered compilation in the JVM HotSpot and V8 engines, inline caches, deoptimization, and source code walkthrough.
-
System Design - How the Linux Page Cache Works
How the Linux page cache works: the kernel's transparent caching layer that sits between applications and disk. Covers address_space, radix tree (xarray), readahead, dirty page writeback, memory pressure eviction, and source code walkthrough from the Linux kernel.
-
LeetCode 695 Max Area of Island
Solutions for LeetCode 695, medium, tags: array, depth-first search, breadth-first search, union find, matrix.
-
LeetCode 115 Distinct Subsequences
Solutions for LeetCode 115, hard, tags: string, dynamic programming.
-
System Design - How Prometheus TSDB (Time-Series Database) Works
How Prometheus stores time-series data: the in-memory head block, Write-Ahead Log, chunk encoding, compaction into persistent blocks, and how queries traverse the layered architecture. Source code walkthrough from the prometheus/prometheus repository.
-
LeetCode 73 Set Matrix Zeroes
Solutions for LeetCode 73, medium, tags: array, hash table, matrix.
-
LeetCode 98 Validate Binary Search Tree
Solutions for LeetCode 98, medium, tags: tree, depth-first search, binary search tree, binary tree.
-
LeetCode 516 Longest Palindromic Subsequence
Solutions for LeetCode 516, medium, tags: string, dynamic programming.
-
LeetCode 380 Insert Delete GetRandom O(1)
Solutions for LeetCode 380, medium, tags: array, hash table, math, design, randomized.
-
System Design - How Merkle Trees Work
How Merkle trees work: hash tree structure, efficient data verification, applications in git, blockchains, distributed databases (Cassandra, DynamoDB), and certificate transparency.
-
LeetCode 297 Serialize and Deserialize Binary Tree
Solutions for LeetCode 297, hard, tags: string, tree, binary tree, design, dfs, bfs.
-
System Design - How Vectorized Query Execution Works
How vectorized query execution works in modern databases: the Volcano model's limitations, batch-at-a-time processing, columnar memory layout, SIMD exploitation, and source code walkthrough from DuckDB and Apache DataFusion.
-
LeetCode 34 Find First and Last Position of Element in Sorted Array
Solutions for LeetCode 34, medium, tags: array, binary search.
-
System Design - How Raft Consensus Works
How the Raft consensus algorithm works: leader election, log replication, safety guarantees, membership changes, and a source code walkthrough from etcd's raft library.
-
LeetCode 102 Binary Tree Level Order Traversal
Solutions for LeetCode 102, medium, tags: tree, breadth-first search, depth-first search, binary tree.
-
LeetCode 402 Remove K Digits
Solutions for LeetCode 402, medium, tags: string, stack, monotonic stack, greedy.
-
LeetCode 684 Redundant Connection
Solutions for LeetCode 684, medium, tags: tree, union find, graph, depth-first search.
-
LeetCode 525 Contiguous Array
Solutions for LeetCode 525, medium, tags: array, hash table, prefix sum.
-
System Design - How Lock-Free Data Structures Work
How lock-free data structures work: CAS operations, memory ordering, the ABA problem, lock-free stacks and queues, and source code walkthrough from the Linux kernel and Java's java.util.concurrent.
-
LeetCode 567 Permutation in String
Solutions for LeetCode 567, medium, tags: hash table, two pointers, string, sliding window.
-
LeetCode 1249 Minimum Remove to Make Valid Parentheses
Solutions for LeetCode 1249, medium, tags: string, stack.
-
System Design - How Zero-Copy I/O Works
How zero-copy I/O works in Linux: the cost of traditional read/write, how sendfile() and splice() eliminate copies, how mmap fits in, and why Kafka and nginx are fast — with ASCII diagrams and kernel source code references.
-
LeetCode 438 Find All Anagrams in a String
Solutions for LeetCode 438, medium, tags: hash table, string, sliding window.
-
LeetCode 153 Find Minimum in Rotated Sorted Array
Solutions for LeetCode 153, medium, tags: array, binary search.
-
LeetCode 787 Cheapest Flights Within K Stops
Solutions for LeetCode 787, medium, tags: dynamic programming, BFS, graph, heap, shortest path.
-
LeetCode 114 Flatten Binary Tree to Linked List
Solutions for LeetCode 114, medium, tags: tree, depth-first search, linked list, stack, binary tree.
-
LeetCode 236 Lowest Common Ancestor of a Binary Tree
Solutions for LeetCode 236, medium, tags: tree, dfs, binary tree.
-
System Design - How Go's Goroutine Scheduler Works
How Go's goroutine scheduler works: the GMP model (Goroutines, OS Threads, Processors), work stealing, preemption, netpoller integration, and a source code walkthrough from the Go runtime.
-
LeetCode 1143 Longest Common Subsequence
Solutions for LeetCode 1143, medium, tags: string, dynamic programming.
-
LeetCode 312 Burst Balloons
Solutions for LeetCode 312, hard, tags: array, dynamic programming.
-
LeetCode 62 Unique Paths
Solutions for LeetCode 62, medium, tags: math, dynamic programming, combinatorics.
-
System Design - How Columnar Storage Works
How columnar storage works: row vs column layout, compression techniques, vectorized execution, Apache Parquet internals, and why modern analytics engines like ClickHouse and DuckDB are so fast.
-
LeetCode 1091 Shortest Path in Binary Matrix
Solutions for LeetCode 1091, medium, tags: array, breadth-first search, matrix, shortest path.
-
LeetCode 138 Copy List with Random Pointer
Solutions for LeetCode 138, medium, tags: hash table, linked list.
-
LeetCode 239 Sliding Window Maximum
Solutions for LeetCode 239, hard, tags: array, queue, sliding window, heap, monotonic queue.
-
LeetCode 78 Subsets
Solutions for LeetCode 78, medium, tags: array, backtracking, bit manipulation.
-
LeetCode 647 Palindromic Substrings
Solutions for LeetCode 647, medium, tags: string, dynamic programming, two pointers.
-
System Design - How eBPF Works
How eBPF works in the Linux kernel: architecture, program types, the verifier, JIT compilation, maps for state sharing, helper functions, and real-world use cases in observability, networking, and security.
-
LeetCode 199 Binary Tree Right Side View
Solutions for LeetCode 199, medium, tags: tree, depth-first search, breadth-first search, binary tree.
-
LeetCode 417 Pacific Atlantic Water Flow
Solutions for LeetCode 417, medium, tags: array, depth-first search, breadth-first search, matrix.
-
LeetCode 124 Binary Tree Maximum Path Sum
Solutions for LeetCode 124, hard, tags: tree, depth-first search, dynamic programming, binary tree.
-
LeetCode 973 K Closest Points to Origin
Solutions for LeetCode 973, medium, tags: array, math, divide and conquer, geometry, sorting, heap, quickselect.
-
LeetCode 162 Find Peak Element
Solutions for LeetCode 162, medium, tags: array, binary search.
-
System Design - How MapReduce Works
How Google's MapReduce programming model works: the map and reduce phases, data shuffling, fault tolerance, locality optimization, and a walkthrough of the execution model with real code examples.
-
LeetCode 981 Time Based Key-Value Store
Solutions for LeetCode 981, medium, tags: hash table, string, binary search, design.
-
LeetCode 287 Find the Duplicate Number
Solutions for LeetCode 287, medium, tags: array, two pointers, binary search, bit manipulation.
-
System Design - How Database Replication Works
How database replication works: physical vs logical replication, MySQL binlog and PostgreSQL WAL streaming, replication lag, semi-synchronous commit, and the CAP trade-offs in real systems.
-
LeetCode 743 Network Delay Time
Solutions for LeetCode 743, medium, tags: graph, heap, shortest path, Dijkstra, Bellman-Ford.
-
LeetCode 134 Gas Station
Solutions for LeetCode 134, medium, tags: array, greedy.
-
LeetCode 763 Partition Labels
Solutions for LeetCode 763, medium, tags: hash table, two pointers, string, greedy.
-
LeetCode 74 Search a 2D Matrix
Solutions for LeetCode 74, medium, tags: array, binary search, matrix.
-
System Design - How Distributed Tracing Works
How distributed tracing works: trace/span model, context propagation, sampling strategies, and how systems like Jaeger, Zipkin, and OpenTelemetry implement end-to-end request tracking across microservices.
-
LeetCode 853 Car Fleet
Solutions for LeetCode 853, medium, tags: array, sorting, monotonic stack.
-
System Design - How CRDTs (Conflict-free Replicated Data Types) Work
How CRDTs enable conflict-free replication in distributed systems: state-based vs operation-based approaches, G-Counter, PN-Counter, LWW-Register, OR-Set, and real-world usage in collaborative editing, databases, and caches.
-
LeetCode 435 Non-overlapping Intervals
Solutions for LeetCode 435, medium, tags: array, dynamic programming, greedy, sorting.
-
LeetCode 621 Task Scheduler
Solutions for LeetCode 621, medium, tags: array, hash table, greedy, sorting, heap, counting.
-
LeetCode 79 Word Search
Solutions for LeetCode 79, medium, tags: array, string, backtracking, matrix.
-
LeetCode 5 Longest Palindromic Substring
Solutions for LeetCode 5, medium, tags: string, dynamic programming.
-
System Design - How Virtual Memory and Paging Works
How virtual memory and paging works in modern operating systems: address translation, page tables, TLB, page faults, multi-level page tables, and a walkthrough of Linux's implementation.
-
LeetCode 2462 Total Cost to Hire K Workers
Solutions for LeetCode 2462, medium, tags: array, two pointers, heap (priority queue), simulation.
-
System Design - How the CPU Cache Hierarchy Works
How modern CPU caches work: the memory hierarchy from registers to DRAM, cache lines, associativity, write policies, coherence protocols (MESI), and false sharing — with source code examples showing real performance impact.
-
LeetCode 48 Rotate Image
Solutions for LeetCode 48, medium, tags: array, math, matrix.
-
LeetCode 994 Rotting Oranges
Solutions for LeetCode 994, medium, tags: array, breadth-first search, matrix.
-
System Design - How Database Sharding Works
How database sharding works: partitioning strategies (hash, range, directory), routing mechanisms, resharding challenges, and how real systems (Vitess, TiDB, DynamoDB, CockroachDB) implement it.
-
LeetCode 105 Construct Binary Tree from Preorder and Inorder Traversal
Solutions for LeetCode 105, medium, tags: array, hash table, divide and conquer, tree, binary tree.
-
LeetCode 133 Clone Graph
Solutions for LeetCode 133, medium, tags: hash table, depth-first search, breadth-first search, graph.
-
LeetCode 424 Longest Repeating Character Replacement
Solutions for LeetCode 424, medium, tags: string, sliding window, hash table, binary search.
-
LeetCode 2583 Kth Largest Sum in a Binary Tree
Solutions for LeetCode 2583, medium, tags: tree, breadth-first search, sorting, binary tree.
-
LeetCode 46 Permutations
Solutions for LeetCode 46, medium, tags: array, backtracking.
-
System Design - How Memory Allocators Work
How memory allocators work under the hood: malloc/free internals, free lists, splitting and coalescing, the buddy system, arena-based allocators like tcmalloc and jemalloc, and how modern allocators reduce lock contention in multi-threaded programs.
-
LeetCode 198 House Robber
Solutions for LeetCode 198, medium, tags: array, dynamic programming.
-
LeetCode 17 Letter Combinations of a Phone Number
Solutions for LeetCode 17, medium, tags: hash table, string, backtracking.
-
LeetCode 54 Spiral Matrix
Solutions for LeetCode 54, medium, tags: array, matrix, simulation.
-
System Design - How the Linux Process Scheduler (CFS) Works
How Linux's Completely Fair Scheduler (CFS) works: virtual runtime, red-black tree scheduling, nice values, CPU bandwidth control, and source code walkthrough from the kernel's sched/fair.c.
-
System Design - How Linux io_uring Works
How Linux io_uring works: the submission and completion ring buffers, zero-copy I/O without system call overhead, kernel polling mode, and source code walkthrough from the liburing library.
-
System Design - How Two-Phase Commit (2PC) Works
How two-phase commit (2PC) works in distributed databases: the coordinator/participant model, prepare and commit phases, failure handling, recovery via write-ahead logging, and real-world implementations in PostgreSQL, MySQL, and TiDB.
-
LeetCode 209 Minimum Size Subarray Sum
Solutions for LeetCode 209, medium, tags: array, binary search, sliding window, prefix sum.
-
LeetCode 121 Best Time to Buy and Sell Stock
Solutions for LeetCode 121, easy, tags: array, dynamic programming.
-
System Design - How Column-Oriented Databases Work
How column-oriented (columnar) databases work: row vs column storage layout, compression techniques, vectorized execution, and source code walkthrough from ClickHouse.
-
LeetCode 143 Reorder List
Solutions for LeetCode 143, medium, tags: linked list, two pointers, stack, recursion.
-
System Design - How Vector Databases Work
How vector databases work: embedding vectors, similarity search, indexing with HNSW and IVF, distance metrics, quantization, and a look at how Milvus organizes its storage engine.
-
LeetCode 295 Find Median from Data Stream
Solutions for LeetCode 295, hard, tags: two pointers, design, sorting, heap, data stream.
-
System Design - How TCP Congestion Control Works
How TCP congestion control works: slow start, congestion avoidance, fast retransmit, fast recovery, and modern algorithms like CUBIC and BBR — explained with ASCII diagrams and Linux kernel source references.
-
LeetCode 139 Word Break
Solutions for LeetCode 139, medium, tags: dynamic programming, hash table, string, trie, memoization.
-
LeetCode 11 Container With Most Water
Solutions for LeetCode 11, medium, tags: array, two pointers, greedy.
-
LeetCode 84 Largest Rectangle in Histogram
Solutions for LeetCode 84, hard, tags: array, stack, monotonic stack.
-
LeetCode 22 Generate Parentheses
Solutions for LeetCode 22, medium, tags: string, dynamic programming, backtracking.
-
System Design - How Git Internals Work
How Git works under the hood: the four object types (blob, tree, commit, tag), content-addressable storage, refs and branches, the staging area (index), packfiles and delta compression, and merge strategies — with ASCII diagrams and source code walkthrough from the git/git repository.
-
LeetCode 207 Course Schedule
Solutions for LeetCode 207, medium, tags: depth-first search, breadth-first search, graph, topological sort.
-
LeetCode 735 Asteroid Collision
Solutions for LeetCode 735, medium, tags: array, stack, simulation.
-
System Design - How Linux epoll Works
How Linux epoll works: the evolution from select/poll, epoll's internal architecture with red-black trees and ready lists, level-triggered vs edge-triggered modes, and a source code walkthrough from the Linux kernel.
-
LeetCode 322 Coin Change
Solutions for LeetCode 322, medium, tags: array, dynamic programming, breadth-first search.
-
LeetCode 895 Maximum Frequency Stack
Solutions for LeetCode 895, hard, tags: hash table, stack, design, ordered set.
-
System Design - How Redis Persistence Works
How Redis persists data to disk: RDB snapshots via fork() and copy-on-write, AOF (Append Only File) logging, fsync policies, AOF rewriting, and the hybrid RDB+AOF approach. Source code walkthrough from the redis/redis repository.
-
LeetCode 39 Combination Sum
Solutions for LeetCode 39, medium, tags: array, backtracking.
-
System Design - How Linux Containers Work Under the Hood
How Linux containers work: namespaces for isolation, cgroups for resource limits, union filesystems for layered images, and how container runtimes like runc tie it all together.
-
LeetCode 72 Edit Distance
Solutions for LeetCode 72, medium, tags: string, dynamic programming.
-
LeetCode 128 Longest Consecutive Sequence
Solutions for LeetCode 128, medium, tags: array, hash table, union find.
-
System Design - RAM vs. cgroup Limit/Cap vs. RSS
A practical explanation of common memory terms: physical RAM, container cgroup memory limit/cap, and RSS (resident set size), with diagrams and examples for Linux systems.
-
System Design - How Rate Limiting Works
How rate limiting works: token bucket, leaky bucket, fixed window counter, and sliding window log/counter algorithms with ASCII diagrams, source code walkthrough from Nginx, Guava, and Redis, and practical trade-offs.
-
LeetCode 2452 Words Within Two Edits of Dictionary
Solutions for LeetCode 2452, medium, tags: array, string, trie.
-
System Design - How DNS Resolution Works
How DNS resolution works: the recursive and iterative query process, DNS record types, caching layers, TTL mechanics, and how the global DNS hierarchy routes billions of lookups every day.
-
LeetCode 907 Sum of Subarray Minimums
Solutions for LeetCode 907, medium, tags: array, dynamic programming, stack, monotonic stack.
-
LeetCode 300 Longest Increasing Subsequence
Solutions for LeetCode 300, medium, tags: array, binary search, dynamic programming.
-
LeetCode 15 3Sum
Solutions for LeetCode 15, medium, tags: array, two pointers, sorting, hash table.
-
LeetCode 33 Search in Rotated Sorted Array
Solutions for LeetCode 33, medium, tags: array, binary search.
-
System Design - How Database Query Optimization Works
How database query optimizers work: parsing SQL into trees, generating candidate plans, cost estimation, join ordering with dynamic programming and genetic algorithms, and a source code walkthrough of the PostgreSQL optimizer.
-
AI/ML - How the Transformer Attention Mechanism Works
How the Transformer attention mechanism works: intuition behind queries/keys/values, scaled dot-product attention, multi-head attention, positional encoding, and a source code walkthrough from PyTorch and the original paper.
-
LeetCode 230 Kth Smallest Element in a BST
Solutions for LeetCode 230, medium, tags: tree, depth-first search, binary search tree, binary tree.
-
LeetCode 347 Top K Frequent Elements
Solutions for LeetCode 347, medium, tags: array, hash table, divide and conquer, sorting, heap, bucket sort, counting, quickselect.
-
System Design - How the TLS Handshake Works
How TLS (Transport Layer Security) works: the handshake protocol, certificate verification, key exchange with Diffie-Hellman, symmetric encryption, TLS 1.2 vs 1.3, and a source code walkthrough from Go's crypto/tls package.
-
System Design - How Apache Kafka Works
How Apache Kafka works internally: the distributed commit log, partitions, replication with ISR, producer batching, consumer groups, zero-copy transfer, and source code walkthrough from the apache/kafka repository.
-
LeetCode 49 Group Anagrams
Solutions for LeetCode 49, medium, tags: array, hash table, string, sorting.
-
LeetCode 155 Min Stack
Solutions for LeetCode 155, medium, tags: stack, design.
-
System Design - How gRPC Works
How gRPC works under the hood: Protocol Buffers serialization, HTTP/2 framing, the four RPC patterns (unary, server streaming, client streaming, bidirectional), channel and transport architecture, interceptors, and a source code walkthrough from the grpc/grpc-go repository.
-
LeetCode 238 Product of Array Except Self
Solutions for LeetCode 238, medium, tags: array, prefix sum.
-
LeetCode 560 Subarray Sum Equals K
Solutions for LeetCode 560, medium, tags: array, hash table, prefix sum.
-
System Design - How Garbage Collection Works
How garbage collection works in practice: reference counting vs. tracing, mark-and-sweep fundamentals, tri-color marking, Go's concurrent collector, write barriers, GC pacing, and source code walkthrough from the Go runtime.
-
LeetCode 76 Minimum Window Substring
Solutions for LeetCode 76, hard, tags: hash table, string, sliding window.
-
LeetCode 416 Partition Equal Subset Sum
Solutions for LeetCode 416, medium, tags: array, dynamic programming, bit manipulation.
-
System Design - How Bloom Filters Work
How Bloom filters work: the probabilistic data structure behind fast membership testing in databases, with a source code walkthrough of LevelDB and RocksDB implementations.
-
LeetCode 42 Trapping Rain Water
Solutions for LeetCode 42, hard, tags: array, two pointers, dynamic programming, stack, monotonic stack.
-
System Design - How Skip Lists Work
How skip lists work: the probabilistic data structure behind Redis sorted sets, LevelDB memtables, and Java's ConcurrentSkipListMap. Covers the layered linked-list architecture, search/insert/delete algorithms, probabilistic balancing, and real-world source code walkthrough.
-
LeetCode 152 Maximum Product Subarray
Solutions for LeetCode 152, medium, tags: array, dynamic programming.
-
System Design - How MVCC (Multi-Version Concurrency Control) Works
How MVCC works in databases: the concurrency problem it solves, snapshot isolation, PostgreSQL's tuple versioning with xmin/xmax, MySQL InnoDB's undo log and ReadView, garbage collection, and source code walkthrough.
-
System Design - Kubernetes Pod Scheduling, Custom Schedulers, and Karpenter
How Kubernetes schedules pods: the default kube-scheduler's filter-score pipeline, the scheduling framework's extension points, custom schedulers (TiDB scheduler as case study), and how Karpenter complements scheduling by provisioning nodes.
-
System Design - Local Kubernetes with k3d for Development
How to set up a local Kubernetes cluster with k3d for development: cluster creation, port mapping with NodePort, Mac vs Linux access patterns, kubectl port-forward vs NodePort, and why ctr digest errors are harmless.
-
LeetCode 1848 Minimum Distance to the Target Element
Solutions for LeetCode 1848, easy, tags: array.
-
LeetCode 394 Decode String
Solutions for LeetCode 394, medium, tags: string, stack, recursion.
-
System Design - How B+ Trees Power Every Database Index
How B+ trees work: node structure, search, insertion with splits, deletion with merges, disk I/O optimization, and why virtually every relational database uses them for indexing.
-
System Design - How Write-Ahead Logging (WAL) Works
How Write-Ahead Logging (WAL) works: the core protocol behind database durability and crash recovery. Covers the WAL principle, record structure, buffer management, checkpoints, crash recovery, and a source code walkthrough from PostgreSQL.
-
LeetCode 56 Merge Intervals
Solutions for LeetCode 56, medium, tags: array, sorting.
-
LeetCode 215 Kth Largest Element in an Array
Solutions for LeetCode 215, medium, tags: array, divide and conquer, sorting, heap, quick select.
-
System Design - How LSM Trees Work (The Engine Behind RocksDB, LevelDB, and Cassandra)
How Log-Structured Merge Trees (LSM Trees) work: the write-optimized data structure behind RocksDB, LevelDB, Cassandra, and TiKV. Covers memtable, WAL, SSTables, compaction strategies, bloom filters, and a source code walkthrough from the facebook/rocksdb repository.
-
System Design - How Consistent Hashing Works
How consistent hashing works: the problem with naive hashing, the hash ring, virtual nodes, real-world usage in DynamoDB and Memcached, and a source code walkthrough of Go's jump consistent hash and ketama implementations.
-
LeetCode 200 Number of Islands
Solutions for LeetCode 200, medium, tags: array, depth-first search, breadth-first search, union find, matrix.
-
AI Machine Learning - Precision and Recall
artificial intelligence machine learning, understanding precision, recall, accuracy, confusion matrix, and the tradeoffs between them in classification problems
-
LeetCode 3 Longest Substring Without Repeating Characters
Solutions for LeetCode 3, medium, tags: hash table, string, sliding window.
-
LeetCode 378 LintCode 1272 Kth Smallest Element in a Sorted Matrix
Solutions for LeetCode 378 and LintCode 1272, medium, tags: array, binary search, heap, matrix.
-
LeetCode 3653 XOR After Range Multiplication Queries I
Solutions for LeetCode 3653, medium, tags: array, simulation.
-
Envoy Proxy: The Invisible Backbone of Microservices
system design basics - Envoy proxy, north-south vs east-west traffic, its operating modes, how it competes with Nginx, and its relationship with Istio.
-
System Design - Proxy vs Reverse Proxy
system design basics - forward proxy vs reverse proxy, differences, use cases, and examples
-
LeetCode 874 Walking Robot Simulation
Solutions for LeetCode 874, medium, tags: array, hash table, simulation.
-
LeetCode 631 Design Excel Sum Formula
Solutions for LeetCode 631, hard, tags: design, graph, depth-first search, topological sort.
-
LeetCode 721 Accounts Merge
Solutions for LeetCode 721, medium, tags: array, hash table, string, depth-first search, breadth-first search, union find, sorting.
-
System Design - How TiDB TSO (Timestamp Oracle) Works
How TiDB's Timestamp Oracle (TSO) works: architecture, 64-bit timestamp layout, allocation algorithm, etcd persistence, client batching, and source code walkthrough from the tikv/pd repository.
-
LeetCode 638 Shopping Offers
Solutions for LeetCode 638, medium, tags: array, dynamic programming, backtracking, bitmask, memoization.
-
LeetCode 1298 Maximum Candies You Can Get from Boxes
Solutions for LeetCode 1298, hard, tags: array, breadth-first search, graph.
-
LeetCode 1235 Maximum Profit in Job Scheduling
Solutions for LeetCode 1235, hard, tags: array, binary search, dynamic programming, sorting.
-
LeetCode 3212 Count Submatrices With Equal Frequency of X and Y
Solutions for LeetCode 3212, medium, tags: array, matrix, prefix sum.
-
LeetCode 1727 Largest Submatrix With Rearrangements
Solutions for LeetCode 1727, medium, tags: array, matrix, sorting.
-
LeetCode 1980 Find Unique Binary String
Solutions for LeetCode 1980, medium, tags: array, hash table, string.
-
Shamma Elite Warrios Sandals Review
Shamma Elite Warriors Sandals Review
-
Xero DIY Sandal Review
Xero DIY Sandal Review
-
System Design - Load Balancing
system design basics - load balancing
-
LeetCode 23 LintCode 104 Merge K Sorted Lists
Solutions for LeetCode 23 and LintCode 104, hard, tags: heap, divide and conquer, linked list, merge sort.
-
System Design - All about Caching
system design basics, all about caching (cache)
-
LeetCode 21 LintCode 165 Merge Two Sorted Lists
Solutions for LeetCode 21 and LintCode 165, easy, tags: heap, divide and conquer, linked list, merge sort, companies: microsoft
-
LeetCode 658 LintCode 460 Find K Closest Elements
Updated:Solutions for LeetCode 658 LintCode 460, medium, tags: array, binary-search, sliding-window, sorting, heap; companies: google.
-
LeetCode 2539 LintCode 3855 Count the Number of Good Subsequences
Solutions for LeetCode 2539 LintCode 3855, hard, tags: enumerate, string, hash table, math, combinatorics, counting.
-
System Design - How do Websockets Work
How do websockets work comparing to http? System Design Basics, websockets
-
LeetCode 2450 LintCode 3841 Number of Distinct Binary Strings After Applying Operations
Updated:Solutions for LeetCode 2450 LintCode 3841, medium, tags: math, string.
-
LeetCode 206 LintCode 35 Reverse Linked List
Solutions for LeetCode 206 LintCode 35, easy, tags: linked list, recursion; companies: bytedance.
-
LeetCode 1166 LintCode 3677 Design File System
Solutions for LeetCode 1166 LintCode 3677, medium, tags: hash table, trie, string, design.
-
How could we interview job candidates to find the right teammates? Why should we care?
Updated:how should we interview other job candidates to find the teammates we like? tips and suggestions on how to interview teammate or junior engineers.
-
LeetCode 2017 Grid Game
Solutions for LeetCode 2017, medium, tags: array, prefix sum, dynamic programming, matrix.
-
LeetCode 542 LintCode 974 01 Matrix and LeetCode 1765 Map of Highest Peak
Updated:Solutions for LeetCode 542, LeetCode 1765, and LintCode 974, hard, tags: array, queue, sliding window, heap, monotonic queue.
-
LeetCode 532 LintCode 1187 K-diff Pairs in An Array
Solutions for LeetCode 532 LintCode 1187, medium, tags: array, hash table, counting, two-pointers, binary-search; companies: nvidia, amazon.
-
LeetCode Meeting Rooms Derivative Question
Solutions for meeting rooms derivative question, hard, tags: heap, line sweep, ordered map; companies: salesforce.
-
LeetCode 1400 Construct K Palindrome Strings
Updated:Solutions for LeetCode 1400, medium, tags: hash table, string, greedy, counting.
-
LeetCode 916 LintCode 1726 Word Subsets
Solutions for LeetCode 916 LintCode 1726, medium, tags: array, hash table, string.
-
System Design - Event Loop for Concurrent Applications
event loop system design pattern/construct event loop (message dispatcher), reactor/actor pattern, non-blocking mechanism for concurrent applications
-
LeetCode 1930 Unique Length-3 Palindromic Subsequences
Updated:Solutions for LeetCode 1930, medium, tags: hash table, string, bit manipulation, prefix sum.
-
GeeksForGeeks Minimum Replacements/Substitutions to Make Adjacent Characters Unequal
Solutions for , easy, tags: array, sliding window; companies: salesforce.
-
LeetCode 2559 Count Vowel Strings in Ranges
Solutions for LeetCode 2559, medium, tags: array, string, prefix-sum.
-
LeetCode 1422 Maximum Score After Splitting a String
Updated:Solutions for LeetCode 1422, easy, tags: string, prefix sum.
-
Programmer Strings
Solutions for Programmer Strings, hard, tags: string, hash table.
-
LeetCode 2466 LintCode 3854 Count Ways to Build Good Strings (Number of Good Binary Strings)
Updated:Solutions for LeetCode 2466 LintCode 3854, medium, tags: array, dynamic programming.
-
Java CheatSheet
Updated:tips for using java
-
LeetCode 875 LintCode 1492 Koko Eating Bananas
Solutions for LeetCode 875 LintCode 1492, medium, tags: array, binary search; companies: facebook, salesforce.
-
LeetCode 423 LintCode 1247 Reconstruct Original Digits from English
Updated:Solutions for LeetCode 423 LintCode 1247, medium, tags: hash table, simulation, math, string.
-
LeetCode 2415 Reverse Odd Levels of Binary Tree
Updated:Solutions for LeetCode 239, hard, tags: array, queue, sliding window, heap, monotonic queue.
-
LintCode 2503 Thread Safe Counter (Concurrency)
Solutions for LintCode 2503, tags: lock, re-entrant lock.
-
LeetCode 691 LintCode 1081 Stickers to Spell Word
Solutions for LeetCode 239, hard, tags: array, queue, sliding window, heap, monotonic queue.
-
LeetCode 339 LintCode 551 Nested List Weight Sum
Solutions for LeetCode 339 LintCode 551, medium, tags: dfs, bfs; companies: salesforce.
-
Analyze Recursive Algorithm Time Complexity for LeetCode Questions with Substitution, Recursion Tree and Master Theorem
Analyze Recursive Algorithm Time Complexity for LeetCode Questions with Substitution, Recursion Tree and Master Theorem
-
Generative AI (Artificial Intelligence) with Large Language Models (LLM) - Part 1
Updated:generative AI (artificial intelligence) machine learning with large language models
-
LeetCode 994 LintCode 3726 Rotting Oranges
Solutions for LeetCode 994 LintCode 3726, medium, tags: graph, bfs, array; companies: tiktok.
-
LeetCode 520 LintCode 1202 IPO
Solutions for LeetCode 520 LintCode 1202, hard, tags: array, heap, greedy, sorting, binary search, dynamic programming, quick select.
-
Rust Option, Rc, and RefCell Explained - LeetCode Tree Node and LinkedList Node
Explanation for rust data structure for tree node and linked list node. What is Rc and RefCell? Why Option<Rc<RefCell>>> three wrappers? How to avoid circular reference?
-
LeetCode 2558 Take Gifts From the Richest Pile
Solutions for LeetCode 2558, easy, tags: array, heap, simulation.
-
LeetCode 713 LintCode 1075 Subarray Product Less Than K
Solutions for LeetCode 713 and LintCode 1075, medium, tags: sliding window, two pointers, prefix sum; companies: salesforce, yatra.
-
LeetCode 1650 LintCode 474 Lowest Common Ancestor of a Binary Tree III
Solutions for LeetCode 1650 LintCode 474, medium, tags: binary tree, hash table, two pointers; companies: microsoft.
-
LeetCode 408 LintCode 637 Valid Word Abbreviation
Solutions for LeetCode 408 LintCode 637, easy, tags: two pointers, string, companies: facebook, google.
-
AWS (Amazon Web Services) Tips and Cheatsheet
Updated:tips for using AWS
-
LintCode 26 Inner Product
Solutions for LintCode 26, hard, tags: dynamic programming.
-
How to Draw Circles and Arcs with Python Library Matplotlib
Updated:tips for matplotlib python draw arcs, robot walks, project euler 208
-
LeetCode 540 LintCode 1183 Single Element in a Sorted Array
Solutions for LeetCode 540 LintCode 1183, medium, tags: array, binary search.
-
Linux Cheatsheet, tips and Commands
Updated:tips for linux commands and tips
-
LeetCode 1 LintCode 56 Two Sum
Solutions for LeetCode 1 LintCode 56, easy, tags: array, hash table.
-
Robot Walks and Project Euler 208 Solutions
Solutions for Project Euler 208 and robot walks, hard, tags: math, simulation.
-
LeetCode 53 LintCode 41 Maximum Subarray
Solutions for LeetCode 53 and LintCode 41, medium, tags: array, divide and conquer, dynamic programming, prefix sum, companies: ltk.
-
How to Install SortedContainers in the Python Shell or With a Python Script
Updated:tips for installing sortedcontainers in a python shell
-
LeetCode 1041 LintCode 1345 Robot Bounded in Circle
Updated:Solutions for LeetCode 1041 LintCode 1345 GFG, medium, tags: math, string, simulation, companies: linkedin, salesforce.
-
LintCode 3127 How Many Times is Two Squared?
Solutions for LintCode 3127, easy, tags: math, bit.
-
LeetCode 1346 Check If N and Its Double Exist
Updated:Solutions for LeetCode 1346, easy, tags: array, hash table, two pointers, binary search, sorting.
-
Cheatsheet for Math Knowledge Needed for LeetCode Algorithm Questions (Geometric Series and Arithmetic Progression Sum)
cheatsheet for math knowledge needed for leetcode algorithm questions, geometric series sum
-
Bitwise Xor Operations
Solutions for bitwise xor operations, medium, tags: bit, companies: salesforce.
-
Fun Bit Tricks (Manipulations)
Fun bitwise tricks such as count set bits, negate, ilog2, xor swap, .etc.
-
LeetCode 3167 Better Compression
Updated:Solutions for LeetCode 3167 Better Compression, tags: string, hash table, companies: salesforce.
-
LeetCode 214 LintCode 678 Shortest Palindrome (GeeksForGeeks Minimum Insertion to Form Shortest Palindrome)
Updated:Solutions for LeetCode 239, LintCode 678, medium, tags: two pointers, string, kmp, rabin-karp, rolling hash.
-
LeetCode 146 LintCode 134 LRU Cache
Solutions for LeetCode 146 LintCode 134, medium, tags: hash, linked list, design, doubly linked list, companies: amazon, openai.
-
LeetCode 487 LintCode 883 Max Consecutive Ones II
Solutions for LeetCode 487, LintCode 833, medium, tags: array, dynamic programming, sliding window, two pointers, companies: google.
-
LeetCode 1 Similar Two Subtract Count
Solutions for LeetCode 1 similar, medium, tags: array, hash table, companies: salesforce.
-
LeetCode 811 LintCode 1006 Subdomain Visit Count
Solutions for LeetCode 811 and LintCode 1006, medium, tags: array, hash, string, counting, companies: salesforce.
-
LeetCode 1804 LintCode 3729 Implement Trie II
Updated:Solutions for LeetCode 1804 LintCode 3729, medium, tags: design, trie, hash, string.
-
Reverse of LeetCode 38 LintCode 420 Count and Say (Look and Say)
Updated:Solutions for LeetCode 38, LintCode 420, medium, tags: math, string, simulation, companies: facebook, pinterest.
-
LeetCode 38 LintCode 420 Count and Say (Look and Say)
Updated:Solutions for LeetCode 38, LintCode 420, medium, tags: math, string, simulation, companies: facebook, pinterest.
-
How to Embed an SVG Image/Picture with the Code or File on a Website
three main ways to embed an SVG image or picture as a file or using html code on a website
-
Vim CheatSheet
Updated:tips for using vim
-
LeetCode 465 LintCode 707 Optimal Account Balancing
Updated:Solutions for LeetCode 465 LintCode 707, hard, tags: bit, array, dynamic programming, backtracking, bitmask.
-
Elevator Closest Floors (Shortest Path, Related to Shortest Seek Time First Disk Seek Algorithm)
Updated:Solutions for Elevator Shortest Path, medium, tags: array, binary search.
-
LeetCode 2257 Count Unguarded Cells in the Grid
Updated:Solutions for LeetCode 2257, medium, tags: array, graph, simulation.
-
How to Mark All as Read for Google Voice
Updated:tips for using google voice, mark all as read
-
LeetCode 2461 Maximum Sum of Distinct Subarrays With Length K
Updated:Solutions for LeetCode 2461, medium, tags: array, sliding window, hash.
-
LeetCode 1652 Defuse the Bomb
Updated:Solutions for LeetCode 1652, easy, tags: array, sliding window.
-
LeetCode 1055 LintCode 3652 Shortest Way to Form String
Solutions for LeetCode 1055 LintCode 3652, hard, tags: greedy, two pointers, string.
-
LintCode 2894 Order by frequency
Updated:Solutions for LintCode 2894, medium, tags: map, sort. Related to LeetCode 884 and 451.
-
LeetCode 862 LintCode 1507 Shortest Subarray with Sum at Least K
Updated:Solutions for LeetCode 862, LintCode 1507, hard, tags: array, queue, sliding window, heap, monotonic queue, binary search, prefix sum.
-
LeetCode 3254 Find the Power of K-Size Subarrays I
Updated:Solutions for LeetCode 3254, medium, tags: array, sliding window.
-
LeetCode 125 LintCode 415 Valid Palindrome
Updated:Solutions for LeetCode 125, LintCode 415, easy, tags: two pointers, string. Companies: LinkedIn, Facebook, Uber, Zenefits, Microsoft.
-
LeetCode 1930 Unique Length-3 Palindromic Subsequences
Updated:Solutions for LeetCode 1930, medium, tags: hash, string, bit, prefix sum.
-
LeetCode 2064 Minimized Maximum of Products Distributed to Any Store
Updated:Solutions for LeetCode 2064, medium, tags: array, binary search, heap.
-
LeetCode 2563 Count the Number of Fair Pairs
Updated:Solutions for LeetCode 2563, medium, tags: array, two pointers, binary search, sorting.
-
LeetCode 3043 Find the Length of the Longest Common Prefix
Updated:solutions for LeetCode 3043, hard, tags: trie, string, array, hash.
-
LintCode 179 Update Bits (bit)
Updated:solution for lintcode 179 update bits, tags: bit
-
Add Discord and Disqus to your web site
Updated:add discord and disqus to this site
-
LeetCode 314 LintCode 651 Binary Tree Vertical Order Traversal
Updated:solutions for LeetCode 314 LintCode 651 Binary Tree Vertical Order Traversal, tags: hash, bfs, tree, companies: facebook google
-
LeetCode 1192 LintCode 1271 Critical Connections in a Network
Updated:solutions for LeetCode 1192, LintCode 1271, hard, tags: dfs, graph, bi-connected component. Companies: Amazon.
-
LeetCode 239 LintCode 362 Sliding Window Maximum
Updated:solutions for LeetCode 239, LintCode 362, hard, tags: array, queue, sliding window, heap, monotonic queue. Companies: Amazon, Zenefits, Microsoft, Google.
-
LeetCode 1574 Shortest Subarray to be Removed to Make Array Sorted
Updated:Solutions for LeetCode 1574, medium, tags: array, binary-search, two-pointers.
-
LeetCode 3133 Minimum Array End (bit)
Updated:Solution for leetcode 3133 Minimum Array End, tags: bit
-
LeetCode 3097 Shortest Subarray With OR at Least K II (bit)
Updated:solution for leetcode 3097 Shortest Subarray With OR at Least K II, tags: bit, sliding-window, array
-
LeetCode 20 LintCode 423 Valid Parentheses (stack)
Updated:solution for LeetCode 20 LintCode 423 valid parentheses, tags: stack, string; companies: goldman sachs, twitter, airbnb, amazon, facebook, microsoft, bloomberg, uber, google.
-
Database (MongoDB, Microsoft SQL Server) CheatSheet
Updated:tips for using databases including mongodb, microsoft sql server, mysql
-
CheatSheet for Windows Development
Updated:tips for software development in Windows Operating System
-
Cheatsheet for Python Data/AI Projects (Conda, Docker, Jupyter Notebook)
Updated:tips and cheatsheet for python data/AI projects using conda, docker, and jupyter notebook
-
Mac Tips and Great Apps
Updated:tips for using mac