Code RoomFile upload endpoint spec
MediumPrep Room Coding #4490

File upload endpoint spec

Vibe & agenticAlgorithms & data structuresMid–Senior~16 min

You're directing an AI agent to build a file-upload endpoint in Node/TypeScript that accepts user images, stores them in object storage, and serves them back. Write the spec that makes it safe the first time. What does a quick 'add an image upload endpoint' prompt get wrong?

Implement
screen_image_upload(declared_type: str, magic_hex: str, size_bytes: int, max_bytes: int) → str
Examples
in["image/png","89504e470d0a1a0a",20480,5242880]out"accept-png"
in["image/png","3c737667",900,5242880]out"reject-active-content"
in["image/jpeg","ffd8ffe0",9000000,5242880]out"reject-too-large"
What a strong answer looks like

Treat the AI’s output as a draft to verify, not an answer to trust. Name the specific flaw and the input that triggers it, say how you’d catch it (tests, edge cases, reading critically), and how you’d re-prompt or decompose to get it right.

0:00 of about 16 min

Vibe & agentic: describe the solution in plain language (or narrate it) and the coach grades your approach.

Which questions mattered is sealed until you submit. Telling you now would just be handing over the edge cases.