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 ratingsYour rating
Log in to rate
Comments
0Log in to comment
Related Prompts
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
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.
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.
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.