Code Room
Code reviewHardcr-g152
Subject Inconsistent errorsLevel Senior–Staff~24 minCommon in Databases & SQL interviewsIndustries Software development

Question

Review this Python form-submission endpoint's validation.

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
@app.route('/api/applications', methods=['POST'])def create_application():    data = request.get_json()    if not data.get('email'):        abort(400, 'email is required')    if '@' not in data['email']:        abort(400, 'email is invalid')    if not data.get('name'):        abort(400, 'name is required')    if len(data.get('resume', '')) > 100000:        abort(400, 'resume too long')    app_id = save_application(data)    return jsonify({'id': app_id}), 201
Run or narrate your approach, then ask the coach.