Work on

Train in unfamiliar codebases. Identify your blind spots. Expand your engineering range.

Join the waitlist

System familiarity creates blind spots.

Most engineers grow inside the same codebase for years. You become comfortable. You know where everything lives, everything is intuitive

Inside that environment, you feel capable — and you are.

But growth slows down in familiarity. A good test of engineering is adaptability.

That's why transitions become difficult — interviews, new teams, unfamiliar stacks. Not because of inability, but because of limited exposure to systems you didn't build yourself or haven't yet lived in.

THE GAP
KNOWING
  • Understand what an N+1 query is
  • Know that transactions prevent partial failure
  • Know caching improves performance
  • Understand race conditions conceptually
DOING
  • ? Refactor a controller to eliminate N+1 without breaking pagination
  • ? Wrap a multi-step purchase flow in a safe transaction
  • ? Implement cache invalidation without serving stale data
  • ? Fix a race condition inside an existing service layer

Modern engineering roles demand broader systems fluency.

Not because you couldn't, but because you never had to.

Real codebases. Real constraints. Structured practice.

01

Step into a realistic codebase

You receive a full project — controllers, models, services, migrations, tests. This isn't a blank canvas but a system with history. Choose the stack you want to test yourself in

project structure — Laravel / PHP
app/
├── Http/Controllers/
│   ├── OrderController.php
│   ├── ProductController.php
│   └── Api/InventoryController.php
├── Models/
│   ├── Order.php
│   └── Product.php
├── Services/
│   └── PurchaseService.php
├── database/migrations/
└── tests/Feature/
    └── StockManagementTest.php
src/
├── routes/
│   ├── orders.js
│   ├── products.js
│   └── inventory.js
├── models/
│   ├── Order.js
│   └── Product.js
├── services/
│   └── purchaseService.js
├── middleware/
│   └── auth.js
└── __tests__/
    └── stockManagement.test.js
inventory/
├── views/
│   ├── orders.py
│   ├── products.py
│   └── purchase.py
├── models/
│   ├── order.py
│   └── product.py
├── serializers/
│   └── inventory.py
├── migrations/
└── tests/
    └── test_stock_management.py
src/main/java/com/app/
├── controller/
│   ├── OrderController.java
│   └── InventoryController.java
├── model/
│   ├── Order.java
│   └── Product.java
├── service/
│   └── PurchaseService.java
├── repository/
│   └── ProductRepository.java
└── src/test/java/
    └── StockManagementTest.java
internal/
├── handlers/
│   ├── orders.go
│   ├── products.go
│   └── inventory.go
├── models/
│   ├── order.go
│   └── product.go
├── services/
│   └── purchase.go
├── middleware/
│   └── auth.go
└── tests/
    └── stock_management_test.go
src/
├── app/
│   ├── api/orders/route.ts
│   ├── api/products/route.ts
│   └── api/inventory/route.ts
├── lib/
│   ├── models/order.ts
│   ├── models/product.ts
│   └── services/purchase.ts
├── prisma/
│   └── schema.prisma
└── __tests__/
    └── stockManagement.test.ts
02

Read the challenge

The purchase endpoint checks stock and decrements it in separate steps — no locking. Two users buy the last item simultaneously, and stock goes negative.

PROBLEM.md
## Fix Stock Race Condition
Difficulty: Hard · 60-90 min
Skills:    DB Transactions, Pessimistic
           Locking, Concurrency

The purchase endpoint has a classic race
condition. Two concurrent buyers can both
pass the stock check and decrement —
leaving stock at -1.

Use transactions + locking to prevent
overselling. Don't break existing tests.
03

Submit and validate

Your solution runs against a comprehensive test suite. No subjective grading — just clear, automated verification that your fix works under all tests.

test results
> Validating solution...

 stock_never_goes_negative ........ PASS
 concurrent_purchases_handled ..... PASS
 sold_out_returns_409 ............. PASS
 successful_purchase_decrements ... PASS
 order_created_on_success ......... PASS

5 passed — Challenge complete.

Here's what working inside the platform looks like

Widebase already includes multiple challenges, with more continuously being added. Each one drops you into a full project with failing tests and a clear objective.

Hard

Stock Race Condition

Fix a concurrency bug where two buyers oversell inventory

Medium

Fix N+1 Query

Eliminate N+1 queries causing slow order listings

Medium

Secure File Upload

Lock down an endpoint that accepts anything

Hard

Cache Invalidation

Add caching that never serves stale data

Hard

Idempotent Orders

Prevent duplicate orders on client retries

+ More challenges across multiple domains

Fix Stock Race Condition

Hard 60-90 min
Context

The inventory purchase endpoint has a critical bug: it checks and decrements stock without any database transaction or locking. This means:

  • Race condition — Two users buying the last item simultaneously can both succeed, driving stock negative
  • Partial failure — If the second item in a multi-item purchase fails the stock check, the first item's stock is already decremented and never rolled back
Your Task
  • Wrap the entire purchase in a database transaction
  • Use row-level locking when reading product stock to prevent concurrent reads
  • If any item fails the stock check, the entire transaction should roll back
  • Return a 409 response for insufficient stock
Modify
app/Http/Controllers/Api/InventoryController.php
Hints
  • Transactions auto-rollback on exceptions
  • Row-level locks prevent concurrent reads on the same row
  • Throwing a runtime exception inside the transaction triggers the rollback
DB Transactions Pessimistic Locking Concurrency 5 test assertions

Join the waitlist

Get early access to structured, real world engineering challenges.

No spam. Just updates when we launch. Unsubscribe anytime.

✓ You're on the list. We'll be in touch.