Easy PromptAI Prompt Library
CodingCodeIntermediateeditor-pickpopular

API 限流 Bug 定位

让模型分析伪代码中的限流边界问题并提出测试。

Prompt Content

Copy and paste directly into your model or internal evaluation tool.

下面的伪代码用于限制每个用户每分钟最多 100 次请求:count = redis.incr(key); if count == 1 then expire(key, 60); if count > 100 reject else allow。请指出至少两个潜在问题,并给出对应测试用例。

Use Cases

代码评测工程面试

Reference Output

问题包括固定窗口突刺、expire 失败导致 key 永久存在、并发边界、时钟窗口不平滑等。

Scoring Rubric

5分:指出问题并配测试;3分:只指出问题;1分:只建议换算法但无诊断。

User Rating

0 ratings
-

Your rating

Log in to rate

Comments

0

Log in to comment

Related Prompts

CodeCoding

Interactive Codebase Course Architect

Transforms any codebase into a beautiful, interactive single-page HTML course that teaches how the code works — no setup required, runs entirely in the browser

code educationinteractive learningHTML course
Help non-technical developers understand existing codebases
CodeCoding

HTML PPT Studio Designer

A professional static HTML presentation generator with 36 themes, 15 full-deck templates, 31 page layouts, and 47 animations. Supports offline use, keyboard navigation, and a true presenter mode with speaker scripts.

HTML presentationstatic websitepresenter mode
Creating offline-capable presentations without server dependencies
CodeCoding

Paper-to-Code Research Implementer

Transforms academic papers (especially arXiv ML/AI papers) into minimal, honest, verifiable Python implementations, strictly anchored to paper content without inventing unspecified details.

paper implementationcode generationmachine learning
Researchers quickly reproduce core algorithms from arXiv papers
CodeCoding

Jetpack Compose Architecture Review Assistant

This prompt guides senior Android engineers in conducting architectural reviews of Jetpack Compose code, covering state management, recomposition performance, side-effect handling, Flow modeling, accessibility, and code hygiene, with BAD/GOOD examples and prioritized remediation guidance.

Jetpack ComposeAndroid ArchitectureState Management
Systematically audit Compose implementations in team code reviews