IntermediateTECHNICAL
Can you describe a particular data access layer you implemented using Spring Data/JPA or JDBC in a Java microservice? What did your entity or model classes look like, how did you design the repository layer, and how did you handle transactions and lazy loading issues in that project?
Custom Role
General

Sample Answer

On a customer-orders microservice (PostgreSQL, ~5M rows across tables), I used Spring Data JPA. Our main entity was `Order` with a one-to-many to `OrderItem` and a many-to-one to `Customer`. Entities were lean: JPA annotations, validation, and minimal business logic. We used `@EntityGraph` and DTO projections to avoid over-fetching. Repositories extended `JpaRepository<Order, Long>` with a few query methods like `findByCustomerIdAndStatus`. Anything complex went into custom repository implementations using `@Query` with JPQL. The service layer was annotated with `@Transactional`, and we defaulted to read-only transactions for queries to reduce overhead. Lazy loading was a big issue at first; we hit N+1 problems and `LazyInitializationException` in REST controllers. To fix it, we used explicit fetch joins in queries, `@EntityGraph` for common read paths, and mapped to DTOs inside the transaction boundary. That cut some endpoints from 200+ queries down to under 10 and improved response times by ~35%.

Keywords

Lean JPA entities for `Order`, `OrderItem`, `Customer` with proper relationshipsSpring Data JPA repositories with custom queries and DTO projectionsService-layer transaction management with read-only optimizationsExplicit handling of lazy loading (fetch joins, EntityGraph, DTOs) to avoid N+1
Related Questions

In your civil engineering studies, what specific design coursework or project work did you complete related to irrigation channels or canals (e.g., design of lined/unlined canals, distributaries, minors)? Describe one such design in detail, including how you determined discharge, permissible velocity, section dimensions, and lining choice for Gujarat-type soil and climate conditions.

IntermediateTECHNICAL

Based on your hydrology and irrigation engineering background, explain how you would estimate the irrigation water requirement for a kharif crop in a semi-arid region of Gujarat. Walk me through each step: from reference evapotranspiration estimation, crop coefficient selection, effective rainfall calculation, to arriving at canal discharge for a given command area.

IntermediateTECHNICAL

On your resume you mention working on a cross-functional project (e.g., involving multiple teams or stakeholders). Describe a situation from that project where priorities conflicted—how did you navigate the trade-offs and what was the final outcome?

IntermediateSITUATIONAL

Walk me through a recent multi-channel digital marketing campaign you managed end-to-end. How did you set objectives, choose channels, allocate budget, and measure success?

IntermediateBEHAVIORAL

In your resume you note improving or optimizing [a process, KPI, or metric]. What specific baseline metrics did you start from, what steps did you personally take, and how did you verify that the improvement was due to your changes rather than external factors?

IntermediatePROBLEM_SOLVING