Code RoomPub/Sub malformed event retry loop
HardPrep Room Coding #4421

Pub/Sub malformed event retry loop

Vibe & agenticAlgorithms & data structuresSenior–Staff~19 min

An AI agent wrote this Pub/Sub-triggered Cloud Function (Go) that processes events and acks them. A teammate notices one malformed event spinning the function CPU all day and inflating cost. What is the failure mode and how should retries be handled?

Implement
route_pubsub_deliveries(error_kinds: list[str], delivery_attempts: list[int], max_attempts: int) → list[str]
Examples
in[["none","malformed","transient"],[1,1,1],5]out["ack","dead_letter","retry"]
in[["transient"],[5],5]out["dead_letter"]
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 19 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.