Code RoomBatch send loses partial failures
HardPrep Room Coding #1985

Batch send loses partial failures

Code reviewNetworking & APIsSenior–Staff~25 min

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.

0:00 of about 25 min
Mark a line and say what kind of problem it is.0 findings
1@app.post('/messages/batch')
2def batch_send():
3 msgs = request.get_json()['messages']
4 sent = []
5 for m in msgs:
6 provider.send(m['to'], m['body']) # may raise per-message
7 sent.append(m['id'])
8 return jsonify({'status': 'ok', 'sent': sent}), 200
Which questions mattered is sealed until you submit. Telling you now would just be handing over the edge cases.