Contribute

Help other developers practise.

Backend Dojo is free and open source. Every exercise was written by someone who spotted a bug pattern worth teaching. Add yours, fix an answer key, or improve the app. No build tools needed.

Ways to help

Add an exercise

Turn a bug you've seen in a real code review into a short pull request with an answer key.

Improve an answer key

A wrong line, an unclear explanation, or a missing keyword that made Quick check miss a good review.

Report a problem

Something broken or confusing? Open an issue with the exercise name and what you expected.

Improve the app

Plain HTML, CSS and JavaScript modules in js/ and css/. Edit, reload, done.

Add an exercise

An exercise is one folder with an exercise.json answer key. Its mode decides what else goes in it: code to review (review), starter code plus tests and a solution (coding, debug), or nothing else (concepts, design).

  1. Fork and run it locally

    Fork the repo on GitHub, clone your fork, and serve the folder. Any static server works.

    git clone https://github.com/<you>/backend-dojo.git
    cd backend-dojo
    python3 -m http.server 8000
  2. Create a folder

    Use a short, lowercase id with dashes. It becomes the link to the exercise.

    content/exercises/settlement-batch/
      exercise.json
      SettlementJob.java
      SettlementJob.kt
  3. Write the code

    Review: about 20–40 lines that look like a real pull request, with realistic names, no imports and no comments pointing at the bugs. Coding and debug: a starter file the user edits (imports at the top), a test file, and a reference solution. Write the Kotlin version idiomatically, not as a line-by-line translation.

    Test files print one line per test, PASS name or FAIL name: message, and must not contain imports or colons in test names. In Java the test file holds public class Main; in Kotlin a top-level fun main(). Copy the test helper from an existing exercise.

  4. Write the answer key

    List the points a strong answer covers in exercise.json (format below). In review and debug mode, point each one at its line with a piece of text from that line. Concepts and design exercises can add a model answer.

  5. Register it

    Add the folder name to "exercises" in content/index.json.

  6. Validate and preview

    The validator checks the format and that every anchor points at exactly one line. For coding and debug exercises, the solution check compiles and runs everything: the solution must pass every test, and the starter code must fail at least one. It needs a JDK 17+ and network access for Kotlin.

    node scripts/validate.mjs
    node scripts/check-solutions.mjs settlement-batch
    open http://localhost:8000/practice.html#settlement-batch
  7. Open a pull request

    CI runs both checks. Say in the description what the exercise teaches and where the pattern comes from.

File format

exercise.json
{
  "mode": "debug",
  "title": "Settlement batch",
  "topic": "data",
  "level": "Standard",
  "context": "Nightly job that settles trades.
              Make every test pass.",
  "files":    { "java": "Settlement.java",
                "kotlin": "Settlement.kt" },
  "tests":    { "java": "SettlementTests.java",
                "kotlin": "SettlementTests.kt" },
  "solution": { "java": "SettlementSolution.java",
                "kotlin": "SettlementSolution.kt" },
  "points": [{
    "sev": "major",
    "title": "Settles the same trade twice",
    "at": { "java": "for (Trade t : pending)",
            "kotlin": "for (t in pending)" },
    "why": "Retries re-read trades already settled.",
    "fix": "Mark each trade settled in the same transaction.",
    "kw": ["twice", "idempoten", "mark settled"]
  }]
}
FieldWhat it is
modereview, coding, debug, concepts or design.
titleShort name shown in the exercise list.
topicOne of the topic ids below.
levelWarm-up, Standard or Hard.
contextThe PR description, task or question. Include every fact needed, such as "singleton" or "runs on several instances".
filesCode per language (java, kotlin or both): the code to review, or the starter code. Not used in concepts and design.
tests, solutionCoding and debug only: test file and reference solution per language. Debug may leave out the solution.
answerOptional model answer, shown after the key in concepts and design.
refsOptional further reading. https links only.
sevmajor (important) or minor (nice to have). Major counts double in the score.
atReview (required) and debug (optional): text from the point's line, per language. It must match exactly one line.
title, why, fixOne string, or { "java": …, "kotlin": … }. fix is required in review and debug.
kwLowercase phrases for Quick check. An answer containing any of them counts as covered.

Topic ids

IdTopicCovers
Loading…

What makes a good exercise

Realistic

Code a teammate could plausibly open a PR with. The bugs should come from real reviews, not puzzles.

Findable

Every issue can be spotted from the code and the PR description alone. State the facts that matter, such as threads, instances or data sizes.

Focused

4–8 points, mostly important ones. Skip pure style nits that a linter would catch.

Explained

why describes the impact in production, and fix is concrete enough to act on.

Fair to Quick check

Keywords are specific phrases a good review would use, like "computeifabsent", not words like "bug" that match anything.

Correct

Check claims about library behaviour by running code when you can. A wrong answer key teaches the wrong thing.

Licensing and sources

Your contribution is CC BY 4.0

Exercises are shared under CC BY 4.0 and app code under MIT. By opening a pull request you agree to license your work that way.

Write it yourself

Bug ideas and patterns are free to reuse. Code and text copied from books, courses or blogs usually aren't, even if they're public.

Link, don't copy

Point to the article or docs that explain a pattern well in refs.

Open sources are fine

Material under MIT, Apache 2.0 or CC0 can be adapted. Credit it in refs.

Pull request checklist

  • node scripts/validate.mjs passes.
  • For coding and debug: node scripts/check-solutions.mjs <id> passes.
  • The exercise opens on the practice page, in every language it has.
  • Show answer key pins each issue on the right line.
  • A good review gets a high score with Quick check.
  • The code and text are your own, or come from an openly licensed source credited in refs.
  • The folder is listed in content/index.json.