HomeChallengesRepsProblemsLeaderboardTake a challenge

Chunk a Document

Split a document into retrievable pieces. No API key, no network — this is string handling, and it is where most RAG apps are already broken.

Beginner15 min on the clock5 graded checks · 100 pointsRAG and Model APIs
Graded by running your code against real cases.

What you build

  • chunkText(text, size, overlap) — fixed-size pieces that overlap
  • splitSentences(text) — every sentence, trimmed
  • chunkBySentence(text, maxLen) — pack sentences without ever splitting one
  • withIds(chunks, docName) — tag each chunk so an answer can cite it

Done means

Chunks overlap, no chunk exceeds its size, and no sentence is ever cut in half.

How it is graded

Published in full, before you start — every point is one of these and there is nothing else. Each one runs your code; it is not a search for keywords.

  1. chunkText slices the text into fixed-size pieces+25Chunking documents
  2. Consecutive chunks overlap by the amount asked for+25Chunking documents
  3. splitSentences finds every sentence and trims it+20Chunking documents
  4. chunkBySentence packs without splitting a sentence+20Chunking documents
  5. withIds tags each chunk so it can be cited+10Grounding and citations

What it teaches

The rest of RAG and Model APIs