Code Room
Code reviewMediumcr-g581
Subject Concurrency fire and forget asyncLevel Mid–Senior~27 minCommon in Concurrency interviewsIndustries Software development

Question

Review this Python asyncio code that records audit events.

What a strong answer looks like

Separate real bugs from style. Rank issues by severity, point at the root cause rather than the symptom, and suggest a concrete fix — specific and kind.

Talk through your review
Code to reviewpython
import asyncio async def write_audit(event):    await db.execute("INSERT INTO audit VALUES ($1)", event) async def handle_request(req):    result = await process(req)    asyncio.create_task(write_audit(req.id))  # log in background    return result async def main():    for req in incoming():        await handle_request(req)
Run or narrate your approach, then ask the coach.