Java Software Engineer Interview Questions

4,195 java software engineer interview questions shared by candidates

Technical Round: Q1. Explain the Spring Security. Q2. Explain the flow of a Rest API call from frontend to backend and response back to frontend. Q3. Explain JWT token. Q4. Define Filters and Segmentation in Spring Security. Q5. How one microservices authenticate another microservice with jwt? Q6. What is a functional interface? Q7. Give an example of a java interface which uses a functional interface. Q8. Write a code to implement Runnable using lambda. Q9. Which is springboot default server and How to use another server in srpingboot? Q10. What are profiles and how to use them? Q11. How is bean Injection working? Q12. How to inject a specific bean of the same object? Q13. How to set up a discovery server? Like Eureka Q14. What is the use of @Primary annotation? Q15. Which method can we use to check if a service is up or not? Q16. How would you externalize a microservice? Q17. What is the default port of springboot? Q18. What is an optional class and its use? Q19. Optional.Of() vs Optional.ofNullable() Q20. Write sql query to return 2nd highest salary. Q21. What is a Rest template?
avatar

Java Software Developer

Interviewed at Infosys

3.6
Mar 11, 2025

Technical Round: Q1. Explain the Spring Security. Q2. Explain the flow of a Rest API call from frontend to backend and response back to frontend. Q3. Explain JWT token. Q4. Define Filters and Segmentation in Spring Security. Q5. How one microservices authenticate another microservice with jwt? Q6. What is a functional interface? Q7. Give an example of a java interface which uses a functional interface. Q8. Write a code to implement Runnable using lambda. Q9. Which is springboot default server and How to use another server in srpingboot? Q10. What are profiles and how to use them? Q11. How is bean Injection working? Q12. How to inject a specific bean of the same object? Q13. How to set up a discovery server? Like Eureka Q14. What is the use of @Primary annotation? Q15. Which method can we use to check if a service is up or not? Q16. How would you externalize a microservice? Q17. What is the default port of springboot? Q18. What is an optional class and its use? Q19. Optional.Of() vs Optional.ofNullable() Q20. Write sql query to return 2nd highest salary. Q21. What is a Rest template?

Swagger and frontend templates (when I specifically told him I am a backend engineer) Oauth and grant types. Streams. (String s ="JAVA") give non repeatable first character (J) output of this code: private static void doStuff() { for (int i = 0; i <= 5; i++) { doStuff(); // recursive call inside the loop } } public static void main(String[] args) { doStuff(); // initial call }
avatar

Java Software Engineer

Interviewed at Infosys

3.6
Sep 11, 2025

Swagger and frontend templates (when I specifically told him I am a backend engineer) Oauth and grant types. Streams. (String s ="JAVA") give non repeatable first character (J) output of this code: private static void doStuff() { for (int i = 0; i <= 5; i++) { doStuff(); // recursive call inside the loop } } public static void main(String[] args) { doStuff(); // initial call }

write a program for string reversal eg. if input is "abcd" then output should be: dcba why do we use enum when constants are there? Questions about the SpringBoot? Spring, SpringBoot, Hibernate, JDBC annotations Where do be mention the hibernate db connection details. Question on mvc architecture get, put, post methods Question on microservices Question on webservices Question on git commands Question on git: how to push the changes to upper stages like uat, and prod switch case vs if else which to use collection vs map list vs all types of maps hibernate questions hql what is dialect in hibernate junit annotations java 11 features java 8 features rest, oops concepts
avatar

Software Engineer - Java Developer

Interviewed at Infosys

3.6
Sep 24, 2022

write a program for string reversal eg. if input is "abcd" then output should be: dcba why do we use enum when constants are there? Questions about the SpringBoot? Spring, SpringBoot, Hibernate, JDBC annotations Where do be mention the hibernate db connection details. Question on mvc architecture get, put, post methods Question on microservices Question on webservices Question on git commands Question on git: how to push the changes to upper stages like uat, and prod switch case vs if else which to use collection vs map list vs all types of maps hibernate questions hql what is dialect in hibernate junit annotations java 11 features java 8 features rest, oops concepts

Viewing 3221 - 3230 interview questions

Glassdoor has 4,195 interview questions and reports from Java software engineer interviews. Prepare for your interview. Get hired. Love your job.