BugForge
Learn

The ideas behind every bug, explained once, properly.

43 short lessons across Node.js, databases, Python and the core debugging loop. The database track starts from zero and every lesson ends with code you run right here.

LV 10 xp
50 xp to level 2 · read a lesson +1 · solve an exercise up to +10
Core 8m

The debugging playbook

A repeatable loop for any failing codebase: reproduce, localise, explain, fix, verify.

Node.js 6m

The event loop, visually

Call stack, microtasks, macrotasks: why Promise callbacks beat setTimeout(0).

Node.js 7m

Express request pipeline

Middleware order, next(), error handlers with four arguments, and 'headers already sent'.

Databases 8m

Mongoose & MongoDB essentials

Queries, ObjectIds, CastError, {new: true}, populate, unique indexes, hooks.

Core 4m

HTTP status codes that tests check

200 vs 201 vs 204, 400 vs 422, 401 vs 403, 404 vs 409: pick the right one every time.

Node.js 6m

Async pitfalls catalogue

Every async bug that shows up in debugging rounds, with the one-line fix.

Node.js 6m

JavaScript gotchas

The language quirks that turn into one-line bugs.

Python 6m

Python gotchas

Mutable defaults, late binding, shallow copies, and friends.

Core 7m

Concurrency, retries & idempotency

Race conditions, idempotency keys, backoff with jitter: the 'production' bugs.

Core 8m

DSA pattern cheat sheet

Signals in the problem statement → the pattern to reach for, with complexity.

Core 5m

Building from a spec

How to approach implementation labs: interfaces first, edge cases early, tests as the contract.

Node.js 6m

Modules: require, import and the cache

module.exports vs exports, the require cache, circular imports and ESM differences.

Node.js 7m

Errors in Node and Express

throw vs reject, async handlers, error middleware, custom error classes and status codes.

Node.js 7m

Dates, timestamps and money in JS

Zero-based months, UTC vs local, seconds vs milliseconds, and why money is integer cents.

Node.js 6m

Reading request input safely

params, query and body: everything is a string until you parse it, and some of it is hostile.

Node.js 7m

Auth: hashing, JWTs, 401 vs 403

bcrypt, signing and verifying tokens, reading the Authorization header, and role checks.

Node.js 6m

Webhooks and signatures

HMAC over the raw body, timing-safe compare, replay windows, and answering 2xx fast.

Node.js 6m

Caching without stale bugs

Cache keys, TTL units, invalidation on writes, returning copies, and an LRU with Map.

Node.js 6m

Reading Jest failures fast

toBe vs toEqual, toThrow needs a function, async tests, supertest and fake timers.

Node.js 6m

EventEmitter and streams

Synchronous emit, the special 'error' event, removing listeners, and backpressure.

Node.js 6m

Express routing traps

Route order, params vs literals, Router mount paths, and middleware that runs for the wrong routes.

Node.js 5m

Config and environment variables

process.env is all strings, || vs ??, defaults, and secrets read before they exist.

Node.js 5m

Don't block the event loop

Sync fs, heavy loops and big JSON stall every request. How to spot and fix them.

Node.js 6m

REST API conventions tests expect

Resource URLs, status codes, response shapes, pagination metadata and idempotent methods.

Node.js 6m

Web security basics for APIs

Injection, mass assignment, CORS, rate limits and the leaks tests look for.

Node.js 5m

Reading stack traces and logs

Find your frame, decode the classic TypeErrors, and log like you mean it.

Databases 5m 0/2

Your first database with Node

Start here. What a document, a schema and a model are, then save and read your first books.

Databases 6m 0/2

Finding things: filters and operators

Filters are just objects. Add $gt, $in and $regex, then sort and limit the results.

Databases 6m 0/1

Connect a database to an API

Wire a model into Express routes: 201 on create, 400 for bad input, 404 when nothing's there.

Databases 6m 0/1

Updating safely

$set and $inc, getting the updated document back, and the race that oversells your stock.

Databases 5m 0/1

Relations and populate

Store an id, not a copy. Then let populate fill in the related document when you read.

Databases 5m 0/1

Pagination that adds up

skip and limit, why you must sort, counting the total, and capping page size.

Databases 6m 0/1

Reports with aggregate

Group, sum, count and rank with a pipeline: the query behind every dashboard.

Databases 5m 0/1

Database errors to status codes

ValidationError, duplicate keys and CastError: turn each into the right 4xx, and never leak the password.

Python 6m

Names, mutability and copies

Variables are labels: aliasing, shallow vs deep copies, is vs ==, and hashability.

Python 6m

Iterators, generators and comprehensions

One-shot generators, zip truncation, sorting keys, and changing a collection while looping.

Python 6m

Exceptions and context managers

Catch the right thing, keep the cause, roll back on failure, and always clean up.

Python 6m

Classes and dataclasses

Instance vs class state, default_factory, equality and hashing, properties and repr.

Python 7m

Collections for interviews

dict/set costs, defaultdict, Counter, deque, heapq tie-breaks, bisect and OrderedDict LRU.

Python 6m

Time and numbers in Python

Seconds vs datetimes, naive vs aware, timedelta math, Decimal money and banker's rounding.

Python 6m

Reading Python test failures

unittest and pytest side by side, tracebacks bottom-up, assertRaises, approx and mocking time.

Python 5m

Scope, closures and function arguments

LEGB lookup, UnboundLocalError, nonlocal, keyword-only args, *args/**kwargs and decorators.

Python 6m

asyncio essentials

Coroutines that never run, gather vs sequential awaits, blocking calls and locks.