Java Spring Interview Questions

Java Spring Interview Questions

1. Have you used any Docker?

2. Suppose there is a requirement that for every call we need to create a new instance, how can that be done in Spring Boog

Answer - using Spring bean with Scope as Prototype and then every time you need a bean, get the SpringApplicationContext and call ctx.getBean()

3. When a REST API POST call is made, how is that converted to Java objects to work in your controller or service layer
Answer - Spring offers ViewResolvers, you can use JSONResolver to convert the JSON inputs to a Java Bean which then can be consumed by Controllers

4. How can you achieve Auto Scaling in kubernetes

5. Have you worked in Hibernate JPA or Spring JDBC in your projects?
Answer - both , while Hibernate JPA is good for queries, there are some queries where its not efficient enough and you need to have SQLs itself, like if you want to do a bulk update

6. Explain the process of having your Spring WAR deployed on Kubernetes Cluster?

7. Explain how JWT Auth works, how are the objects retrieved from db and passed around?

8. Is Number Prime

 public static boolean isPrime(int n){
         return n > 1 &&
             IntStream.range(2, n/2)
             .noneMatch(i -> i % 2  == 0);
     }

Comments

Popular posts from this blog

Apache Airflow Wait Between Tasks

Hibernate Interview Questions