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
9 changes: 9 additions & 0 deletions .github/workflows/sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,22 @@ jobs:
# The summary line is kept for the commit body: the bot commits hourly,
# and a log of identical one-line messages tells a reader nothing about
# which hour the bank actually moved in.
#
# CONTENT_EXPORT_SECRET lets the sync read the free tier's bodies from
# /api/cron/content-export (see CONTENT-DESIGN.md). Unset, the repository
# renders its metadata-only pages exactly as before — and refuses to run
# at all once question pages are published, rather than deleting them.
env:
CONTENT_EXPORT_SECRET: ${{ secrets.CONTENT_EXPORT_SECRET }}
run: python3 scripts/sync.py | tee "$RUNNER_TEMP/sync.log"

- name: Confirm the result is self-consistent
# Re-rendering what was just written must produce no further change. A
# second pass that still finds work means the render is not a pure
# function of the snapshot, which would make the hourly job commit noise
# for ever. --catalog-file so this costs no second read of the API.
env:
CONTENT_EXPORT_SECRET: ${{ secrets.CONTENT_EXPORT_SECRET }}
run: |
python3 scripts/sync.py --snapshot-out /tmp/snapshot.json --quiet
python3 scripts/sync.py --catalog-file /tmp/snapshot.json --check
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
run: |
cp -r . "$RUNNER_TEMP/render-check"
cd "$RUNNER_TEMP/render-check"
rm -rf companies company-types formats by-month guides insights free experiences data
rm -rf companies company-types formats by-month guides insights free experiences data questions
python3 scripts/sync.py \
--catalog-file scripts/fixtures/catalog-sample.json \
--today 2026-09-11
Expand Down
299 changes: 299 additions & 0 deletions CONTENT-DESIGN.md

Large diffs are not rendered by default.

11 changes: 6 additions & 5 deletions DESIGN.md
Original file line number Diff line number Diff line change
Expand Up @@ -278,11 +278,12 @@ trueinterview.io/api/v1/interview-experiences ──┤
pure functions of `(records, date)`, which is what lets the test suite render the entire
repository from a fixture and compare bytes, with no network and no clock.

**Metadata, never bodies.** The API this reads publishes titles, companies, formats,
difficulties, sighting months and URLs — and deliberately no problem statements, no
solutions and no test cases. This repository carries exactly what that API carries. The
distinction is the whole reason an index like this can be public: it is a pointer into the
site, not a copy of it.
**Metadata, and the free tier's bodies — nothing more.** The API this reads publishes
titles, companies, formats, difficulties, sighting months and URLs, and deliberately no
problem statements, solutions or test cases. Since Sep 2026 one more source is read: the
free tier's statements, hints and interview guides, from a separate secret-guarded export,
rendered as company homes and question pages. Solutions, test cases and paid questions
are still never here. How that works and why: [`CONTENT-DESIGN.md`](CONTENT-DESIGN.md).

### Properties worth keeping when you change something

Expand Down
30 changes: 30 additions & 0 deletions LICENSE-CONTENT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Content license

