# Free code review challenges with explanations and runnable examples

> Practice three small JavaScript, Python and TypeScript code reviews. Predict the behavior, inspect a repair and run the original public teaching examples.

- Canonical HTML: [https://unrust.dev/guides/public-code-review-challenges](https://unrust.dev/guides/public-code-review-challenges)
- Markdown representation: [https://unrust.dev/guides/public-code-review-challenges/index.md](https://unrust.dev/guides/public-code-review-challenges/index.md)

Published: 2026-10-21
Published by Unrust. Scoring and editorial method: https://unrust.dev/help#methodology

## Direct answer

Start with a written contract, predict a boundary case, then compare the original code and a repair using the same input. This public lab offers three worked examples: a retry budget, a consumed iterator and an explicit false default. Each includes an explanation and runnable checks.

## Choose a review problem

These short examples focus on one reasoning error at a time. The published answers make them suitable for self-study, team discussion or an attributed tutorial. They are not timed assessments or evidence of a person’s skill level.

**Three original teaching examples**

| Language | Contract to inspect | Counterexample |
| --- | --- | --- |
| JavaScript | A total attempt budget | Zero and three allowed calls |
| Python | A finite iterable can be read once | The same rows as a list and generator |
| TypeScript | Preserve an explicit false | Omitted, true and false options |

- [Retry budget challenge](https://unrust.dev/guides/javascript-retry-budget-challenge/index.md)
- [Iterator consumption challenge](https://unrust.dev/guides/python-iterator-consumption-challenge/index.md)
- [Explicit false challenge](https://unrust.dev/guides/typescript-explicit-false-challenge/index.md)


## Reproduce the examples

Clone the public MIT-licensed lab. Node.js 22 or later and Python 3 run the supplied checks. The TypeScript example is executed through its documented JavaScript runtime equivalent; its source is also checked by the site’s TypeScript-based authoring test. No account, API key or hosted code runner is required.

The site’s publication check executes each original and repaired snippet and compares the boundary outputs. These checks establish behavior for the stated cases, not a production reliability guarantee.


- [GitHub source, commands and license](https://github.com/yomariano/unrust-code-review-lab)
- [Download all examples and explanations as JSON](https://unrust.dev/resources/code-review-lab.json)

## Use the lab for a focused review session

Give each reader the contract and original snippet first. Ask for a predicted output and the smallest input that could disprove the implementation. Reveal the explanation after everyone has committed to a prediction.

Keep the discussion about observable behavior. If you change the contract, revisit the repair. For example, an attempt budget that includes the first send differs from a retry count after that send.

For broader practice, explore Unrust’s unassisted diagnostic or a topic guide. The public lab is an open teaching resource and is not part of either assessment bank.

- [Reviewing AI-generated code](https://unrust.dev/guides/reviewing-ai-generated-code/index.md)
- [Try the unassisted diagnostic](https://unrust.dev/diagnostic/index.md)


## Practice loop

1. Choose one language and read the contract.
2. Predict the original output without running it.
3. Read the explanation and execute the checks.
4. Publish your own new case with its assumptions and limits.

## Common questions

### Do these examples require an account?

No. All three worked challenges and the downloadable source are public.

### Are these the answers to Unrust’s private assessment?

No. They are separate original teaching examples, deliberately published with their explanations.

## Limitations

Three small worked examples cannot establish coding proficiency or measure the effect of AI use.

## Provenance

Original Unrust public teaching series, published and execution-checked on 21 October 2026. Source and examples are MIT licensed.

## Related guides

- [Can a retry loop exceed its attempt budget?](https://unrust.dev/guides/javascript-retry-budget-challenge/index.md): Trace an off-by-one retry loop, test the zero and three-attempt boundaries, and review a minimal JavaScript repair.
- [Why does this Python total work for a list but fail for a generator?](https://unrust.dev/guides/python-iterator-consumption-challenge/index.md): Review a validation pass that exhausts a generator, then compare a one-pass Python repair using executable counterexamples.
- [Why does a TypeScript default erase an explicit false?](https://unrust.dev/guides/typescript-explicit-false-challenge/index.md): Test a boolean default with false and an omitted field, then use nullish coalescing to preserve an explicit user choice.

Next step: [Take the free diagnostic](https://unrust.dev/diagnostic/index.md)
