As reported: JPMorgan Chase Super Day code-review round, usually paired with a DSA question. SDE-2 loop (India, Dec 2025), round 1 (1 hour, coding + code review): given a pull request, say what review comments you would add — focus on Spring Boot fundamentals and best practices. SDE-2 (Bengaluru, May 2025): a codebase presented as a colleague's PR to review; points raised included camelCase naming, no hardcoded strings, moving static code to a util class and replacing strings with constants. SDE 3 (July 2025, HackerRank CodePair): a PR to analyze and comment on; points raised: hardcoded values to move to a resources file, hashing passwords instead of storing them in plain text, design patterns. SWE 3 (Oct 2025): a piece of code with a few APIs — variable names, exception handling, enums, reusing common code, synchronization/locking. SDE 3 (Nov 2025): a bunch of code to review by coding practices, in the language of the candidate's choice.
A colleague opened this pull request for a Spring Boot service. Review it: list the comments you would leave, most important first, and say how you would fix each.
@RestController
public class user_controller {
private static Map<String, User> CACHE = new HashMap<>();
private UserRepository repo = new UserRepository("jdbc:postgresql://10.0.4.12:5432/users", "admin", "admin123");
@PostMapping("/register")
public String Register(@RequestBody User u) {
try {
if (u.getEmail() == null || !u.getEmail().contains("@") || u.getEmail().length() > 100) {
return "invalid email";
}
if (repo.query("select * from users where email = '" + u.getEmail() + "'").size() > 0) {
return "already exists";
}
u.setStatus("ACTIVE");
u.setPassword(u.getPassword());
repo.save(u);
CACHE.put(u.getEmail(), u);
return "ok";
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
@PutMapping("/updateEmail")
public String update_email(@RequestParam String old_mail, @RequestParam String new_mail) {
if (new_mail == null || !new_mail.contains("@") || new_mail.length() > 100) {
return "invalid email";
}
User d = CACHE.get(old_mail);
if (d.getStatus() == "ACTIVE") {
d.setEmail(new_mail);
repo.save(d);
CACHE.remove(old_mail);
CACHE.put(new_mail, d);
}
return "ok";
}
}
Cover correctness, security, concurrency, Spring Boot practice, and readability.