Code Room
Code reviewHard
Question
Review this Python batch-send endpoint. It accepts up to 1000 messages and returns 200 when 'done.'
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.
Learn the concepts
@app.post('/messages/batch')def batch_send(): msgs = request.get_json()['messages'] sent = [] for m in msgs: provider.send(m['to'], m['body']) # may raise per-message sent.append(m['id']) return jsonify({'status': 'ok', 'sent': sent}), 200Run or narrate your approach, then ask the coach.