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
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ right.
not a row), transport with the narration under it, then the stage and ✓ the
answer beside "The code, live" with hoverable variables and any `caveats`
note under it. Don't add boxes inside the player. The transport and
narration stay under the masthead while the reader scrolls the stage and
narration stay under the top bar while the reader scrolls the stage and
code, and the strip wraps onto more rows on a narrow screen. ✓ Under the player, the
`playHint` line from `page.js`: the keys (`←` `→` step · `space`
play/pause), what the reader can edit "above" and any limits ("up to 12
Expand All @@ -86,12 +86,12 @@ reader should meet first.
## The folder a lesson writes

Everything for a lesson is one folder; `src/pages/leetcode/[slug].astro`
renders every folder that has a `page.js`, and the home page lists problems
renders every folder that has a `page.js`, and the problem list (`/leetcode`) lists problems
only: a problem whose id is in some lesson's `links` gets its title linked
(the whole row opens the page), the rest say "Solution coming soon", and every
row has a "View on LeetCode ↗" link. Problems are grouped by the `category`
each has in `src/data/problems.json`; a problem added there needs one of the
categories listed in `src/pages/index.astro`. There is no page file and no index entry to add.
categories listed in `src/pages/leetcode/index.astro`. There is no page file and no index entry to add.

```
src/lessons/<slug>/page.js the static prose, as Walkthrough props
Expand Down
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Contributing a solution page

The most useful contribution is a new solution page for a problem on the list
that doesn't have one yet: any row on the home page marked *Solution coming
that doesn't have one yet: any row on the problem list (`/leetcode`) marked *Solution coming
soon*. Fixes to existing pages, including better Burmese, are just as welcome.

Before you start, open a page or two to see what one looks like:
Expand Down Expand Up @@ -35,7 +35,7 @@ code they can trust. So three rules are firm:
## Building a page, step by step

A page is one folder, `src/lessons/<leetcode-slug>/`. The route finds it and
the home page links it automatically, so there is nothing else to register.
the problem list links it automatically, so there is nothing else to register.

```
src/lessons/<slug>/statement.html LeetCode's statement, verbatim
Expand Down Expand Up @@ -137,7 +137,7 @@ Every prop is required, and `npm run check` names any that are missing:
`title`, `summary`, `eyebrow`, `lede`, `links`, `constraints`, `part1Sub`,
`widgetTitle`, `traps`, `part2Sub`, `notes`, `cost`, `part3Sub`, `playHint`.
`links` carries the LeetCode problem id, and that id is what links the
problem's row on the home page to your page. `playHint` is the line under the
problem's row on the problem list to your page. `playHint` is the line under the
player in 2·2: the keys, what the reader can edit above it and within what
limits, and what rebuilds.

Expand Down
23 changes: 17 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# LeetCode solution pages

**Live: [learn.devmtnaing.com](https://learn.devmtnaing.com).** Open any problem and step through its solution.
**Live: [learn.devmtnaing.com](https://learn.devmtnaing.com).** Two sections share one site, one design and one progress record:

- **[LeetCode](https://learn.devmtnaing.com/leetcode)**: open any problem and step through its solution.
- **[AI Engineer](https://learn.devmtnaing.com/ai-engineer)**: a self-study path from backend engineer to AI research engineer, built from the markdown course in [`course/`](course/README.md), with quizzes, flashcards, XP and streaks.

[![Lowest Common Ancestor, step 4 of 7: the tree with the call stack beside it and the Ruby line that is running highlighted](docs/screenshots/walkthrough.png)](https://learn.devmtnaing.com/leetcode/lowest-common-ancestor-of-a-binary-tree)

Expand Down Expand Up @@ -32,7 +35,7 @@ theme. The screenshots below are all in the dark one.

**The problem list.** 47 problems grouped by pattern, with search, a difficulty filter and ⌘K from any page.

[![The home page: patterns down the side, problems with difficulty and acceptance rate](docs/screenshots/home.png)](https://learn.devmtnaing.com)
[![The home page: patterns down the side, problems with difficulty and acceptance rate](docs/screenshots/home.png)](https://learn.devmtnaing.com/leetcode)

**In Burmese.** Trapping Rain Water with two pointers, finished.

Expand All @@ -49,7 +52,7 @@ npm run audit # every built page in a real browser (after npm run build)
npm run refresh-problems # re-read titles, tags and acceptance rates from LeetCode
```

The home page lists 45 interview problems, 15 each of easy, medium and hard,
The problem list has 45 interview problems, 15 each of easy, medium and hard,
chosen where three of LeetCode's own study plans agree
([how](docs/problem-list.md)), plus 2 from outside that list, grouped by
pattern (Arrays & Hashing, Two Pointers, Trees, …). Every one of them has a
Expand All @@ -59,11 +62,18 @@ solution page. To add a problem or fix a page, see
## What is in the repo

```
src/pages/index.astro the problem list
src/pages/index.astro the hub: both sections
src/pages/leetcode/index.astro the problem list
src/pages/leetcode/[slug].astro renders every lesson folder
src/lessons/<slug>/ one folder per solution page
src/pages/ai-engineer/ the AI Engineer path, module guides and lesson steps
src/pages/profile.astro progress across both sections
course/ the AI Engineer course as markdown (the pages read it at build)
src/lib/ai/ course parser, quizzes, flashcards, progress painter
src/components/ai/ Preact islands: lesson steps, practice, profile, rail
src/lib/progress.ts progress, XP and streak for the whole site (localStorage)
src/lib/ the shared kit: stepper, stage shapes, trees, i18n
src/styles/ tokens, site chrome, the lesson page, the stage
src/styles/ tokens (one design, a teal and an indigo accent), app shell, lessons, AI section
scripts/check-lessons.mjs structure and format check
scripts/audit.mjs drives every built page in Chromium
scripts/refresh-problems.mjs refreshes src/data/problems.json from LeetCode
Expand All @@ -73,7 +83,8 @@ docs/ how the problem list was chosen; translation not
wrangler.jsonc Cloudflare: serve dist/ at learn.devmtnaing.com
```

The site is fully static: every page is prerendered and served as a file, so
The site is fully static: every page is prerendered and served as a file (the
AI Engineer's interactive steps are small Preact islands on those pages), so
there's no backend. A solution page is a folder of data and one step generator
per approach. The kit supplies the transport, code panel, language switching
and layout. Every lesson has a spec in `verify/`, so `npm run verify --
Expand Down
5 changes: 3 additions & 2 deletions astro.config.mjs
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
// @ts-check
import { defineConfig } from 'astro/config';
import preact from '@astrojs/preact';

// The site is fully static: every page is prerendered at build time and served
// from a CDN. Nothing here runs per-request, which is why there is no adapter.
// Preact renders the few interactive islands of the AI Engineer section.
export default defineConfig({
site: 'https://learn.devmtnaing.com',
// Pages build as /leetcode/two-sum.html and are linked without a slash, so
// Cloudflare serves /leetcode/two-sum directly instead of redirecting to
// /leetcode/two-sum/ on every click.
build: { format: 'file' },
trailingSlash: 'never',
// The problem list used to live here, before it became the home page.
redirects: { '/leetcode': '/' },
integrations: [preact()],
});
52 changes: 52 additions & 0 deletions course/00-setup/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# 00 · Setup (week 0)

Get the tooling out of the way so it doesn't slow you down later.

## 1. Python for ML (coming from Ruby)

You already know Python from backend work. ML Python is a different style: array-oriented, notebook-heavy and full of shapes.

**Learn**
- *Core:* [NumPy: the absolute basics for beginners](https://numpy.org/doc/stable/user/absolute_beginners.html)
- *Core:* [NumPy broadcasting](https://numpy.org/doc/stable/user/basics.broadcasting.html). Broadcasting bugs are the most common silent ML bug.
- *Core:* [PyTorch: Learn the Basics](https://pytorch.org/tutorials/beginner/basics/intro.html)
- *Optional:* [Python Data Science Handbook](https://jakevdp.github.io/PythonDataScienceHandbook/) by Jake VanderPlas (free online), chapters on NumPy and Pandas.

**Build**
- Write matrix multiplication with three nested Python loops, then with NumPy. Time both at 512×512.
- Implement `softmax` in NumPy for a batch of vectors (shape `[batch, classes]`). Make it numerically stable by subtracting the max.

## 2. Environment

- **Package manager:** [`uv`](https://docs.astral.sh/uv/) (fast, handles Python versions and venvs). One project per folder under `projects/`.
- **Notebooks:** Jupyter or VS Code notebooks for exploration. Move code into `.py` files once it works.
- **Experiment tracking:** a free [Weights & Biases](https://wandb.ai/) account. You'll use it from Track 2.
- **Hugging Face account:** for models, datasets and hosting demos.
- **Model API keys:** Anthropic (and optionally one other provider) for Track 1. Set a monthly spend limit.

## 3. GPU access

Your Mac is fine for Track 1 and the early Track 2 work (small models, `mps` backend). Later you'll need NVIDIA GPUs.

| Option | Good for | Notes |
|---|---|---|
| [Google Colab](https://colab.research.google.com/) | Early exercises | Free tier has a T4; Pro is cheap. |
| [Kaggle Notebooks](https://www.kaggle.com/code) | Free GPU hours | Weekly quota. |
| [Modal](https://modal.com/) | Python-native serverless GPUs | A good fit for a backend engineer; pay per second. |
| RunPod / Lambda / Vast.ai | Hourly A100/H100 rentals | For GPT-2 reproduction and inference benchmarks. |
| AWS (g5/g6/p4/p5 instances) | Production-style benchmarks | You know AWS already. Watch the costs. |

**Budget guide:** expect roughly USD 0–20/month in Track 1 and 20–150/month in Track 2. A GPT-2 (124M) reproduction costs about USD 10–30 on rented GPUs.

## 4. Notes system

- Use `notes/` in this repo: one markdown file per week (template in `notes/README.md`).
- Keep a running `notes/glossary.md`. When you meet a new term, write a one-line definition in your own words.
- Consider Anki for spaced repetition of formulas and definitions (softmax, cross-entropy, attention, Adam update rule).

## Checkpoint

- [ ] `uv` project created, NumPy and PyTorch import, a tensor runs on `mps` (Mac) or `cuda` (Colab)
- [ ] Hugging Face, W&B and API accounts ready
- [ ] Stable softmax implemented and tested against `torch.softmax`
- [ ] First weekly note written
86 changes: 86 additions & 0 deletions course/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# From Backend Engineer to AI Research Engineer

A self-study curriculum in three tracks. Each track is a career step you can be hired at, and each one builds the understanding the next track needs.

```
Track 1 Track 2 Track 3
AI Application Engineer ──► ML / AI Systems Engineer ──────► AI Research Engineer
(use models well) (train, tune, serve models) (understand & improve models)
~3.5–4 months ~7–9 months ~8–12 months, then ongoing

════════════════════ Math track runs alongside all three (math/) ═════════════════════
```

**Who this is for:** an experienced backend engineer (Rails, Python, Kafka, AWS, performance work) with no formal ML background who wants real depth rather than only API-level skill.

**Pace assumption:** 12–15 hours/week. Studying full-time roughly halves the timeline.

---

## Layout

| Folder | What's inside |
|---|---|
| [`00-setup/`](00-setup/README.md) | Python/ML tooling, GPU access, how to take notes. Do this first (1 week). |
| [`math/`](math/README.md) | The math track in three levels, matched to the three tracks. |
| [`track-1-ai-application-engineer/`](track-1-ai-application-engineer/README.md) | LLM APIs, prompting, RAG, agents, MCP, evals, production concerns, agent frameworks (LangGraph) & durable workflows (Temporal). |
| [`track-2-ml-systems-engineer/`](track-2-ml-systems-engineer/README.md) | Neural nets from scratch, deep learning, transformers, fine-tuning, GPUs, inference, distributed training, Kubernetes & GPU infrastructure. |
| [`track-3-research-engineer/`](track-3-research-engineer/README.md) | Deeper theory, RL and post-training, interpretability, reading and reproducing papers, doing research. |
| [`track-3-research-engineer/papers.md`](track-3-research-engineer/papers.md) | A reading list of core papers, ordered. |
| [`projects/`](projects/README.md) | Every capstone project in one place, plus a write-up template. |
| [`notes/`](notes/README.md) | Your learning log. One file per week. |
| The site | [learn.devmtnaing.com/ai-engineer](https://learn.devmtnaing.com/ai-engineer) is built from these files (`src/pages/ai-engineer/`): path, quizzes, flashcards, XP and streaks. |

---

## Timeline at a glance

| Month | Track work | Math alongside | You can apply for |
|---|---|---|---|
| 0 | Setup | – | – |
| 1–4 | **Track 1**: modules 1.1–1.8 + capstone (AI Factory Ops Agent v1) | Level 1 (vectors, similarity, softmax, basic probability) | AI Engineer (Agents & Applications), AI Product Engineer, backend roles on AI teams |
| 5–7 | **Track 2**: modules 2.1–2.5 (from scratch → fine-tuning) | Level 2 (linear algebra, calculus, probability, optimization) | – |
| 8–12 | **Track 2**: modules 2.6–2.10 (GPUs, inference, distributed, platform, Kubernetes) + capstones, Ops Agent v2 | Level 2 finish | **ML Platform / ML Infrastructure / Inference Engineer** |
| 13–18 | **Track 3**: modules 3.1–3.5 | Level 3 (deeper probability, optimization, information theory) | – |
| 19–24+ | **Track 3**: modules 3.6–3.7, paper reproductions, original work | Level 3 ongoing | **AI Research Engineer** (lab, applied research team, or fellowship such as MATS or Anthropic Fellows) |

You don't have to finish everything before moving on. Get a job at the Track 1 or Track 2 level and keep going while employed. That's the normal route.

---

## How each module works

Every module has the same four parts:

1. **Why it matters**: one or two lines.
2. **Learn**: *core* resources (do these) and *optional* ones (go deeper if you're curious).
3. **Build**: hands-on exercises. Not optional; this is where the learning happens.
4. **Checkpoint**: what you should be able to do or explain before moving on. If you can't do it, go back.

## Rules that make this work

1. **Implement before you import.** Before using a library for something (attention, LoRA, BM25, Adam), write a small version yourself in NumPy or PyTorch. It can be slow and ugly.
2. **Write up everything you build.** A README with what you tried, what failed, numbers and plots. Publish the good ones on devmtnaing.com. Write-ups are how you'll show depth to hiring managers.
3. **Measure, don't guess.** Every project needs a number: eval score, loss, tokens/sec, p95 latency, $ per 1M tokens. You already do this with APIs and databases; keep doing it.
4. **Learn the math when the code needs it.** Don't spend three months on math before touching a model. The `math/` track tells you which math to learn at which stage.
5. **Weekly rhythm:** about 60% building, 30% studying, 10% writing. Log the week in `notes/`.
6. **Explain it out loud.** If you can't explain a concept to a junior engineer on a whiteboard, you don't understand it yet. That was true for Kafka, and it's true for backprop.

---

## Progress

Tick these off as you go. The detailed checklists are in each track's README.

- [ ] 00 Setup complete
- [ ] Track 1 modules complete
- [ ] Track 1 capstone published
- [ ] Math Level 1
- [ ] Track 2 modules 2.1–2.5
- [ ] Track 2 modules 2.6–2.10
- [ ] Track 2 capstones published (at least 2 of 4)
- [ ] Math Level 2
- [ ] Track 3 modules 3.1–3.5
- [ ] Track 3 paper reproduction published
- [ ] Track 3 original study published
- [ ] Math Level 3
Loading
Loading