Hexaware - Java Full Stack Developer Lead Interview Q&A
1. What are the new features in Java 8?
Java 8 introduced Lambda expressions, Stream API, Functional interfaces, Optional, default and static
methods in interfaces, and the java.time package for date/time.
2. What is a functional interface?
An interface with only one abstract method. Examples: Runnable, Callable, Comparator, and custom
interfaces with @FunctionalInterface annotation.
3. Explain Spring Boot auto-configuration.
Spring Boot auto-configures beans based on the libraries in the classpath. It reduces boilerplate and
simplifies configuration.
4. What is @RestController in Spring Boot?
@RestController is a convenience annotation that combines @Controller and @ResponseBody, used to
create RESTful APIs.
5. How do you handle exceptions in Spring Boot?
Using @ControllerAdvice and @ExceptionHandler to define global exception handlers and custom error
responses.
6. What are the differences between JPA and Hibernate?
JPA is a specification; Hibernate is an implementation of JPA with additional features.
7. What is Lazy and Eager fetching in Hibernate?
Lazy loading delays loading until needed; Eager loads relationships immediately. Use wisely to avoid
performance issues.
Hexaware - Java Full Stack Developer Lead Interview Q&A
8. What is the difference between get() and load() in Hibernate?
get() fetches immediately and returns null if not found; load() returns proxy and throws exception if not found.
9. What is a RESTful API?
An API following REST principles: stateless, resource-based, uses HTTP methods (GET, POST, PUT,
DELETE).
10. What is idempotency in REST APIs?
An idempotent operation can be repeated with the same effect. Important for safe retries (e.g., PUT,
DELETE).
11. How do you version a REST API?
Use URI versioning (e.g., /api/v1/resource), request headers, or query parameters.
12. How do you secure a REST API?
Use HTTPS, JWT tokens, OAuth2, input validation, and proper error handling.
13. What is JWT?
JWT (JSON Web Token) is a compact token format used for stateless authentication.
14. What is the difference between OAuth2 and SAML?
OAuth2 is used for API access delegation with tokens; SAML is XML-based and used for authentication in
enterprise apps.
15. What are common SQL join types?
INNER JOIN, LEFT JOIN, RIGHT JOIN, FULL JOIN.
Hexaware - Java Full Stack Developer Lead Interview Q&A
16. SQL query to get 2nd highest salary?
SELECT MAX(salary) FROM employee WHERE salary < (SELECT MAX(salary) FROM employee);
17. How do you write a stored procedure in Oracle?
Use CREATE OR REPLACE PROCEDURE syntax with IN/OUT parameters and PL/SQL block.
18. What is Docker and why use it?
Docker allows packaging applications with dependencies into containers for consistent deployment.
19. What is a Dockerfile?
A text file with instructions to build a Docker image.
20. How do you run a Spring Boot app in Docker?
Create a Dockerfile, build with docker build, run with docker run exposing the app port.
21. What is Kubernetes?
An orchestration system for managing containerized applications (pods, deployments, services).
22. How does Git branching work?
Feature branches, develop, main/master, use merge or rebase to integrate changes.
23. What is CI/CD?
CI (Continuous Integration) builds/test code automatically; CD (Continuous Delivery/Deployment) automates
release.
24. What is the purpose of SonarQube?
Hexaware - Java Full Stack Developer Lead Interview Q&A
SonarQube analyzes code quality, identifies bugs, vulnerabilities, and code smells.
25. What is the role of JFrog Artifactory?
It is a repository manager to store and manage build artifacts.
26. Explain difference between monolith and microservices.
Monolith is one large unit; microservices are independently deployable smaller services.
27. What is the use of BehaviorSubject in Angular?
BehaviorSubject holds a current value and emits it to new subscribers.
28. What are Observables in Angular?
A way to handle async data. Observables emit values over time and support reactive programming.
29. What is reactive form in Angular?
A model-driven approach to handling form inputs using FormControl and FormGroup.
30. How do you handle HTTP errors in Angular?
Using HttpInterceptor or catchError operator in services.
31. How do you mentor junior developers?
Code reviews, pairing sessions, walkthroughs, explaining best practices and architecture.