Code Room
Code reviewMediumcr-g146
Subject Leaky abstractionsLevel Mid–Senior~22 minCommon in Code quality & review interviewsIndustries Software development

Question

Review this Java registration endpoint.

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 reviewjava
@PostMapping("/register")public ResponseEntity<User> register(@RequestBody RegisterReq req) {    User u = new User(req.getEmail(), hash(req.getPassword()));    userRepo.save(u);   // unique constraint on email    return ResponseEntity.ok(u);}
Run or narrate your approach, then ask the coach.