Code Room
Code reviewHardcr-g099
Subject Partial failureLevel Senior–Staff~35 minCommon in Databases & SQL interviewsIndustries Software development

Question

Review this Java dual-write (DB + search index).

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
@Servicepublic class ProductService {    private final ProductRepository productRepo;    private final SearchIndex searchIndex;    private final RedisCache cache;     public void createProduct(Product p) {        p.setId(UUID.randomUUID().toString());        productRepo.save(p);          // Postgres        searchIndex.index(p);         // Elasticsearch        cache.put(p.getId(), p);      // Redis    }}
Run or narrate your approach, then ask the coach.