-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathjava-interview
More file actions
25 lines (25 loc) · 1.95 KB
/
java-interview
File metadata and controls
25 lines (25 loc) · 1.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
1. Explain the difference between volatile, synchronized, and Atomic variables in Java.
2. How does the Java Memory Model (JMM) handle visibility and ordering of threads?
3. What is the difference between CompletableFuture and traditional Future in Java?
4. How do you implement a custom annotation in Java and process it at runtime?
5. Explain the difference between checked, unchecked, and error types in Java.
6. How does Garbage Collection work in Java 17+ (including G1 GC and ZGC)?
7. What are memory leaks in Java, and how do you detect and fix them?
8. How does Optional help in avoiding NullPointerException?
9. How do you implement caching in Spring Boot (with @Cacheable, @CacheEvict)?
10. What is the difference between BeanFactory and ApplicationContext?
11. Explain the Bean lifecycle in Spring (with example).
12. What are @Lazy and @DependsOn annotations in Spring, and when to use them?
13. How does Spring Boot auto-configuration work internally?
14. What is the role of spring.factories in Spring Boot?
15. What is the difference between application․properties and application.yml in Spring Boot?
16. How do you implement transaction management in Spring Boot (declarative vs programmatic)?
17. Explain the difference between @Transactional propagation types in Spring.
18. What is the difference between JpaRepository and CrudRepository in Spring Data JPA?
19. How do you handle pagination and sorting in Spring Data JPA?
20. How to implement a custom query in Spring Data JPA using @Query annotation?
21. Explain how to implement exception handling in REST APIs using @ControllerAdvice and @ExceptionHandler.
22. What is the difference between @RestController and @Controller in Spring?
23. How do you secure a REST API using Spring Security and JWT?
24. What is the difference between Kafka’s producer and consumer configurations in a Spring Boot microservice?
25. How do you design an event-driven microservice architecture using Spring Boot, Kafka, and REST APIs?