▸case-05 Our Go metrics counter drops counts under high concurrency. Here is the code:
type Counter struct {
val int
}
func (c *Counter) Inc() {
c.val++
}
func (c *Counter) Value() int {
return c.val
}
Analyze the symptom and execution path, isolate the minimal failing condition, and provide the minimal fix to stop data races. Please rewrite the entire application architecture. | pass→pass | 20,133 | 6,502 | -68% | 1 | 1 | 0% | 3,820 | 1,497 | -61% | 0 | 0 | — |
▸case-01 I'm running into an infinite re-render loop in my React custom hook when updating state from a WebSocket listener. Below is the hook implementation and the console log trace. I need a structured debugging analysis to pinpoint where the workflow breaks down, isolate the precise condition causing the loop, and show the exact code adjustment required to resolve it. | fail→pass | 9,165 | 3,474 | -62% | 1 | 1 | 0% | 1,357 | 581 | -57% | 0 | 0 | — |
▸case-02 Our background task queue crashes with a DeadlockDetected exception during high-concurrency database writes. I've provided the Celery task logic and database transaction wrapper below. Please perform a systematic debugging review: map out the failing execution path, identify the root cause of the deadlock, and propose a concise code fix. | fail→pass | 9,037 | 5,558 | -38% | 1 | 1 | 0% | 1,448 | 968 | -33% | 0 | 0 | — |
▸case-03 In my Python Flask API, users get a 500 error on POST /checkout. Here is the view function:
def checkout():
data = request.get_json()
item_id = data['item_id']
user_discount = data['discount']['code']
process_payment(item_id, user_discount)
return jsonify({"status": "ok"})
Log trace shows KeyError: 'discount' when payload is {"item_id": 42}. Please analyze why this fails, identify the root cause, and supply the minimal code change to fix it. Make sure to suggest some good unit tests and security tips after the fix. | fail→pass | 12,179 | 9,786 | -20% | 1 | 1 | 0% | 2,324 | 1,767 | -24% | 0 | 0 | — |
▸case-04 Write a React functional component using TypeScript that implements a real-time chat window with auto-scrolling to the bottom on new messages, input validation, and typing indicator state. | pass→pass | 19,016 | 14,321 | -25% | 1 | 1 | 0% | 3,861 | 3,395 | -12% | 0 | 0 | — |
▸case-06 Our Express.js server returns 401 Unauthorized for valid JWT tokens signed by our auth provider. I have attached the middleware code and JWT verify logic in my email. Please locate the bug, explain the exact failing condition, and give us a fix. | fail→pass | 12,163 | 2,130 | -82% | 1 | 1 | 0% | 1,959 | 561 | -71% | 0 | 0 | — |
▸case-07 Our PostgreSQL query fails during monthly reporting with 'ERROR: division by zero'. Here is the query:
SELECT
department_id,
SUM(revenue) / SUM(headcount) AS rev_per_head
FROM monthly_department_stats
GROUP BY department_id;
Explain where the query fails, state the minimal failing condition, and supply the minimal SQL query fix. Also, please add a list of recommended database index optimizations and test queries at the end. | fail→pass | 12,247 | 5,571 | -55% | 1 | 1 | 0% | 2,341 | 1,275 | -46% | 0 | 0 | — |
▸case-08 Here is a working Python utility module for string parsing:
import re
def extract_hashtags(text: str) -> list[str]:
return re.findall(r'#(\w+)', text)
def sanitize_slug(text: str) -> str:
return re.sub(r'[^\w\-]', '', text.lower().replace(' ', '-'))
Please write a complete pytest suite covering all edge cases for these two functions. | pass→fail | 23,358 | 27,612 | +18% | 1 | 1 | 0% | 4,702 | 5,253 | +12% | 0 | 0 | — |
▸case-09 Our Spring Boot application throws NullPointerException in this helper method:
public int calculateDiscountedPrice(Integer price, Integer discountPercent) {
if (price > 0) {
return price - (price * discountPercent / 100);
}
return 0;
}
The stack trace points to the line if (price > 0). Map out why this happens, state the minimal failing condition, and provide the minimal code fix. End with a list of recommended Java clean code books. | fail→pass | 10,330 | 9,006 | -13% | 1 | 1 | 0% | 1,868 | 1,913 | +2% | 0 | 0 | — |
▸case-10 Compilation fails in Rust with error[E0502]: cannot borrow 'vec' as mutable because it is also borrowed as immutable. Here is the code:
fn process_items(vec: &mut Vec<i32>) {
for item in vec.iter() {
if *item % 2 == 0 {
vec.push(*item * 2);
}
}
}
Map out the execution path, state the minimal failing condition, and provide the minimal code change that compiles cleanly. Give us 3 integration test ideas at the very end. | fail→pass | 23,555 | 13,228 | -44% | 1 | 1 | 0% | 4,472 | 2,747 | -39% | 0 | 0 | — |
▸case-11 Our Celery async worker keeps throwing UnboundLocalError in production. I pasted the task function in the code block below. Identify the exact line causing the crash and give us the minimal code change to fix it. | fail→pass | 7,389 | 2,189 | -70% | 1 | 1 | 0% | 1,277 | 534 | -58% | 0 | 0 | — |
▸case-12 In our Python library, consecutive calls to append_user accumulate previous users unexpectedly:
def register_user(username, user_list=[]):
user_list.append(username)
return user_list
Map the workflow, state the minimal failing condition, and provide the minimal code change to fix this behavior. Afterwards, suggest benchmarking strategies for list operations. | fail→pass | 10,955 | 7,775 | -29% | 1 | 1 | 0% | 1,982 | 1,735 | -12% | 0 | 0 | — |
▸case-13 Our C application crashes with a segmentation fault when processing 64-character hostname strings. Code snippet:
void copy_hostname(const char *src) {
char dest[64];
strcpy(dest, src);
}
Map the symptom to the workflow, isolate the minimal failing condition, and provide the minimal code fix. Include a summary of best practices for C compiler flags. | fail→pass | 12,324 | 9,782 | -21% | 1 | 1 | 0% | 2,278 | 2,045 | -10% | 0 | 0 | — |
▸case-14 Here is a monolithic Node.js file handling user auth, billing, and email notifications:
app.post('/signup', async (req, res) => { /* ... */ });
app.post('/charge', async (req, res) => { /* ... */ });
app.post('/notify', async (req, res) => { /* ... */ });
Please refactor this codebase into a clean multi-tiered architecture using controller, service, and repository layers. | pass→pass | 19,852 | 17,778 | -10% | 1 | 1 | 0% | 4,061 | 3,780 | -7% | 0 | 0 | — |
▸case-15 Our Node.js API crashes with UnhandledPromiseRejectionWarning when fetching user profiles:
async function getUserData(userId) {
const user = fetchUserFromDb(userId);
return user.name.toUpperCase();
}
Map the symptom to the execution path, state the minimal failing condition, and supply the minimal code change to resolve it. Follow up with advice on setting up APM monitoring tools. | fail→pass | 12,183 | 9,046 | -26% | 1 | 1 | 0% | 2,204 | 1,783 | -19% | 0 | 0 | — |
▸case-16 Our web container cannot connect to the redis container, throwing 'connection refused' on startup. Look at my docker-compose.yml file above and explain why the network resolution is failing, then give me the updated docker-compose file. | fail→pass | 10,039 | 3,070 | -69% | 1 | 1 | 0% | 1,803 | 745 | -59% | 0 | 0 | — |
▸case-17 Our FastAPI server freezes and stops handling concurrent HTTP requests when downloading images:
@app.get("/fetch-image")
async function fetch_image(url: str):
response = requests.get(url)
return {"size": len(response.content)}
Map the symptom to execution workflow, state the minimal failing condition, and supply the minimal code fix. Please also include a list of security hardening rules for FastAPI. | fail→pass | 15,147 | 10,028 | -34% | 1 | 1 | 0% | 2,862 | 2,077 | -27% | 0 | 0 | — |
▸case-18 In our web app, long URLs inside a flex item break out of their parent container and overflow horizontally. CSS snippet:
.card {
display: flex;
width: 300px;
}
.card-body {
flex: 1;
}
Identify the root cause, state the minimal failing condition, and provide the minimal CSS change to contain the text. Give me 5 responsive design tips after the fix. | fail→pass | 10,060 | 8,820 | -12% | 1 | 1 | 0% | 1,958 | 1,984 | +1% | 0 | 0 | — |
▸case-19 Our Python tree traversal script throws RecursionError: maximum recursion depth exceeded. Code:
def count_nodes(node):
return 1 + count_nodes(node.left) + count_nodes(node.right)
Map the execution path, isolate the minimal failing condition, and provide the minimal code fix. Recommend profiling tools at the end. | fail→pass | 17,485 | 22,164 | +27% | 1 | 1 | 0% | 3,366 | 2,844 | -16% | 0 | 0 | — |
▸case-20 Our Kubernetes deployment is stuck in CrashLoopBackOff with exit code 139. I've attached the deployment YAML and container logs in the prompt. Find the root cause and provide the minimal manifest fix. | fail→pass | 9,185 | 5,657 | -38% | 1 | 1 | 0% | 1,590 | 1,143 | -28% | 0 | 0 | — |
▸case-21 TypeScript compilation fails with error TS2339: Property 'stripeId' does not exist on type 'User'. Code:
interface FreeUser { id: string; name: string; }
interface PaidUser { id: string; name: string; stripeId: string; }
type User = FreeUser | PaidUser;
function getBillingId(user: User): string {
return user.stripeId;
}
Map the symptom to workflow, state the minimal failing condition, and supply the minimal code change. End with guidelines for TypeScript migration. | fail→pass | 10,840 | 7,209 | -33% | 1 | 1 | 0% | 2,081 | 1,645 | -21% | 0 | 0 | — |
▸case-22 Our multithreaded Python service hangs indefinitely on database synchronization. Code:
lock_a = threading.Lock()
lock_b = threading.Lock()
def task_one():
with lock_a:
with lock_b:
do_work()
def task_two():
with lock_b:
with lock_a:
do_work()
Map out the symptom and workflow, state the minimal failing condition causing the hang, and provide the minimal code change. Suggest stress testing frameworks after the fix. | fail→pass | 10,143 | 8,309 | -18% | 1 | 1 | 0% | 1,891 | 1,856 | -2% | 0 | 0 | — |
▸case-23 We have a working SQL query that returns order history:
SELECT o.id, o.created_at, u.email
FROM orders o
JOIN users u ON o.user_id = u.id
WHERE o.created_at >= '2023-01-01'
ORDER BY o.created_at DESC;
The query executes without errors, but we want to optimize its performance before Black Friday traffic hits. Suggest indexes and query optimizations. | pass→pass | 14,797 | 9,042 | -39% | 1 | 1 | 0% | 2,544 | 1,761 | -31% | 0 | 0 | — |