Java Developer Scenario Questions (India)
Before walking into a technical or stakeholder discussion for Enterprise Backend, rehearse clear mental models across Java, Spring Boot, Maven / Gradle. Active hiring pools show 768+ live openings seeking Core Java 17+, Spring Boot, Hibernate / JPA fluency right now.
- How does Spring @Transactional behave when called from another method inside the same bean? — Direct this.method() calls bypass the Spring proxy so @Transactional attributes do not apply; extract into another service bean or use TransactionTemplate.
- Compare HashMap vs ConcurrentHashMap concurrency in Java 8+. — ConcurrentHashMap uses CAS for empty bins and synchronizes only the head node of occupied buckets, avoiding global locks.
- What causes LazyInitializationException in Spring Boot REST controllers? — Serializing an entity with lazy relations outside the active Hibernate transaction fails; map transactional queries directly to DTO projections.
- How do you tune JVM garbage collection for low tail-latency APIs? — Set explicit Xms/Xmx limits within container RAM bounds, monitor GC pause logs, and adopt G1GC or ZGC depending on heap size.