Code RoomInefficient Docker layer caching
MediumPrep Room Coding #4125

Inefficient Docker layer caching

Vibe & agenticAlgorithms & data structuresMid–Senior~14 min

An AI wrote this Dockerfile for a Go service and your CI builds went from 40s to 6 minutes after a one-line app change. The build is correct — but something about layer caching is broken. What did the AI do wrong?

Implement
rebuilt_step_count(steps: list[str], changed_files: list[str]) → int
Examples
in[["copy|.","run|go mod download","run|go build"],["cmd/server/main.go"]]out3
in[["copy|go.mod go.sum","run|go mod download","copy|.","run|go build"],["cmd/server/main.go"]]out2
in[["copy|go.mod go.sum","run|go mod download","copy|.","run|go build"],[]]out0
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 14 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.