Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ All notable changes are documented here. The format follows [Keep a Changelog](h
- The Progress page lists every solved problem, with when it was first accepted and in which languages; the solved counts link to the filtered problem list.
- **Refresh content** never removes problems, solutions or test cases that an earlier import had.

### Fixed

- `LOCALCODE_ALLOWED_HOSTS` set when starting Docker Compose now reaches the app, so it can be served under another host name as the README describes.

### Security

- The runner has no network; the app reaches it over a group-restricted Unix socket.
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@

**Free, offline-friendly coding interview practice that runs entirely on your machine.**

About 4,100 problems · 2,830 judged against 274k hidden tests · company frequency lists for 423 companies · Python, Java, C++ and Kotlin
About 4,100 problems · 2,830 judged against 273k hidden tests · company frequency lists for 423 companies · Python, Java, C++ and Kotlin

[![License: MIT](https://img.shields.io/badge/license-MIT-86A3FF.svg)](LICENSE)
![Python 3.14](https://img.shields.io/badge/python-3.14-3776AB.svg)
![React 18](https://img.shields.io/badge/react-18-61DAFB.svg)
![React 19](https://img.shields.io/badge/react-19-61DAFB.svg)
![Docker Compose](https://img.shields.io/badge/docker-compose-2496ED.svg)
[![PRs welcome](https://img.shields.io/badge/PRs-welcome-4FC48C.svg)](CONTRIBUTING.md)

Expand Down Expand Up @@ -54,7 +54,7 @@ Interview prep sites lock the most useful features behind a subscription: compan
<tr>
<td width="50%">
<img src="docs/images/progress.png" alt="Progress dashboard with solved counts, weekly chart, topic and company coverage">
<p><b>Progress tracking.</b> Solved over time, coverage by topic and by company, submission history and a JSON export.</p>
<p><b>Progress tracking.</b> Every problem you've solved, solved over time, coverage by topic and by company, submission history and a JSON export.</p>
</td>
<td width="50%">
<img src="docs/images/workspace-light.png" alt="The workspace in the light theme">
Expand Down Expand Up @@ -129,7 +129,7 @@ flowchart LR
I --> F["filter invalid test cases"] --> DB[(content.db)]
```

The upstream test cases were generated by running Python solutions on synthetic inputs, and a few of them break the problems' own constraints (for example 64-bit values where a problem promises 32-bit ones). The importer removes cases the typed languages can't represent. It also applies an [exclusion list](backend/localcode/data/excluded_cases.json) of cases that the Java and C++ reference solutions reject, produced by running them over every suite with the same answer checking users get.
The upstream test cases were generated by running Python solutions on synthetic inputs, and a few of them break the problems' own constraints (for example 64-bit values where a problem promises 32-bit ones). The importer removes cases the typed languages can't represent. It also applies an [exclusion list](backend/localcode/data/excluded_cases.json) of about 2,100 cases in 308 problems, produced by `make validate-cases`: it runs the Java and C++ reference solutions over every unfiltered suite with the same answer checking users get, and excludes cases the references reject, plus cases whose recorded answer fails the problem's own answer checker.

See [NOTICE.md](NOTICE.md) for attribution.

Expand Down Expand Up @@ -160,9 +160,9 @@ docker compose cp app:/data/user.db ./localcode-user-backup.db
## Known limitations

- **Kotlin reference solutions are sparse upstream**, so the Solutions tab shows Java for most Kotlin problems. Kotlin submissions are judged normally.
- **Problems with several valid answers** are judged by checking the answer, not by matching one expected output: 74 problems ("return any valid arrangement", course orders, Gray codes, CIDR covers, …) have a checker that validates the answer against the input, and "in any order" answers are compared ignoring order (at every level where the problem allows it). A multi-answer problem without a checker yet is still compared against one expected answer; please report it.
- **Problems with several valid answers** are judged by checking the answer, not by matching one expected output: 75 problems ("return any valid arrangement", course orders, Gray codes, CIDR covers, …) have a checker that validates the answer against the input, and "in any order" answers are compared ignoring order (at every level where the problem allows it). A multi-answer problem without a checker yet is still compared against one expected answer; please report it.
- **Design, SQL, shell and concurrency problems** can be read but not run.
- **C++ is compiled with Clang 19 and `-std=c++23 -O2`**, as on LeetCode, but without AddressSanitizer, so some out-of-bounds bugs that LeetCode would report may go unnoticed.
- **C++ is compiled with Clang 19 and `-std=c++23 -O2`** but without AddressSanitizer, so some out-of-bounds bugs may go unnoticed instead of failing with a runtime error.
- **Cold-start compile times** are about 1 to 2 s for Java and C++ and about 4 s for Kotlin.

## Troubleshooting
Expand All @@ -188,7 +188,7 @@ Start on another port: `LOCALCODE_PORT=8080 docker compose up -d`.
<details>
<summary><b>My correct solution was rejected</b></summary>

A few upstream test cases may still be invalid. Please open a [wrong verdict report](../../issues/new?template=wrong_verdict.yml) with your code and the failing case, and we'll add it to the exclusion list.
A few upstream test cases may still be invalid. Please open a [wrong verdict report](../../issues/new?template=wrong_verdict.yml) with your code and the failing case, and we'll fix the answer checking or exclude the case.
</details>

## Contributing
Expand Down
2 changes: 2 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ services:
- ./content:/content:ro
environment:
LOCALCODE_RUNNER: unix:/run/localcode
# Host names the app answers to (comma-separated); add one to reach it by another name.
LOCALCODE_ALLOWED_HOSTS: ${LOCALCODE_ALLOWED_HOSTS:-localhost,127.0.0.1,::1}
# Optional fallbacks if an upstream disappears (comma-separated):
LOCALCODE_DATASET_MIRRORS: ${LOCALCODE_DATASET_MIRRORS:-}
LOCALCODE_DOOCS_MIRRORS: ${LOCALCODE_DOOCS_MIRRORS:-}
Expand Down