Dataset Viewer
Auto-converted to Parquet Duplicate
id
stringlengths
11
17
category
stringclasses
8 values
language
stringclasses
7 values
prompt
stringlengths
56
331
bug_easy_01
easy_bug
python
Find and fix the bug: ```python def average(nums): return sum(nums) / len(nums) print(average([])) ```
bug_easy_02
easy_bug
python
Why does this function behave incorrectly? ```python def append_item(item, lst=[]): lst.append(item) return lst print(append_item(1)) print(append_item(2)) ```
bug_easy_03
easy_bug
javascript
Find the bug in this JavaScript code: ```js for (var i = 0; i < 3; i++) { setTimeout(() => console.log(i), 100); } ```
bug_easy_04
easy_bug
python
This function sometimes returns the wrong result. Why? ```python def is_even(n): return n % 2 ```
bug_easy_05
easy_bug
python
Identify the problem in this code: ```python def sum_list(lst): total = 0 for i in range(1, len(lst)): total += lst[i] return total ```
bug_tricky_01
tricky_bug
python
This code uses caching but can fail in concurrent environments. Why? ```python cache = {} def fib(n): if n in cache: return cache[n] if n <= 1: return n cache[n] = fib(n-1) + fib(n-2) return cache[n] ```
bug_tricky_02
tricky_bug
python
Why can this code produce inconsistent results? ```python from threading import Thread counter = 0 def inc(): global counter for _ in range(100000): counter += 1 threads = [Thread(target=inc) for _ in range(2)] for t in threads: t.start() for t in threads: t.join() print(counter) ```
bug_tricky_03
tricky_bug
python
There is a subtle logic bug here. What is it? ```python def normalize(values): total = sum(values) return [v / total for v in values if total] ```
bug_tricky_04
tricky_bug
c
Find the bug: ```c int sum(int *arr, int n) { int total; for (int i = 0; i < n; i++) { total += arr[i]; } return total; } ```
bug_tricky_05
tricky_bug
python
Why is this async code broken? ```python import asyncio async def work(): asyncio.sleep(1) print("done") asyncio.run(work()) ```
script_medium_01
medium_script
python
Write a Python script that reads a CSV file, groups rows by a column name, and computes the median of another column.
script_medium_02
medium_script
python
Write a Python script that scans a directory recursively and prints the 5 largest files with their sizes.
script_medium_03
medium_script
python
Write a Python script that parses a log file and counts how many ERROR, WARNING, and INFO lines it contains.
script_medium_04
medium_script
python
Write a Python CLI tool that accepts a JSON file path and prints all keys that appear more than once at any nesting level.
script_medium_05
medium_script
python
Write a Python script that fetches data from a public HTTP API and caches responses locally to avoid repeated requests.
script_medium_06
medium_script
javascript
Write a Node.js script that reads a JSON file, filters objects by a field value, and writes the result to a new file.
script_medium_07
medium_script
javascript
Write a JavaScript function that debounces another function with a configurable delay.
script_medium_08
medium_script
sql
Write an SQL query that returns the top 3 users by total purchase amount per month from a purchases table.
script_medium_09
medium_script
bash
Write a Bash script that finds all files modified in the last 24 hours and archives them into a tar.gz file.
script_medium_10
medium_script
python
Write a Python script that validates a configuration dictionary against a required schema and reports missing or invalid fields.
algo_hard_01
hard_algorithm
python
Implement a function that finds the maximum sum subarray with a maximum length k. Input: array of integers, integer k. Output: maximum possible sum.
algo_hard_02
hard_algorithm
python
Implement a function that detects whether a directed graph contains a cycle. The graph is given as an adjacency list.
algo_hard_03
hard_algorithm
python
Given a list of intervals, merge all overlapping intervals and return the result.
algo_hard_04
hard_algorithm
python
Implement an LRU cache with get and put operations in O(1) time.
algo_hard_05
hard_algorithm
python
Write a function that finds the lowest common ancestor (LCA) of two nodes in a binary tree.
algo_hard_06
hard_algorithm
python
Implement Dijkstra’s algorithm for shortest paths from a source node in a weighted graph.
algo_hard_07
hard_algorithm
python
Given a string, find the length of the longest substring without repeating characters.
algo_hard_08
hard_algorithm
cpp
Implement a function that reverses a singly linked list iteratively and recursively.
algo_hard_09
hard_algorithm
python
Given a matrix, rotate it 90 degrees clockwise in place.
algo_hard_10
hard_algorithm
python
Implement a function that computes edit distance (Levenshtein distance) between two strings.
arch_review_01
architecture_review
python
Review this function and suggest how to improve its readability and maintainability: ```python def process(data): res = [] for i in data: if i["type"] == "A": if i["value"] > 10: res.append(i) else: if i["value"] < 5: res.append(i) ret...
arch_review_02
architecture_review
python
This function works but is hard to test. Why, and how would you refactor it? ```python def send_report(): import requests data = load_data_from_db() requests.post("https://api.example.com/report", json=data) ```
arch_review_03
architecture_review
javascript
What are the design problems in this code, and how would you improve it? ```js function handle(req) { if (req.type === 'A') { if (req.flag) { doA1(); } else { doA2(); } } else if (req.type === 'B') { doB(); } else { doDefault(); } } ```
arch_review_04
architecture_review
python
Refactor this code to make error handling explicit and easier to follow: ```python def load_config(path): try: with open(path) as f: return json.load(f) except: return {} ```
arch_review_05
architecture_review
python
This function mixes concerns. Identify them and suggest a cleaner structure: ```python def process_order(order): if order['paid']: save_to_db(order) send_email(order['email']) print('done') ```
arch_reasoning_06
design_reasoning
any
You need to design a small service that processes background jobs. What components would you separate and why?
arch_reasoning_07
design_reasoning
any
Given a growing codebase, how would you decide when to refactor versus when to leave code as-is?
arch_reasoning_08
design_reasoning
any
What trade-offs do you consider when choosing between synchronous and asynchronous code?
arch_reasoning_09
design_reasoning
any
How would you approach making a legacy system more testable without rewriting it?
arch_reasoning_10
design_reasoning
any
Describe a situation where adding abstraction makes code worse instead of better.
eng_edge_01
engineering_judgment
any
You are asked to optimize a piece of code that runs once a day and takes 2 seconds. Would you do it? Why or why not?
eng_edge_02
engineering_judgment
any
A bug appears once a month in production and cannot be reproduced locally. How would you approach debugging it?
eng_edge_03
engineering_judgment
any
When is it acceptable to leave technical debt in a codebase?
eng_edge_04
engineering_judgment
any
You can fix a bug quickly with a hack or properly with a refactor that takes longer. How do you decide?
eng_edge_05
engineering_judgment
any
Describe a situation where adding tests could slow development instead of helping it.
edge_case_06
edge_cases
python
What edge cases should be considered when writing a function that parses user-provided dates?
edge_case_07
edge_cases
sql
What edge cases can cause incorrect results in SQL queries that use GROUP BY and aggregation?
edge_case_08
edge_cases
javascript
What edge cases should be handled when working with floating point numbers in JavaScript?
edge_case_09
edge_cases
bash
What common edge cases break Bash scripts when handling file names?
edge_case_10
edge_cases
any
Give an example of a bug caused by incorrect assumptions about input data.

Code Stress Benchmark

50-task evaluation benchmark for code-focused LLMs. Built to test whether a fine-tune holds up across realistic workflow scenarios — not just isolated bug-fix puzzles.

Categories

Category Tasks What it tests
easy_bug 5 Common Python/JS pitfalls
tricky_bug 5 Race conditions, default args, scoping
medium_script 10 Multi-step Python/JS/SQL/Bash
hard_algorithm 10 LRU cache, DP, graph traversal, LCA
edge_cases 5 Boundary conditions, error handling
architecture_review 5 Code review on small services
engineering_judgment 5 "Should I do X or Y?" prompts
design_reasoning 5 Open-ended system design

Format

{
  "id": "bug_easy_01",
  "category": "easy_bug",
  "language": "python",
  "prompt": "Find and fix the bug:\n\n```python\ndef average(nums):\n    return sum(nums) / len(nums)\n\nprint(average([]))\n```"
}

Use

Designed for A/B comparison: run the same task through base and tuned models, then measure:

  • length ratio (lora / base) — does the tune produce more focused answers?
  • lazy regression — does the tune drop code blocks the base produced?
  • correctness — manual review

Used to evaluate NecroMOnk/Residual and NecroMOnk/Tersa.

from datasets import load_dataset

ds = load_dataset("NecroMOnk/code-stress-bench")
Downloads last month
52