云端环境灾备实践

原本只是准备开始日常工作,结果云端环境执行不了命令。文字对话还能继续,想发一张截图说明情况,附件也没能传过去。 这时最让人困惑的,是几个界面状...

周四 · 2026-11-05 · 12 分钟 · Yuechen

两个 AI 窗口,怎样接力完成一篇文章?

在日有所见里,笔者会和 AI 讨论报告功能、研究方法和产品设计。有些讨论值得写成博客,却不适合原样公开:里面可能夹着个人背景,写给开发助手的说明,...

周一 · 2026-11-02 · 11 分钟 · Yuechen

Design a Log Aggregation System

Implement a Log Aggregation System which aggregates logs from various services in a datacenter and provides search APIs. Design the LogAggregator class: LogAggregator(int machines, int services) Initializes the object with machines and services representing the number of machines and services in the datacenter, respectively. void pushLog(int logId, int machineId, int serviceId, String message) Adds a log with id logId notifying that the machine machineId sent a string message while executing...

周日 · 2025-02-23 · 4 分钟 · Yuechen

Design a Rate Limiting System

A Rate Limiting System can allow a maximum of n requests every t seconds, using an implementation similar to the sliding window algorithm. Given two positive integers n and t, and a non-decreasing stream of integers representing the timestamps of requests, implement a data structure that can check if each request is allowed or not. Implement the RateLimiter class: RateLimiter(int n, int t) Initializes the RateLimiter object with an empty...

周六 · 2025-02-22 · 4 分钟 · Yuechen

Design a Todo List

Design a Todo List Where users can add tasks, mark them as complete, or get a list of pending tasks. Users can also add tags to tasks and can filter the tasks by certain tags. Implement the TodoList class: TodoList() Initializes the object. int addTask(int userId, String taskDescription, int dueDate, List<String> tags) Adds a task for the user with the ID userId with a due date equal to dueDate and...

周日 · 2025-02-16 · 4 分钟 · Yuechen

Design Walnut

Design a banking SMS parsing and analytics application (like Walnut) which reads all the text messages received by users and analyzes the following: The income and expenditure of a user. The average income and expenditure of all users. Text messages will be represented as a string, with words separated by ' '. The texts will be analyzed and will be considered valid if it satisfies the following criteria: It contains...

周日 · 2025-01-19 · 4 分钟 · Yuechen

Design Uber

Implement a Cab Booking Application (like Uber) which facilitates: Addition of new cabs to the system. Updating the trips of various customers. Finding the nearest cabs to a location. Design the Uber class: Uber() Initializes the Uber object with 0 cabs and 0 running trips. void addCab(int cabX, int cabY) Adds a cab located at point (cabX, cabY) to the system. Note that multiple cabs can be at the same...

周六 · 2024-12-28 · 5 分钟 · Yuechen

Encode and Decode TinyURL

TinyURL is a URL shortening service where you enter a URL such as https://leetcode.com/problems/design-tinyurl and it returns a short URL such as http://tinyurl.com/4e9iAk. Design a class to encode a URL and decode a tiny URL. There is no restriction on how your encode/decode algorithm should work. You just need to ensure that a URL can be encoded to a tiny URL and the tiny URL can be decoded to the original URL....

周六 · 2024-12-21 · 7 分钟 · Yuechen