This article provides a comprehensive overview of various load balancing strategies—including round‑robin, random, weighted, smooth weighted round‑robin, consistent hashing, least‑active, and optimal‑response algorithms—explaining their principles, advantages, disadvantages, use‑cases, and offering complete Java code examples for each.
This article explains how to build a tree‑based sensitive‑word detection algorithm in PHP, discusses the challenges of correctly iterating over multibyte strings, and provides a complete implementation with code examples that handle Unicode characters efficiently.
This article provides an overview of search, recommendation, and advertising as core internet services, comparing their problem definitions, business goals, algorithmic models, and system architectures across web, e‑commerce, and O2O scenarios, while outlining historical development and key industry examples.
This article examines the challenges of fuzzy searching encrypted data and compares three categories of solutions—naïve (sand‑wich), conventional, and advanced (super)—detailing their implementation ideas, performance implications, and suitability for real‑world applications.
Tencent Ads hosted two KDD2022‑focused live sessions showcasing the CONFLUX and MVKE algorithms, explaining their technical foundations, real‑world impact on billions of ad impressions, and answering audience questions about brand versus performance ads, validation methods, and future research directions.
This article analyzes Haro’s two‑wheeler dispatch problem, compares it with food‑delivery and ride‑hailing scheduling, outlines eight technical challenges, presents a multi‑fast‑good‑cheap algorithm framework, and details a simulation system that validates and improves the scheduling solution.
This tutorial explains what a dragon curve fractal is, how it can be constructed by iterative paper folding, and provides step‑by‑step Python code—including sequence generation and Turtle graphics—to draw both straight‑line and circular versions of the curve.
The author explains how the viral “Sheep Sheep” puzzle’s random mechanics make it nearly impossible to clear, then details the creation of a clone called “Fish Fish” with customizable difficulty, open‑source code, and the core implementation techniques used.
This article explains how Redis uses its Geo module, combining ordered sets and Geohash encoding, to efficiently implement the “nearby people” feature, covering command usage, detailed source‑code analysis of GEOADD and GEORADIUS, algorithmic steps, and complexity evaluation.
This article examines why encrypted data hinders fuzzy queries, categorizes three implementation approaches—from naive in‑memory decryption to conventional database tricks and advanced algorithmic solutions—evaluates their security, performance, and storage impacts, and provides practical references for real‑world systems.
Rate limiting safeguards distributed systems by controlling request rates through algorithms such as leaky bucket, token bucket, fixed and sliding windows, and back pressure, while client‑side tactics like exponential backoff, jitter, and careful retries, and requires atomic distributed storage solutions (e.g., Redis+Lua) to avoid race conditions.
Alibaba’s DaTaobao team unveiled a high‑definition live‑streaming guide that combines video processing algorithms, equipment recommendations, and standardized low‑cost solutions to dramatically improve picture quality for both top‑tier and novice streamers, while also offering free access and ongoing support.
This article presents three algorithmic challenges: counting pattern occurrences on an M×N canvas, determining the number of leaf nodes in a binary tree represented by an array, and maximizing stock trade profit under constraints on negative returns and total gain, each with input specifications, sample cases, and solution outlines.
After struggling with a seemingly easy scoring problem in a regional programming contest, the author details multiple Go implementations—including a map, a 27‑base array, and a trie—examines their time and memory issues, discovers input handling pitfalls, and ultimately achieves an accepted solution.
This article explains the core PSO velocity and position formulas, provides a complete Python implementation with detailed comments, runs the algorithm on a 2‑dimensional test function, and presents the optimal solution and convergence plot.
This article examines why encrypted data hinders fuzzy queries, categorizes three implementation strategies—from naïve to conventional to advanced—explains their mechanisms, evaluates performance and security trade‑offs, and provides practical references for building searchable encrypted fields.
This article explains the fundamentals of consistent hashing, its application in load‑balancing distributed caches, analyzes common issues such as data skew and cache avalanche, introduces virtual nodes for uniform distribution, provides Java code examples, and compares it with Redis's HashSlot approach.
This article examines why encrypted data is unfriendly to fuzzy queries, categorizes three implementation approaches—naïve, conventional, and advanced—and evaluates their security, performance, and storage trade‑offs while providing practical code examples and reference resources.
The article explains perfect hash functions, their collision‑free construction methods such as FCH, CHD, and PTHash, compares them to conventional hash tables, reviews common and cryptographic hash functions, and shows how read‑only perfect‑hash maps deliver faster lookups and lower memory use for static key sets.
This article examines the difficulty of fuzzy searching encrypted fields and compares three solution families—naïve memory‑loading or tag‑table tricks, conventional token‑based encryption with indexable columns, and advanced algorithmic designs—highlighting their security, performance, and storage implications while recommending the most practical approach.
In a July 2022 keynote, Halu’s senior algorithm expert Wang Fan outlined the construction of an intelligent transaction system for its car‑pool service, detailing business challenges, a decomposition into matching, pricing, marketing and arbitration, a recommendation‑pipeline architecture, and three‑stage algorithm evolution that boosted order volume by over 20 %.
This article walks through a fan's Python combination question, explains the combinatorial formula, and presents three practical implementations—including itertools, a custom index‑based approach, and a list‑comprehension with slicing—each verified with code output.
This article explains why rate limiting is essential for both physical venues and online services, describes common strategies such as circuit breaking, service degradation, delay handling, and privilege handling, compares caching, degradation, and limiting, and details counter, leaky‑bucket, and token‑bucket algorithms with concrete Guava and Nginx‑Lua implementations.
This article outlines seven major areas of Java backend performance optimization—including reuse, computation, result‑set, resource‑conflict, algorithm, efficient implementation, and JVM tuning—explaining concepts, techniques, and practical examples to help developers improve application speed and resource utilization.
This article explains how to design and code a hint feature for a 24‑point puzzle app on iOS, covering random number generation, validation of solvable sets, recursive expression search, expression‑to‑string conversion, optimization of parentheses, and provides complete Swift source code with detailed algorithmic explanations.
This article explains how to build a Python bot that automatically plays Minesweeper by locating the game window, capturing and analyzing the board image with RGBA values, and simulating mouse clicks using win32api, providing step‑by‑step code and a basic solving algorithm.
This article explains Twitter's open‑source Snowflake distributed ID generation algorithm, detailing its bit‑field structure, common pitfalls such as clock rollback and JavaScript precision limits, and practical mitigation strategies for high‑concurrency, sharding, and sequence handling.
This article introduces the Russian peasant multiplication algorithm, explains its historical background and step‑by‑step process using halving and doubling tables, connects it to binary expansion, and provides a complete Python implementation that demonstrates its low‑memory, creative approach to multiplication.
This article explains how to prioritize ad orders, use front‑loading to smooth traffic fluctuations, model delivery constraints with differential equations, and apply PID‑based selection coefficients to achieve efficient, real‑time traffic allocation in streaming advertising systems.
This article explains various rate‑limiting techniques—including counter, sliding window, leaky bucket, token bucket, and Redis‑Lua distributed limiting—detailing their principles, implementation logic, advantages, drawbacks, and practical code examples for high‑concurrency e‑commerce systems in.
This article reviews virtual memory concepts and explains five page replacement algorithms—Optimal (OPT), First‑In‑First‑Out (FIFO), Least Recently Used (LRU), CLOCK (including a simple and improved version), and Least Frequently Used (LFU)—detailing their principles, operation, advantages, drawbacks, and illustrative examples.
This timed programmer quiz combines single‑choice, short‑answer, and coding problems that test a broad spectrum of IT topics—from programming history and algorithms to Linux commands, networking layers, Helm chart concepts, and practical Python and C coding tasks—providing a holistic assessment of technical fundamentals.
This article examines the practical aspects of open‑sourcing Twitter’s recommendation algorithm, covering the platform’s data model, timeline views, ranking features, a TypeScript pseudocode illustration, and the major engineering challenges of scale, real‑time processing, reliability, and security.
K-means is a classic distance‑based clustering algorithm that iteratively partitions data into k compact, well‑separated groups by minimizing the sum of squared errors, using random centroid initialization and heuristic updates until convergence, making it a fundamental tool in AI and data analysis.
This article provides a comprehensive introduction to the Paxos consensus algorithm, explaining its purpose, core concepts, roles of proposers, acceptors and learners, safety and liveness properties, and the step‑by‑step derivation of its two‑phase protocol for achieving fault‑tolerant distributed consistency.
This article walks through generating a 10GB file of age data, reading it line‑by‑line on a machine with only 4GB RAM, and compares a single‑thread counting approach with a multithreaded producer‑consumer design, showing performance gains, memory usage, and practical tips.
This article explains the minimum cost flow problem—delivering a specified amount of flow from supply nodes to demand nodes at the lowest possible cost—covers its linear programming formulation, highlights key solution methods such as successive shortest path, cycle canceling, primal‑dual, network simplex, and outlines its primary applications in distribution network optimization.
Exploring the fundamentals of the maximum flow problem, this article explains network flow concepts, outlines the three core properties of flow models, and demonstrates their application with an oil‑pipeline case study solved using NetworkX, concluding with key insights and a reference.
The article presents a complete Java solution for generating, reading, and analyzing a 10 GB file of age values (18‑70) on a 4 GB RAM, 2‑core PC, comparing single‑threaded counting with a producer‑consumer multithreaded design that dramatically improves CPU utilization and reduces total processing time.
NetEase Yanxuan’s Olympus platform introduces dynamic page‑floor sorting that automatically reorders product modules in real time using a multi‑armed‑bandit algorithm, delivering faster, more accurate and stable personalized marketing, improving exposure efficiency, ROI and handling peak traffic with sub‑40 ms rendering.
This article shares three Python approaches—including step‑by‑step code examples and optimizations—to solve a challenging divisibility problem, demonstrating algorithmic thinking and progressive performance improvements for programmers seeking practical solutions.
This article introduces a web page content extraction algorithm that automatically structures titles, timestamps, body text, authors, and sources from arbitrary news pages, explains how to use an online demo, compares it with existing solutions, and discusses its broader applications and limitations.
This article walks through a Python list‑counting problem, presenting five distinct code implementations that compute the length of consecutive identical elements, explains each approach, and provides complete runnable examples with visual output.
Effective e‑commerce supply‑demand coordination requires accurate SKU‑level forecasting, optimized replenishment under MOQ and lead‑time constraints, and dynamic post‑sale traffic control, using a blend of time‑series, tree‑based and deep learning models together with expert knowledge to minimize inventory costs and avoid stock‑outs.
Learn how to implement the classic Tower of Hanoi puzzle in Go by exploring its origins, rules, recursive logic, and detailed code example, complete with step-by-step explanations and visual illustrations that guide you through solving the problem efficiently.
The article explains how to locate all missing 32‑bit unsigned integers in a 4 billion‑entry file by first partitioning the range into intervals, counting entries per interval with a tiny int[64] array, and then applying a bitmap method only to under‑filled intervals, achieving a memory footprint of just a few hundred bytes.
This article explains the LeetCode 1402 problem of maximizing the total satisfaction score by arranging dishes, describes the greedy approach of sorting and using suffix sums, and provides a Java implementation that iteratively adds positive suffix sums to compute the optimal result.
This presentation details how Hallo Mobility tackles the challenges of information‑flow ad modeling by describing the ad ecosystem, the company’s business evolution, and the advertiser‑side algorithmic solutions—including plan‑level quality detection, creative‑level uplift modeling, feature‑cross engineering, and pre‑bid user screening—while outlining future directions for automated, data‑driven ad delivery.
This article presents detailed problem statements, mathematical analysis, and Python implementations for seven algorithmic challenges covering combinatorial counting, geometry, number theory, graph shortest paths, Hamiltonian cycles, time conversion, and Pascal's triangle indexing.
This article explains a Tencent interview question requiring identification of a QQ number appearing more than half the time among 2N entries, discusses naive sorting and hashmap approaches, and presents the optimal O(N) time, O(1) space Moore voting algorithm with a complete C++ implementation and sample output.
This article explains what performance means, why optimization remains essential even on powerful multi‑core CPUs, large memory, and SSDs, and demonstrates through simple code examples how algorithmic complexity can cause noticeable lag, urging developers to prioritize performance tuning.
This article explains how a low‑code platform redesigned its report page using a tile layout powered by React‑Grid‑Layout, detailing vertical and horizontal squeeze modes, nesting, height‑auto adaptation, mixed tile‑flow layouts, and algorithm optimizations for smoother drag‑and‑drop interactions.
This tutorial explains how to implement a one‑stroke gesture recognizer with HTML5 canvas, covering drawing, resampling, translation, rotation, scaling, feature extraction, and similarity measurement using Euclidean and cosine distances, complete with full TypeScript code examples.
This article walks through a Python coding challenge that sums numbers in a list while ignoring sections that start with 6 and end with the next 9, presenting five distinct solutions—including flag‑based, loop‑based, and recursive approaches—complete with explanations and full code examples.
This article presents abstract‑paxos, a unified framework that derives Paxos and Raft from first principles, defines information certainty, quorum, and a total order on states using commit_index, and details a two‑phase protocol, member‑change handling, and how the model maps to classic Paxos and Raft implementations.
This article explains a classic interview question of locating the smallest missing positive integer from an array, analyzes its theoretical bounds, and presents three O(n) time, O(1) space solutions—including a clever marking technique and a swap‑based method—accompanied by complete Go implementations.
This article presents a detailed walkthrough of the LeetCode "Container With Most Water" problem, covering the problem statement, a two‑pointer analysis, and a complete Java implementation, while highlighting key insights for efficiently maximizing water storage.
The article explains consistent hashing—using a circular 2^32 hash ring with virtual nodes to evenly distribute keys across dynamic cache servers—provides a complete Go implementation including host registration, key lookup, and a bounded‑load extension that tracks server load, demonstrates a proxy‑cache setup, and discusses practical testing and production‑grade enhancements.
This article explains how to count the number of isosceles acute‑angled triangles whose vertices lie on the vertices of a regular n‑gon, discusses separate cases for even and odd n, handles duplicate equilateral triangles, and provides a correct Java implementation that avoids integer overflow.
This article outlines seven fundamental Java performance‑optimization directions—ranging from code reuse and parallel execution to JVM tuning—providing a theoretical framework that helps developers understand how to balance resource usage, reduce latency, and improve overall system efficiency.
This article explains how to count the number of isosceles acute triangles whose vertices lie on a regular n‑gon (3 ≤ n ≤ 10⁷), derives separate formulas for even and odd n, handles duplicate equilateral cases, and provides a correct Java implementation that avoids overflow.
This article explains how to implement an automatic missile‑tracking system for a shooting game using Python’s Pygame library, covering the underlying differential‑equation‑based algorithm, step‑by‑step trigonometric calculations, handling of coordinate systems, image rotation challenges, and provides complete source code.
This article explains the concept of skip lists as an ordered random data structure, illustrates how Redis uses skip lists for sorted sets, and provides a complete Java implementation with detailed code examples and analysis of their performance characteristics.
This article presents a Python fan's arithmetic challenge—calculating the alternating sum 1‑2+3‑4+…+99—and walks through five distinct code solutions, from basic loops to concise itertools one‑liners, highlighting their logic and trade‑offs.
This article walks through creating a Python program that simulates the popular Chinese card game ZhaJinHua, covering deck construction, random dealing to five players, hand‑type evaluation, scoring, and ranking, with complete source code and a concise explanation of each step.
ByteDance’s data platform front‑end team surveyed academic, commercial, and open‑source word‑cloud solutions, identified gaps in geo‑ and shape‑based clouds, and engineered a performant front‑end layout algorithm that generates customizable shape word clouds for diverse business scenarios.
This article surveys academic, commercial, and open‑source word‑cloud solutions, explains the underlying algorithms, visual encodings, layout strategies, interaction techniques, and classifications, and discusses the strengths, limitations, and future directions of word‑cloud visualisation.
This article introduces the classic Two Sum problem, explains its brute‑force O(n²) approach, then presents an optimal O(n) hash‑table solution and a more advanced sort‑plus‑binary‑search method, providing complete C++ implementations and performance comparisons for each technique.
Even when individual algorithm modules show higher accuracy or revenue, the overall platform can decline due to factors like competitor encroachment, macro‑economic shifts, concept drift, overlapping marginal returns, attribution errors, and coupled A/B experiments, all of which require careful analysis and mitigation.
The article explains the classic bulb‑switch problem, showing how toggling bulbs in successive rounds leads to only those positioned at perfect‑square indices remaining on, derives the mathematical reasoning behind the pattern, and presents a concise O(1) solution using the integer square‑root of n.
This article explains how to answer range maximum queries on a static array efficiently by preprocessing with a sparse table, achieving O(n log n) build time and O(1) query time, and provides a complete C++ implementation with state compression and interval decomposition.
This article explains the classic water‑jug interview problem using two cups of 9 L and 15 L, derives the reachable volumes via greatest‑common‑divisor logic, and provides complete C++ code to determine feasibility and output the pouring steps for any target volume.
This article explains why service rate limiting is essential for high‑concurrency systems, compares it with service degradation, introduces common limiting algorithms such as counter, leaky‑bucket and token‑bucket, and shows how to implement distributed rate limiting using Redis for real‑world backend services.
This article explains the concept of “lucky numbers” in an integer list—where a number’s value equals its occurrence count—and walks through a Python solution that progressively uses set, count, map, zip, filter, lambda and sorted, culminating in a concise one‑liner implementation.
The article explains how Kafka implements delayed operations using a timing wheel with O(1) insertion and deletion, describes its parameters, multi‑level wheel design for large time spans, and the mechanism of advancing the wheel via DelayQueue and the ExpiredOperationReaper, contrasting it with Netty's approach.
This article walks through the origin, architecture, and tooling of Shopee Candy, a multi‑region match‑3 H5 game, detailing the Algorithm SDK, animation system, map editor, score runner, replayer, and future plans for configurability, performance, anti‑cheat, and AI‑driven level design.
This guide shows how to generate smooth, high‑quality curves from a polyline in pure JavaScript by computing quadratic and cubic Bézier points, deriving control points via angle‑bisector geometry, assembling the segments, and rendering and animating the result on an HTML5 canvas without external libraries.
This tutorial explains how to solve the LeetCode "Lucky Numbers in a List" problem in Python by extracting unique elements, counting their occurrences with map and count, pairing them with zip, filtering with lambda, sorting the result, and finally compressing the whole logic into a single expressive line of code.
This article explains the theoretical and practical range of Tencent QQ numbers, why the lower limit is set to 10001, how unused accounts are reclaimed, and demonstrates how bitmap techniques can efficiently deduplicate billions of QQ IDs using simple C++ code.
This article walks through four approaches—sorting, hashmap, file splitting, and a bitmap technique—to deduplicate 4 billion QQ numbers within a 1 GB memory limit, explains why the first three fail, and shows how a bitmap solves the problem efficiently.
This article demystifies the fast inverse square root algorithm used in games, explaining the origin of the infamous 0x5f3759df magic number, the underlying IEEE‑754 floating‑point representation, the evil bit‑hack, Newton iteration steps, and how these tricks accelerate vector normalization.
The Smart Matching Engine for Haolo’s ride‑sharing service ingests driver and passenger orders via Kafka‑Flink pipelines into Elasticsearch, then applies multi‑stage matching—nearby search, itinerary‑based filtering using ETA, angle, distance, route‑similarity and shared‑mileage calculations—and finally ranks results with evolving pre‑sorting and algorithmic models, including PMML and deep‑learning, to optimize driver‑passenger pairing.
The article introduces the Dual Vector Foil (DVF) algorithm system, which decouples index construction from model training to enable lightweight, high‑precision large‑scale recall using arbitrary complex models, and details its two‑stage and one‑stage solutions, graph‑based retrieval implementation, performance optimizations, and experimental results.
This article explains several algorithmic strategies—including sorting, hash maps, file splitting, and bitmap techniques—to remove duplicates from a file containing 4 billion QQ numbers while staying within a 1 GB memory limit, and it provides extension exercises for sorting, median, top‑K, and duplicate detection.
This article explains how Redis implements its Sorted‑Set using a skiplist, starting with the basics of a singly linked list, analyzing insertion and query complexities, deriving the skiplist structure and its O(log N) performance, and comparing it with hash tables, balanced trees, and B‑trees.
This article explains how to handle the massive‑data problem of intersecting two files containing billions of URLs by using hash‑based divide‑and‑conquer techniques, file partitioning, and in‑memory hash lookups to achieve scalable performance beyond naive O(m·n) approaches.
This article explains why rate limiting is essential for system stability, outlines common throttling patterns such as circuit breaking, degradation, delayed processing, and privilege handling, and dives into popular algorithms like counter, leaky bucket, and token bucket with concrete Java and Nginx examples.
This article explains four practical methods—sorting, hash map, file splitting, and bitmap—to deduplicate 4 billion QQ numbers within a 1 GB memory limit, and provides extended exercises on sorting, finding the median, top‑K, and duplicate detection for massive datasets.
This article explains the classic two‑egg, 100‑floor interview puzzle, analyzes why it became a staple, and walks through four solution approaches—from a naïve linear method to binary search and a balanced partition strategy—culminating in a mathematically derived optimal method that never exceeds fourteen drops.
This article details Youku’s first “Free Viewpoint” technology optimization, explaining its underlying principles, client architecture, performance‑boosting strategies such as smart bitrate, multi‑channel downloading, pre‑caching, and the resulting improvements in playback smoothness and device coverage.
This article walks through four practical techniques—sorting, hashmap, file splitting, and bitmap—to remove duplicate QQ numbers from a 4‑billion‑record file within a 1 GB memory limit, and provides extended exercises for sorting, median, top‑K, and duplicate detection.
This article explains how to compute the maximum of each k‑sized sliding window over an integer array using both a priority‑queue (heap) approach and an optimized monotonic deque technique, complete with detailed walkthroughs, visual illustrations, and full Python code.
This article introduces the sliding window algorithmic technique, explains its relation to TCP flow control, demonstrates its implementation with Java code for maximum subarray sum, longest substring without repeats, and minimum window substring problems, and provides a reusable framework for solving similar LeetCode challenges.
This article explains why iOS memory leaks become critical as apps grow, introduces five representative leak models, details a production‑ready object‑graph scanning solution with custom data structures and a non‑recursive DFS algorithm, and evaluates its performance impact and mitigation strategies.
The article examines how low‑level recommendation‑algorithm improvements in information‑flow feeds can boost user retention, LTV and overall growth by addressing cold‑start challenges, survivor bias, and causal inference through personalized ranking, ecosystem construction, and multi‑task learning.
This article explains the greedy approach to the knapsack problem, demonstrates how to compute item value‑to‑weight ratios, selects items based on those ratios, shows a complete Java example, and discusses why the greedy method may not always yield the optimal solution.
This article presents Car Home's experience building a real‑time materialized view system on Apache Flink, detailing system analysis, problem decomposition, a global‑version‑based CDC algorithm, its implementation as a Flink connector, practical deployment results, and remaining challenges such as clock dependency and state size.
This article explains how to design and implement a points‑based lottery (luck draw) system in Java with Spring Boot, covering database schema for prizes, probability limits, prize pools, the random draw algorithm, prize restrictions, and asynchronous prize distribution using a factory pattern.
This article explains how to implement a lottery feature in a Java backend, covering database schema design for prizes, probability limits and records, constructing a prize pool, the random selection algorithm, handling prize limits, and using a factory pattern to distribute various prize types.
This article explains how to determine whether a singly linked list contains a cycle using three approaches—brute‑force, hash‑marking, and the optimal fast‑and‑slow pointer technique—providing Go and C++ implementations that achieve minimal time and O(1) space complexity suitable for a Tencent interview.