Archives
All the articles I've archived.
-
LeetCode 525 Contiguous Array
Solutions for LeetCode 525, medium, tags: array, hash table, prefix sum.
-
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.
-
System Design - How Raft Consensus Works
How the Raft consensus algorithm works: leader election, log replication, safety guarantees, membership changes, and source code walkthrough from the etcd/raft implementation.
-
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.
-
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.
-
LeetCode 739 Daily Temperatures
Solutions for LeetCode 739, medium, tags: array, stack, monotonic stack.
-
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.
-
HackerRank and 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.
-
HackerRank Programmer Strings
Solutions for HackerRank 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.
-
HackerRank Robot Walks and Project Euler 208 Solutions
Solutions for project euler 208 and hackerrank question 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 (GeeksForGeeks, HackerRank EnCircular)
Updated:Solutions for LeetCode 1041 LintCode 1345 GFG HackerRank, 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.
-
LeetCode 91 Decode Ways and Hacker Rank ASCII Encoded Strings (VMWare, Goldman Sachs, and Salesforce Interview Questions)
Solutions for LeetCode 91, medium, tags: string, dynamic programming, companies: goldman sachs, vmware, salesforce.
-
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
-
HackerRank Bitwise Xor Operations
Solutions for hackerrank 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 HackerRank Better Compression
Updated:Solutions for LeetCode 3167 HackerRank 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