Tasks
Browse and filter all 110 benchmark tasks across 6 difficulty tiers and multiple languages.
Tier Breakdown
| Tier | Range | Count | Simulates |
|---|---|---|---|
| 1 - Trivial | P1–P10 | 10 | Quick fixes |
| 2 - Easy | P11–P25 | 15 | Single-file tasks |
| 3 - Medium | P26–P50 | 25 | Multi-function work |
| 4 - Hard | P51–P75 | 25 | Complex tasks |
| 5 - Expert | P76–P100 | 25 | Real-world projects |
| Multi-lang | P101–P110 | 10 | TS, Rust, Go, SQL |
Task Catalog
Search, filter by tier or language, and sort by any column.
110 tasks
| Tags | ||||
|---|---|---|---|---|
| P1 | T1 Trivial | Fix off-by-one error in list slicing when computing the last page of paginated results. | python | bugfixpagination |
| P2 | T1 Trivial | Replace a hard-coded magic number with a named constant for HTTP timeout seconds. | python | refactorconstants |
| P3 | T1 Trivial | Correct a typo in a log message that says 'succesful' instead of 'successful'. | python | loggingtypo |
| P4 | T1 Trivial | Add missing type hint for a function parameter that currently triggers mypy warnings. | python | typingmypy |
| P5 | T1 Trivial | Change default argument from mutable list to None and initialize inside the function body. | python | bugfixdefaults |
| P6 | T1 Trivial | Fix incorrect f-string brace escaping in a user-facing error template. | python | stringsbugfix |
| P7 | T1 Trivial | Swap two variables using tuple unpacking instead of a temporary variable for readability. | python | refactorstyle |
| P8 | T1 Trivial | Add a guard clause to return early when input string is empty before processing. | python | validationearly-return |
| P9 | T1 Trivial | Replace deprecated datetime.utcnow() with timezone-aware datetime.now(timezone.utc). | python | datetimedeprecation |
| P10 | T1 Trivial | Fix unit test assertion that compares floats with == instead of pytest.approx. | python | testingfloating-point |
| P11 | T2 Easy | Implement CSV export for the user directory in a single Flask route without changing the database layer. | python | flaskcsvexport |
| P12 | T2 Easy | Add input validation with pydantic for a REST request model in one module. | python | pydanticvalidationapi |
| P13 | T2 Easy | Refactor duplicated retry logic into a single decorator applied to three API client methods in one file. | python | refactordecoratorretries |
| P14 | T2 Easy | Implement exponential backoff for a synchronous HTTP client wrapper using time.sleep. | python | httpbackoffresilience |
| P15 | T2 Easy | Add docstrings and doctest examples to utility functions for string normalization in utils.py. | python | documentationdoctest |
| P16 | T2 Easy | Convert a class-based context manager to a @contextmanager generator function. | python | context-managerrefactor |
| P17 | T2 Easy | Wire up argparse subcommands for init, validate, and run in a single CLI entrypoint. | python | cliargparse |
| P18 | T2 Easy | Implement LRU cache for expensive pure function results using functools.lru_cache with maxsize. | python | cachingperformance |
| P19 | T2 Easy | Add structured JSON logging with a correlation_id field propagated through request handlers. | python | loggingobservability |
| P20 | T2 Easy | Replace blocking socket reads with asyncio streams in one network module while keeping the public API stable. | python | asyncionetworking |
| P21 | T2 Easy | Implement a simple in-memory rate limiter using a sliding window counter per client IP. | python | rate-limitingsecurity |
| P22 | T2 Easy | Add property-based tests with Hypothesis for a sorting helper that must be stable. | python | testinghypothesis |
| P23 | T2 Easy | Serialize dataclass instances to JSON with a custom default encoder in one serialization module. | python | jsondataclasses |
| P24 | T2 Easy | Fix resource leak by ensuring file handles are closed using pathlib and a with statement in a parser. | python | iobugfix |
| P25 | T2 Easy | Implement a tiny plugin registry: register callables by name and invoke by string key. | python | patternsregistry |
| P26 | T3 Medium | Refactor authentication middleware to extract JWT claims once and attach a typed user object to the request context. | python | fastapijwtmiddleware |
| P27 | T3 Medium | Split an oversized views.py into blueprints for users, posts, and admin while preserving URL routes. | python | djangorefactorstructure |
| P28 | T3 Medium | Add database migration to introduce a nullable deleted_at column and update ORM queries to filter soft-deleted rows. | python | sqlalchemymigrationssoft-delete |
| P29 | T3 Medium | Implement idempotent webhook handler with signature verification, dedupe store, and structured audit logs. | python | webhookssecurityidempotency |
| P30 | T3 Medium | Introduce repository pattern between service layer and raw SQL calls without changing outward HTTP responses. | python | architecturesqllayering |
| P31 | T3 Medium | Add OpenTelemetry spans around external API calls and database transactions with consistent attribute naming. | python | observabilityopentelemetry |
| P32 | T3 Medium | Build a background job worker using Redis queues: enqueue, retry on failure, and dead-letter after max attempts. | python | redisworkersreliability |
| P33 | T3 Medium | Optimize N+1 query pattern in a list endpoint by eager-loading related entities with joinedload. | python | performanceorm |
| P34 | T3 Medium | Implement feature flags read from environment with safe defaults and unit tests for each flag branch. | python | feature-flagstesting |
| P35 | T3 Medium | Add pagination metadata (total, next cursor) to JSON API responses while keeping backward compatibility. | python | apipagination |
| P36 | T3 Medium | Harden file upload endpoint: validate MIME type, size limits, and sanitize filenames before storage. | python | securityuploads |
| P37 | T3 Medium | Introduce circuit breaker around flaky third-party API with metrics hooks for open/half-open states. | python | resilienceintegrations |
| P38 | T3 Medium | Migrate settings from os.environ scattered reads to a centralized pydantic Settings class with validation. | python | configurationpydantic |
| P39 | T3 Medium | Add role-based access checks to admin endpoints with reusable dependency injection guards. | python | authorizationfastapi |
| P40 | T3 Medium | Implement CSV ingestion pipeline: stream rows, validate schema row-by-row, and bulk insert valid batches. | python | etlcsvperformance |
| P41 | T3 Medium | Add Express middleware that attaches requestId from x-request-id header or generates UUID for tracing. | javascript | expressmiddlewareobservability |
| P42 | T3 Medium | Refactor duplicated DOM query logic in a vanilla JS dashboard into small pure helper functions in one bundle. | javascript | refactorfrontend |
| P43 | T3 Medium | Fix race condition in client-side debounced search by cancelling in-flight fetch with AbortController. | javascript | fetchasyncbugfix |
| P44 | T3 Medium | Implement client-side form validation mirroring server rules for a signup page using a shared JSON schema. | javascript | validationforms |
| P45 | T3 Medium | Add Node.js script to transform legacy CommonJS modules to ESM exports without changing runtime behavior. | javascript | nodejsmodulesmigration |
| P46 | T3 Medium | Wire up Jest tests for a utility that parses query strings with edge cases for empty keys and arrays. | javascript | testingjest |
| P47 | T3 Medium | Introduce environment-based API base URL selection for a React app built with Vite, including type-safe env access. | javascript | reactviteconfiguration |
| P48 | T3 Medium | Add WebSocket client reconnection with exponential backoff and UI state for disconnected/connected modes. | javascript | websocketresiliencefrontend |
| P49 | T3 Medium | Optimize hot path in a Python data transformation: vectorize with NumPy where loops dominate runtime. | python | numpyperformance |
| P50 | T3 Medium | Implement transactional outbox pattern draft: write domain event row in same DB transaction as aggregate update. | python | eventstransactionsarchitecture |
| P51 | T4 Hard | Refactor user authentication to use JWT access tokens plus rotating refresh tokens stored server-side. | python | authjwtsecurity |
| P52 | T4 Hard | Add WebSocket support to a chat server: rooms, presence, and broadcast with Redis pub/sub across instances. | python | websocketredisrealtime |
| P53 | T4 Hard | Split monolithic FastAPI app into packages for routers, schemas, services, and repositories with clean imports. | python | fastapistructurerefactor |
| P54 | T4 Hard | Implement OAuth2 client credentials flow for machine-to-machine calls to an external API with token caching. | python | oauth2integrations |
| P55 | T4 Hard | Migrate Flask session-based auth to stateless JWT while preserving logout semantics via token denylist. | python | flaskauthmigration |
| P56 | T4 Hard | Add full-text search using Postgres tsvector across posts and comments with ranked results API. | python | postgressearchapi |
| P57 | T4 Hard | Introduce Celery tasks for thumbnail generation, progress tracking, and cleanup of orphaned files on S3. | python | celeryasync-jobsstorage |
| P58 | T4 Hard | Build multi-tenant isolation: tenant_id scoping on queries, middleware enforcement, and integration tests. | python | multi-tenantsecuritytesting |
| P59 | T4 Hard | Implement GraphQL resolver batching with DataLoader equivalents in Python to fix over-fetching in nested queries. | python | graphqlperformance |
| P60 | T4 Hard | Add canary release routing: percentage-based traffic split behind nginx config generated from a small Python tool. | python | deploymentroutingtooling |
| P61 | T4 Hard | Refactor payment integration: separate gateway adapter, idempotency keys, and reconciliation report generator. | python | paymentsarchitecturereliability |
| P62 | T4 Hard | Introduce event sourcing for order state transitions with snapshots for fast rebuild and audit trail export. | python | eventsdomain-modelpersistence |
| P63 | T4 Hard | Add SSRF protections to a URL fetcher: DNS rebinding checks, blocklists, and scheme restrictions with tests. | python | securityssrftesting |
| P64 | T4 Hard | Migrate from SQLite to Postgres in development and CI with docker-compose, fixtures, and parity tests. | python | databasedockermigration |
| P65 | T4 Hard | Implement plugin system loading third-party Python modules from a sandboxed directory with capability checks. | python | pluginssecurityextensibility |
| P66 | T4 Hard | Add end-to-end API contract tests comparing OpenAPI spec to live responses using schemathesis in CI. | python | testingopenapici |
| P67 | T4 Hard | Split a large React component tree into lazy-loaded routes with error boundaries and suspense fallbacks. | javascript | reactperformancerouting |
| P68 | T4 Hard | Migrate frontend state from prop drilling to a lightweight Zustand store with selectors and devtools logging. | javascript | reactstate-managementrefactor |
| P69 | T4 Hard | Add Playwright tests for critical checkout flow including network stubs and visual diff for receipt page. | javascript | e2eplaywrighttesting |
| P70 | T4 Hard | Implement Node.js BFF layer that aggregates three microservice calls with timeouts, partial failure handling, and caching. | javascript | nodejsbffresilience |
| P71 | T4 Hard | Introduce TypeScript gradually to a JS codebase: enable allowJs, add types to shared utilities, fix strict errors. | typescript | migrationstrictnessfrontend |
| P72 | T4 Hard | Build mixed Python worker + Node.js dashboard: expose metrics via Prometheus and render charts in the UI. | python | observabilityprometheusfull-stack |
| P73 | T4 Hard | Harden CORS and CSRF story across SPA and API: cookie settings, SameSite, and double-submit token pattern. | javascript | securitycorscsrf |
| P74 | T4 Hard | Refactor legacy jQuery UI widgets to modular ES modules while preserving keyboard accessibility behaviors. | javascript | refactora11ylegacy |
| P75 | T4 Hard | Add distributed tracing correlation between Python API and Node.js worker using W3C trace context headers. | python | tracingmicroservicesobservability |
| P76 | T5 Expert | Design and implement a configurable rules engine for pricing with versioned rulesets and dry-run evaluation API. | python | rules-engineapiarchitecture |
| P77 | T5 Expert | Build a reproducible ML training pipeline: data versioning, experiment tracking, and hyperparameter sweeps on a cluster. | python | mlpipelinesreproducibility |
| P78 | T5 Expert | Implement zero-downtime database migration for a large table: dual-write, backfill, cutover, and rollback plan. | python | databasemigrationreliability |
| P79 | T5 Expert | Add supply-chain style SBOM generation and license compliance report to CI for Python dependencies. | python | securitycomplianceci |
| P80 | T5 Expert | Introduce fine-grained ABAC policy checks using OPA sidecar evaluating Rego policies for each request. | python | authorizationopamicroservices |
| P81 | T5 Expert | Implement a streaming CSV parser with backpressure in asyncio feeding a bounded worker pool. | python | asynciostreamingperformance |
| P82 | T5 Expert | Refactor a Django monolith into modular apps with shared contracts and bounded context documentation. | python | djangodddrefactor |
| P83 | T5 Expert | Add chaos testing hooks: inject latency/faults in dev/stage for critical paths with safety guards. | python | reliabilitytestingdevops |
| P84 | T5 Expert | Build a multi-region active-active draft: conflict-free replicated data types for counters with operational runbooks. | python | distributed-systemscrdtops |
| P85 | T5 Expert | Implement secure secret rotation for API keys: dual-key acceptance window, alerts, and automated rollout jobs. | python | securitysecretsoperations |
| P86 | T5 Expert | Add a code-generation step from protobuf definitions to Python clients with CI drift detection. | python | grpccodegenci |
| P87 | T5 Expert | Introduce read replicas with stale-read controls: session stickiness hints and freshness SLAs in service layer. | python | databasescalingarchitecture |
| P88 | T5 Expert | Implement a pluggable storage backend (local, S3, GCS) behind a stable interface with integration tests per provider. | python | storageabstractiontesting |
| P89 | T5 Expert | Build a rate-limited public API product tier with usage metering, billing hooks, and customer dashboards. | python | apibillingsaas |
| P90 | T5 Expert | Add static analysis custom rules (semgrep) for dangerous patterns in internal frameworks with CI enforcement. | python | securitystatic-analysisci |
| P91 | T5 Expert | Migrate Ruby on Rails session store to Redis with sticky sessions on load balancer and failover drills. | ruby | railsredissessions |
| P92 | T5 Expert | Implement Java Spring Boot actuator security hardening and custom health indicators for downstream dependencies. | java | spring-bootobservabilitysecurity |
| P93 | T5 Expert | Add Kotlin coroutine-based batch processor replacing blocking JDBC with reactive R2DBC where appropriate. | kotlin | springr2dbcperformance |
| P94 | T5 Expert | Refactor C# ASP.NET Core middleware pipeline for authentication, exception mapping, and problem details RFC7807. | csharp | aspnetcoreapierrors |
| P95 | T5 Expert | Introduce Go service for edge authentication proxy validating tokens and injecting headers to upstream Python API. | go | microservicesauthproxy |
| P96 | T5 Expert | Implement Rust FFI bindings for a performance-critical codec and safe error propagation to Python via pyo3. | rust | ffiperformanceinterop |
| P97 | T5 Expert | Add Swift iOS client changes for certificate pinning and background refresh aligned with updated token lifetimes. | swift | iossecuritymobile |
| P98 | T5 Expert | Build PHP Laravel queue workers with horizon monitoring, retry policies, and idempotent job handlers. | php | laravelqueuesreliability |
| P99 | T5 Expert | Implement Scala Spark job for incremental deduplication with watermarking and checkpointed state on object storage. | scala | sparkdataincremental |
| P100 | T5 Expert | Add Elixir Phoenix LiveView dashboard for ops metrics with role-based views and audit logging. | elixir | phoenixrealtimeobservability |
| P101 | T6 Multi-lang | Refactor a Node.js codebase to strict TypeScript: enable strict, fix implicit any, and add zod runtime validation at boundaries. | typescript | strictnesszodnodejs |
| P102 | T6 Multi-lang | Implement a TypeScript library published with dual ESM/CJS outputs, source maps, and API-extractor rolled .d.ts bundles. | typescript | toolinglibrarybuild |
| P103 | T6 Multi-lang | Add Rust async TCP server with tokio: graceful shutdown, connection limits, and structured tracing spans per connection. | rust | tokionetworkingobservability |
| P104 | T6 Multi-lang | Implement a Rust CLI using clap derive, config file merge precedence, and integration tests with assert_cmd. | rust | clitestingtooling |
| P105 | T6 Multi-lang | Build a Go HTTP service with chi router, context timeouts, pprof endpoints guarded in non-prod, and table-driven tests. | go | httpperformancetesting |
| P106 | T6 Multi-lang | Add Go worker pool pattern with bounded concurrency, panic recovery per task, and prometheus metrics for queue depth. | go | concurrencyobservabilityworkers |
| P107 | T6 Multi-lang | Write idempotent SQL migration scripts for Postgres: add partial unique index, backfill, and validate with EXPLAIN plans. | sql | postgresmigrationsperformance |
| P108 | T6 Multi-lang | Optimize a complex reporting query using window functions, CTEs, and appropriate indexes; document assumptions in comments. | sql | analyticswindow-functionsindexing |
| P109 | T6 Multi-lang | Implement TypeScript React component library with Storybook, accessibility checks, and visual regression tests in CI. | typescript | reactstorybooka11y |
| P110 | T6 Multi-lang | Add Rust wasm module compiled to WebAssembly for client-side image resize with fallbacks and size budgets in bundler. | rust | wasmfrontendperformance |