The **text** in this repository — the question statements and hints under
`questions/`, and the company pages, interview-process guides and other guides
under `companies/` — is © TrueInterview and licensed under the
[Creative Commons Attribution 4.0 International license (CC BY 4.0)](https://creativecommons.org/licenses/by/4.0/).
The full legal text is at <https://creativecommons.org/licenses/by/4.0/legalcode>.

You may copy, repost, translate and adapt it — in a blog post, a study group,
a course, another repository, commercially or not — as long as you give credit.

## How to credit

Name TrueInterview, link to the original page, and say whether you changed it.
For example:

> From [TrueInterview](https://trueinterview.io) —
> [Rate Limiter](https://trueinterview.io/questions/rate-limiter), CC BY 4.0.

A link to this repository instead of the page is fine too.

## What is not covered

- **The scripts** in `scripts/` and the workflows in `.github/` are under the
MIT license in [`LICENSE`](LICENSE).
- **Company names and logos** belong to their owners. They are used here only
to say where a question was reported; no company endorses this repository.
- **Anything linked on trueinterview.io but not published here** — reference
solutions, test cases, paid questions and interview reports — is not part of
this license.
32 changes: 20 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,14 @@

---

Every title here opens the real problem on [TrueInterview](https://trueinterview.io) — a
runnable workspace, not a screenshot, and a server-judged verdict on the algorithm,
low-level-design and SQL formats. Synced from the live catalog every hour.
**Every company has a home page** — how it interviews, its interview-process guides in
full, and its free questions with the whole statement and hints — under
[`companies/`](companies/README.md). The free questions live under
[`questions/`](questions/README.md), one folder each. Everything else opens the real problem on
[TrueInterview](https://trueinterview.io): a runnable workspace, not a screenshot, and a
server-judged verdict on the algorithm, object-oriented-programming and SQL formats.
Synced from the live catalog every hour, and free to share under
[CC BY 4.0](LICENSE-CONTENT.md).

## 📊 What companies are actually asking

Expand Down Expand Up @@ -267,16 +272,17 @@ is on a company page, a format page, and (if it carries a sighting date) a month
| [`data/companies.csv`](data/companies.csv) | every company and its question count |
| [`data/guides.csv`](data/guides.csv) | every Study-section writeup, with its company and topics |
| [`data/insights.json`](data/insights.json) | every number on the [insights pages](insights/README.md), as data |
| [`data/paths.json`](data/paths.json) | the folder each published question and guide was given — stable, so links never move |
| [Live API](https://trueinterview.io/developers/api) | what this repo is generated from |

## ⚙️ How it stays current

Everything under `companies/`, `formats/`, `by-month/`, `guides/`, `insights/`, `free/`,
`experiences/` and `data/` is generated hourly by [`scripts/sync.py`](scripts/sync.py) from TrueInterview's public, documented,
read-only catalog API. That API publishes **metadata only** — a title, a company, a format,
a difficulty, a sighting month, a URL. No problem statements, no solutions, no test cases,
and neither does this repository: what you get here is the index, and the questions
themselves live on the site.
Everything under `companies/`, `questions/`, `formats/`, `by-month/`, `guides/`, `insights/`,
`free/`, `experiences/` and `data/` is generated hourly by [`scripts/sync.py`](scripts/sync.py)
from TrueInterview's public, documented, read-only catalog API — which publishes metadata
only — plus one export of the **free tier's** bodies: the statements and hints of free
questions, and the interview guides. Solutions, test cases and paid questions are never
exported, so they are never here; they live on the site.

```bash
python3 scripts/sync.py # refresh from the live catalog
Expand All @@ -296,9 +302,11 @@ never a screenshot or a copied problem statement.**

## 📄 Licence

The tracker — these scripts and the index they generate — is MIT ([LICENSE](LICENSE)). The
questions and guides it points at belong to TrueInterview and are published on the site
under its own terms.
**The text** — question statements, hints, company pages and interview guides — is
licensed [CC BY 4.0](LICENSE-CONTENT.md): repost, translate or adapt it anywhere,
commercially or not, crediting TrueInterview with a link back. **The scripts** are MIT
([LICENSE](LICENSE)). Reference solutions, test cases and paid questions are not published
here and are not covered by either.

---

Expand Down
34 changes: 31 additions & 3 deletions scripts/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@

from __future__ import annotations

import json
from datetime import date
from typing import Sequence

import report
from catalog import Catalog, Experience, Guide, Question, parse_catalog_date
from company_page import company_preamble, company_type_preamble
from content import render_content
from segments import SECTORS, SECTOR_BY_ID, SIZE_LABELS, segment_of
from insights import compute as compute_insights
from labels import FORMAT_ORDER, JUDGED_FORMATS, company_key, company_label, format_label
Expand Down Expand Up @@ -247,7 +249,7 @@ def _companies_index(stats_view, api_labels: dict[str, str], cut_ids: frozenset[
by_sector.setdefault(sector, []).append(row)

def link(row) -> str:
return f"[{escape_cell(row.name)} ({row.questions:,})]({row.key}.md)"
return f"[{escape_cell(row.name)} ({row.questions:,})]({row.key}/README.md)"

body = [
GENERATED_NOTICE,
Expand Down Expand Up @@ -363,7 +365,14 @@ def _type_cell(name: str, api_labels: dict[str, str]) -> str:
return " · ".join(parts)


def build(catalog: Catalog, readme_template: str, today: date) -> RenderResult:
def build(
catalog: Catalog,
readme_template: str,
today: date,
paths: dict[str, str] | None = None,
) -> RenderResult:
"""Every generated file. ``paths`` is the committed ``data/paths.json``: the
folder each published question and guide was given, which must not move."""
questions, guides, api_labels = catalog.questions, catalog.guides, catalog.labels
ordered = sort_questions(questions, today)
guides_by_company = group_guides_by_company(guides, api_labels)
Expand Down Expand Up @@ -439,7 +448,8 @@ def build(catalog: Catalog, readme_template: str, today: date) -> RenderResult:
else ", judged server-side on the algorithm, low-level-design and SQL formats."
)
),
back="[← All companies](README.md) · [← Question bank](../README.md)",
back=f"[📖 How {escape_cell(name)} interviews & the free questions]({key}/README.md) · "
"[← All companies](README.md) · [← Question bank](../README.md)",
questions=rows,
cols=columns_for("company", api_labels, today),
today=today,
Expand All @@ -460,6 +470,22 @@ def build(catalog: Catalog, readme_template: str, today: date) -> RenderResult:

files["companies/README.md"] = _companies_index(stats_view, api_labels, cut_ids)

# ── the content layer ────────────────────────────────────────────────────
# A home per company, and the free tier in full — see `content.py`. The
# path registry is an output as well as an input: a question published for
# the first time is given its folder here, and keeps it from then on.
content_files, registry, content_stats = render_content(
questions=ordered,
guides=guides,
by_company=by_company,
content=catalog.content,
registry=dict(paths or {}),
api_labels=api_labels,
today=today,
)
files.update(content_files)
files["data/paths.json"] = json.dumps(registry, indent=1, sort_keys=True, ensure_ascii=False) + "\n"

# ── company-type pages ───────────────────────────────────────────────────
# "What do quant firms ask" was not a question this repository could answer:
# it knew what Citadel asks and what Optiver asks, and had no way to put the
Expand Down Expand Up @@ -825,6 +851,8 @@ def build(catalog: Catalog, readme_template: str, today: date) -> RenderResult:
future_dated = [q.slug for q in ordered if q.reported_date and q.reported_date > today]

stats = {
**{f"content_{k}": v for k, v in content_stats.items()},
"content_configured": catalog.content is not None,
"future_dated": future_dated,
"questions": len(ordered),
"guides": len(guides),
Expand Down
Loading
Loading