This article explains the classic House Robber interview question, detailing the problem constraints, illustrating why a naive alternating‑house approach fails, and presenting a clear dynamic‑programming solution with recurrence, base cases, and a concise code example.
This article introduces the fundamentals of directed acyclic graphs (DAGs), explains adjacency representations, details the Dagre layout algorithm’s concepts, computation steps, and constraints, and presents the Perfect‑Process front‑end library that implements these techniques for interactive pipeline diagram rendering and editing.
Rate limiting protects services from overload by controlling traffic, using techniques such as circuit breaking, degradation, buffering, privilege handling, and algorithms like counters, leaky bucket, and token bucket, with implementations ranging from Guava in Java to Nginx+Lua for distributed systems.
This article explores how to solve a common interview coding challenge—implementing a square‑root function without using library calls—by discussing problem analysis, linear and binary‑search approaches, optimization techniques, testing strategies, and the broader skills interviewers aim to assess.
This article explains the principles of BitMap, BitSet, and Bloom Filter data structures, illustrating how they use bits to efficiently store, add, delete, and query large sets of integers, and discusses their practical applications such as fast sorting, deduplication, and membership testing.
This article compiles a series of backend interview questions covering HTTP header fields, HTTPS handshake, TCP connection states, virtual and physical memory concepts, TCP connection limits, Eureka architecture and consistency, Hystrix fault‑tolerance mechanisms, Zookeeper's Zab protocol and leader election, and provides a Java solution for finding the longest substring without repeating characters.
This article presents a classic monkey‑and‑peach puzzle, derives the minimal initial peach count using mathematical reasoning, and then demonstrates a brute‑force Python program that searches for the solution, illustrating how loops and modular checks solve the problem.
This tutorial shows how to create a Tetris mini‑game with AI using a straightforward algorithm, Python 3.6, PyQt5, and detailed code that evaluates board states based on cleared lines, holes, heights, and other metrics to select optimal moves.
This article explains why rate limiting is needed in both physical venues and online systems, describes common limiting strategies such as circuit breaking, service degradation, delayed processing, and privileged handling, and details three major algorithms—counter, leaky bucket, and token bucket—along with practical Java and Nginx‑Lua code examples.
This article presents a classic stock‑like profit maximization problem using mooncake prices, explains the input and expected output, and walks through three solution strategies—brute‑force enumeration, a greedy linear scan, and a dynamic‑programming approach—complete with Go code examples and visual illustrations.
This article explains the merge sort algorithm’s divide‑and‑conquer principle, analyzes its O(n log n) time complexity, and provides two complete C# code examples—one for a generic merge sort and another for merging two already sorted arrays—along with visual illustrations of the merging process.
This article presents five programming problems from Hulu's 2022 campus recruitment—including particle simulation, Sophie‑N number counting, optimal activity point on a tree, devil‑maze navigation, and non‑intersecting triangles—complete with problem statements, input/output specifications, sample cases, and detailed solution approaches.
This article explains the concepts, strategies, and algorithms of rate limiting—including circuit breaking, service degradation, leaky‑bucket and token‑bucket methods—and provides practical Java, Guava, and Nginx + Lua implementations for controlling concurrency and protecting backend services.
This article presents a PHP implementation of Redis-based rate limiting, explaining how to limit the number of requests per time interval by using timestamp-modulo keys, atomic increment operations, and key expiration, along with detailed code and step-by-step commentary.
Alibaba Mama’s talk explains how calibrated probability models—evolving from simple Platt scaling to Bayesian isotonic regression and real‑time wave‑adjusted variants—improve click‑through and conversion predictions, enabling more accurate bidding, stable auctions, and fairer ad allocation despite data drift and sparsity.
This article explains how to determine whether a singly linked list contains a cycle using the fast‑slow pointer technique, derives the mathematical reasoning for locating the cycle entry point, and provides a complete Java implementation that returns the node where the cycle begins or null if none.
This article explains the role and data structure of Memtable in LevelDB, introduces the probabilistic SkipList design, analyzes its time and space complexities, and provides a full Java implementation of a SkipListMap with code examples and a brief look at LevelDB's own SkipList implementation.
This article explains the Least Frequently Used (LFU) cache eviction strategy, contrasts it with LRU, and provides a complete Java implementation—including node definition, insertion, sorting, removal, and retrieval logic—along with a test scenario and discussion of LFU's drawbacks.
This article presents a collection of concise Python one‑liners—ranging from creating 2‑D lists and clamping numbers to generating Fibonacci sequences and converting strings to snake_case—each explained with clear code examples and practical use cases for everyday programming tasks.
This article explains why rate limiting is essential for system stability, compares it with caching and degradation, details three core algorithms—counter, leaky bucket, and token bucket—and provides concrete Guava, Java, and Nginx + Lua code examples for implementing both local and distributed throttling.
This article explains how Redis implements the “nearby people” feature using its Geo module, detailing the GEOADD and GEORADIUS commands, their underlying algorithms, source‑code flow, and the resulting time‑complexity for adding and querying location data.
This article explores how to identify a single poisonous bottle among 1,000 using the fewest rabbits and the shortest time by analyzing pure‑time, pure‑space, balanced strategies, and finally applying binary encoding to solve the classic interview puzzle in just one day.
This article explains the classic circular gas‑station challenge, presents its key constraints, walks through a concrete example, and compares three solution strategies—brute‑force, reverse (backtrack) greedy, and a cumulative‑sum graphical method—highlighting their trade‑offs and insights.
This article explains why rate limiting is essential for high‑availability services, describes HTTP 429 standards and response headers, classifies rate‑limiting strategies by granularity, target, and algorithm, and provides detailed Go code examples using the time/rate library for fixed‑window, sliding‑window, leaky‑bucket, and token‑bucket implementations.
This article presents a classic river‑crossing puzzle where three people and three ghosts must use a two‑seat boat without ever letting ghosts outnumber people on either bank, detailing the analysis, each crossing round, and the logical search strategy to solve it.
This article explores the HyperLogLog algorithm for cardinality estimation, tracing its development from Linear and LogLog counting, detailing its Redis implementation with sparse and dense encodings and command workflows, and presenting experiments that demonstrate its memory efficiency and analyze observed error rates versus the theoretical 0.81% standard deviation.
This article explains heap sort's time and space complexities, introduces max‑heap and min‑heap concepts, details the algorithmic steps for building and maintaining the heap, and provides a complete Java implementation with accompanying code examples.
This article explores a classic puzzle where one must locate a single poisonous bottle among 1000 using rabbits as testers, comparing time‑focused, space‑focused, and balanced strategies before revealing an optimal binary‑encoding solution that finds the poison in one day with just ten rabbits.
This article explains the fundamental concept of recursion using a cinema‑seat analogy, demonstrates array‑sum and Fibonacci implementations in JavaScript, shows how to visualize recursive calls, discusses stack‑overflow and redundant computation issues, and presents iterative and memoized alternatives.
This article details a technical approach to automatically generating stroke order animation data for Chinese characters from standard font files, covering SVG rendering, coordinate transformations, deep learning-based stroke decomposition, and CSS animation techniques.
An in‑depth look at how mattsta’s CRCSpeed implementation replaced Redis’s original CRC algorithm, delivering up to four‑fold speed gains, the history of its development from 2014 to its 2020 integration, and the performance impact on RDB generation and cluster slot hashing.
An ecosystem‑wide intelligent promotion system applies a budget‑pacing algorithm with probabilistic throttling and fine‑ranking score adjustments in 5‑minute slots, guaranteeing uniform video exposure while minimizing impact on overall consumption, boosting daily exposure completion from under 5 % to up to 70 % and reducing watch‑time loss.
This article explains how to implement a missile auto‑tracking system in a 2D shooting game using Python and Pygame, covering the underlying differential‑equation‑based algorithm, step‑by‑step calculations, handling of coordinate systems, and code for rotation and rendering.
This article walks through the classic “pick‑from‑both‑ends” apple game, analyzing why greedy choices fail, and presents recursive, memoized, and dynamic‑programming solutions in Go, complete with code examples and step‑by‑step explanations to help you determine the winning strategy.
The Vivo Internet Server Team extended TARS with a dynamic load‑balancing algorithm that recalculates each node’s weight every minute using metrics such as 5‑minute average response time, timeout and exception rates, CPU, memory and network load, automatically adapting traffic distribution beyond the built‑in round‑robin, weighted round‑robin and consistent‑hash methods.
This article details how Qingteng FM’s recommendation system progressed from manual curation to strategy‑based and personalized recommendations, explains the multi‑stage algorithm pipeline, describes the three‑layer deployment architecture, and outlines future challenges and opportunities in audio content recommendation.
This article introduces common rate‑limiting algorithms—counter, sliding‑window, leaky bucket, and token bucket—explains their principles, compares their advantages and drawbacks, and provides Java code examples, including how Sentinel 1.8.0 implements each technique using structures such as LeapArray and WarmUpController.
This article walks through the fundamentals of red‑black trees, explains their equivalence to 2‑3‑4 trees, details insertion and deletion algorithms, and shares practical debugging techniques to help readers implement and understand this complex balanced binary search tree.
This article walks through the fundamentals of red‑black trees, explains their equivalence to 2‑3‑4 trees, details insertion and deletion rules, compares their performance to plain binary search trees, and shares practical debugging tips for implementing a balanced tree in code.
This article explains the concept of full permutations, presents a classic interview problem requiring all permutations of a distinct integer array, and walks through a backtracking solution in Java with detailed step‑by‑step analysis and code examples.
This article explains the stack data structure, its LIFO characteristics, typical applications such as bracket matching, expression evaluation, next‑greater‑element problems, browser navigation, and JavaScript execution contexts, and provides clear JavaScript code examples for each scenario.
This article compiles a detailed set of 66 classic algorithm and data‑structure interview questions, each accompanied by problem statements, analysis of possible solutions, and illustrative code snippets, providing a valuable resource for developers preparing for technical interviews.
This article introduces the core concepts of algorithms, covering their definition, five essential properties, design principles such as correctness and readability, methods for analyzing time and space complexity, common complexity classes, and a variety of algorithmic strategies including recursion, dynamic programming, greedy and divide‑and‑conquer techniques.
This article presents a curated collection of 69 frequently asked algorithm and data‑structure interview questions, each accompanied by concise English explanations, solution ideas, and illustrative diagrams to help readers master core programming concepts and improve their interview performance.
This article introduces the fundamentals of bitwise operations, explains each operator with clear rules and examples, demonstrates practical tricks such as parity checks and value swapping, and walks through classic interview problems—including addition without arithmetic, counting set bits, and finding unique numbers—complete with Java code snippets and visual illustrations.
Given an array where each element indicates the maximum jump length from that position, this article explores multiple strategies—depth‑first search, dynamic programming, greedy, and reverse‑tracking—to determine whether the frog can reach the last board, comparing their efficiency and implementation details.
The author recounts a full Google China interview experience—including resume submission, recruiter prescreen, phone and onsite coding rounds, HR and English interviews, lunch with engineers, and final feedback—while sharing practical advice and insights to help future candidates prepare effectively.
This article explains what rate limiting is, why it is needed, the typical actions taken when limits are reached, compares single‑node and distributed architectures, reviews four classic limiting algorithms, and provides a practical Redis‑Lua token‑bucket implementation with code examples.
This article presents detailed explanations, algorithmic ideas, and complete Go code for reversing an entire singly linked list, reversing a sub‑list between positions m and n, finding the intersection node of two lists, detecting cycles, and partitioning a list around a pivot value.
This article explains the bitmap concept, demonstrates how to store and query billions of integers using bit-level operations, introduces BitSet for dynamic bit vectors, and describes Bloom filters as probabilistic structures for fast, memory‑efficient membership testing in large‑scale data scenarios.
To boost Xianyu’s user retention, the team built a long‑term promotion platform that combines configurable operational activities with algorithmic SPU recommendations, using Kunpeng extension points, supply‑demand analysis, and conditional search to personalize seller prompts, improve click‑through, and lay groundwork for broader scenario expansion.
This article explains the fundamentals of consistent hashing, compares the classic ring‑based method with the more efficient jump consistent hash algorithm, provides reference implementations in C++, discusses their time‑complexity and practical trade‑offs, and shows how they are applied in systems such as Greenplum.
Given a four‑wheel combination lock with digits 0‑9, the task is to find the minimum number of rotations needed to reach a target combination while avoiding a list of dead‑end states, using a breadth‑first search algorithm illustrated with Java code examples.
This article explains recursive functions, their call mechanics, and demonstrates Python examples for calculating factorials and Fibonacci numbers, highlighting advantages, stack‑overflow risks, and the lack of tail‑recursion optimization in the standard interpreter.
Optical fingerprint sensors capture ridge patterns via illuminated light through an under‑display lens, offering full‑screen designs but facing challenges like incomplete presses, lighting failures, and dirty or wet fingers, while Gabor filter preprocessing enhances image texture to improve recognition robustness and guide future hardware‑algorithm improvements.
This article explains the principles and implementation of Simhash, covering the shortcomings of traditional hash functions, the use of cosine similarity, random projection for dimensionality reduction, locality‑sensitive hashing, and practical optimizations for large‑scale duplicate detection.
The article presents a comprehensive six‑map framework for digital transformation—strategic, business, demand, application, algorithm, and data maps—explaining how enterprises can systematically align goals, processes, requirements, technologies, models, and data assets to achieve effective, data‑driven change.
This article uses the occasion of Tree‑Planting Day to explain binary trees in simple terms, covering their definition, node types, degree, levels, five tree shapes, traversal methods (pre‑order, in‑order, post‑order, level‑order), advantages, drawbacks, and a brief comparison with binary search.
This article explains how to identify "lucky numbers"—elements whose value equals their frequency—in a list by progressively applying Python fundamentals such as set for deduplication, count, map, zip, filter, lambda and sorted, culminating in a concise one‑liner solution.
This article explains the Manhattan routing algorithm used for automatic orthogonal connection routing in diagram tools, discusses its origins, references useful libraries like draw2d, and provides a full TypeScript implementation with code examples and practical application scenarios.
This article presents a comprehensive technical guide on applying Levenshtein and Damerau‑Levenshtein automata to efficiently solve the problem of fast similar‑string lookup in search‑engine systems, introducing novel DFA construction algorithms, theoretical correctness proofs, and practical implementation details with Java code examples.
The paper presents an AB‑testing platform that structures experiments into scenes, buckets, layers and traffic, uses a salted‑hash based allocation and a two‑step “multi‑withdraw‑fill” algorithm to adjust percentages while preserving user‑experiment stability, and describes a lightweight, cache‑centric system architecture with staggered config reloads and safeguards against database spikes and zombie nodes.
This article introduces the business background and security challenges of 58.com, explains the three‑layer intelligent risk‑control architecture built on big‑data and AI, and details practical methods for perceiving and detecting unknown risks using techniques such as PU learning, Prophet, and HotSpot.
This article reviews the 2020 achievements of Alibaba.com’s ICBU algorithm team, explaining the evolving role of algorithm engineers, the fundamentals of e‑commerce algorithms, the team’s three‑pillar workflow of Understanding, Growth, and Matching, and the technical breakthroughs that drove business impact and future directions.
This article explains a method for detecting video stutter by converting uploaded videos into frame sequences with ffmpeg, calculating pixel differences between consecutive frames, aggregating motion metrics, removing scene‑change effects, computing a dynamic factor, and outputting a binary result indicating the presence or absence of stutter.
This article explains how to limit the number of requests an IP can make to a specific API endpoint within a sliding time window using Redis list structures in PHP, including example scenario, implementation logic, and complete code snippets.
This article explains the fundamentals of rate limiting, its importance for high‑availability services, various classification dimensions, common algorithms such as fixed‑window, sliding‑window, leaky‑bucket and token‑bucket, and demonstrates practical usage with Go's golang.org/x/time/rate library including code examples and configuration tips.
This article explains several Java techniques—including a simple loop, String.split, and regular‑expression approaches—to compute the maximum number of consecutive '1' characters in a binary string, and even extends the method to handle mixed‑character inputs.
This article explains the core concepts of recursion by walking through an array‑sum example and a LeetCode linked‑list removal problem, detailing the necessary base case, recursive formula, and providing complete Java implementations with step‑by‑step visual illustrations.
This article explains Twitter's Snowflake algorithm, detailing its 64‑bit structure, the role of each bit segment, a step‑by‑step Java implementation, and the algorithm's performance advantages and practical limitations in distributed backend systems.
This article explains load‑balancing fundamentals, covering hardware vs. software devices, server‑side and client‑side balancing, and walks through common algorithms—random, weighted random, round‑robin, weighted and smooth weighted round‑robin, hash, consistent hash with virtual nodes, and least‑connection—each illustrated with Java code examples and diagrams.
This tutorial presents thirty concise Python tasks—ranging from duplicate detection and anagram checking to list chunking, dictionary merging, and execution timing—each accompanied by clear explanations and ready‑to‑run code snippets, enabling beginners to solidify fundamental concepts through hands‑on practice.
This article explains how to solve LeetCode's "Add Two Numbers" problem by representing integers with reversed linked lists in Java, detailing both an iterative method and a recursive solution, complete with code examples and analysis of time and space complexities.
This article explains the fundamentals of recommendation systems, covering data collection, user and content profiling, system architecture, algorithmic pipelines such as recall, filtering, ranking, and evaluation metrics, while also discussing practical challenges like echo chambers and long‑term user value.
From the rise and fall of Flash to modern front‑end video playback techniques, performance optimization strategies, AI recommendation fundamentals, CLI design best practices, and a glimpse into game development and algorithm analysis, this article surveys diverse cutting‑edge technologies shaping today’s software landscape.
This article explains the cardinality‑counting problem behind DAU/MAU and unique visitor metrics, compares naïve solutions like Set, Bitmap and Bloom filter, introduces big‑data algorithms such as Linear Counting, LogLog and HyperLogLog, and shows how Redis implements HyperLogLog with dense and sparse storage optimizations.
This article explains what Armstrong (narcissistic) numbers are, demonstrates how to determine them for three‑digit, n‑digit, and range‑based cases, and provides clear Python code examples with sample outputs to help readers grasp the concept and implement the checks.
The article analyzes how to update the positions of intermediate points on a wire when the user drags the wire with the mouse, compares three solution approaches—including point‑wise rotation and scaling, a complex geometric construction, and a unified transformation matrix—and summarizes their trade‑offs.
This article provides a comprehensive analysis of the Soul social app, examining its non‑hormonal positioning, community atmosphere, relationship‑chain metrics, content‑driven engagement, algorithmic matching, and future growth strategies, highlighting how these factors drive user retention and scale.
This article revisits Jump Consistent Hash, analyzes the O(n) bottleneck of the original algorithm, derives a probability‑based selection method that achieves O(log n) complexity, and provides a Go implementation demonstrating the optimized approach.
This article explains heap sort by introducing its theory, visual step‑by‑step construction of a max‑heap, a complete Python implementation, and an analysis of its time and space complexities, including detailed code walkthrough and complexity derivations.
The article explains how to use a circular doubly‑linked list together with a Union‑Find (disjoint‑set) structure to merge electrically equivalent points, split a circuit graph into connected sub‑graphs, and provides a full TypeScript implementation with practical considerations.
This article introduces a straightforward Java implementation of a sliding‑window rate‑limiting algorithm for single‑machine use, explains its core logic, demonstrates its behavior with sample output, and visualizes the step‑by‑step process of how timestamps are managed within the window.
This article describes a video stutter detection method that converts video to a frame sequence, computes pixel differences between consecutive frames, aggregates motion energy, applies scene‑cut compensation and a dynamic threshold to output a binary indicator of stutter presence.
This article uses the popular Chinese card game Three Kingdoms to illustrate the Byzantine Generals Problem, explaining its relevance to distributed consensus, outlining four foundational theories and eight protocols, and demonstrating how voting, message tampering, and signature mechanisms affect agreement among nodes.
AlgorithmByzantine Fault ToleranceDistributed Systems
The article compares an adjacency‑list approach and a circular doubly linked list for representing circuit connections, showing that the linked‑list method achieves O(1) connect/disconnect operations with linear space, making it the most efficient and simple solution for graph‑based circuit modeling.
This article introduces recursion, explains its core principles, presents a general problem‑solving approach, and walks through multiple practical examples—from factorial and climbing stairs to binary tree inversion and the Tower of Hanoi—while analyzing time and space complexities and offering optimization techniques.
This article explains a promotional bottle‑exchange problem, presents example inputs and outputs, and demonstrates two greedy‑algorithm implementations in Java that compute the maximum number of bottles one can drink when empty bottles can be exchanged for new ones.
In this live talk, Dr. Zhang Renyu, an assistant professor at NYU Shanghai and economist at Kuaishou, presents his research on optimizing cold-start problems in feed advertising using a novel Shadow Bidding with Learning (SBL) algorithm, detailing its design, implementation, and experimental results.
On November 7, 2020, Hulu’s Shulei presented how the company’s video advertising platform employs AI-driven algorithms—including binge‑watch prediction, inventory forecasting with Prophet, and a PID‑controller based real‑time allocation system—to enhance targeting, optimize revenue, and improve user experience.
This article explains the O(log N) efficiency of binary search, provides a clear template implementation in code, highlights common pitfalls, and presents two useful variants for finding the first equal or first greater‑or‑equal element in a sorted array.
This article explains how the classic PID feedback control algorithm can be adapted to regulate advertising bidding costs, describing its theory, component effects, practical implementation in a real‑time ad‑exchange, simulation experiments, and the resulting improvements in budget adherence and cost stability.
The article explains how to sort a massive 4.6 GB file containing 500 million random integers by first attempting in‑memory quicksort and merge sort, then using a bitmap approach, and finally applying an external sort that splits the data into manageable chunks and merges them efficiently.
This article explains why data consistency is essential in distributed systems, defines consistency, compares strong and eventual consistency, and details the design and operation of major algorithms such as Paxos, Multi‑Paxos, Raft, ZAB, and Gossip with illustrative examples and diagrams.
This article examines JD.com’s transition from traffic‑driven acquisition to a data‑centric, algorithm‑powered membership model, detailing the construction of a robust data foundation, multi‑level analysis methods, productized dashboards, and growth‑hacking experiments that boosted PLUS member retention and revenue.
This article explains how to remove duplicates from a sorted array in‑place using Python, detailing the problem constraints, providing two illustrative examples, outlining a simple iteration‑based solution approach, and presenting a complete code implementation that operates with O(1) extra space.
This article explains the internal structure and algorithms of Java’s HashMap, covering its array‑based storage, collision handling with linked lists and red‑black trees, key methods like put, get, resize, and thread‑safety considerations, complete with code examples and diagrams.
The article explores the concept of the comfort zone, shares the personal journey of Alibaba DAMO Academy senior algorithm expert Fei Ying, and offers practical advice on career growth, AI research, and leveraging VR/AR technologies to drive innovation.
This article walks you through Hulu's 2021 campus recruitment update, explains the online programming test schedule and format, shares interview tips, and provides detailed statements, sample I/O, and solution analyses for four algorithmic problems covering probability, array maxima, maze navigation, and segment‑tree optimization.
Xianyu’s new attribute completion system combines MetaQ messaging, AI image recognition, and offline option configuration to auto‑populate key product details, incentivize sellers, and iteratively refine attributes via sales metrics, boosting structured coverage by 30%, cutting verification time 70%, and raising UV‑CTR around three percent.