Sitemap
Avinash Pratap Singh

Avinash Pratap Singh

Product Manager who loves creating roadmaps and solving the world's problems :) My hobbies are hitting the gym, badminton and running. Solves Java codes.

DBS JAVA Interview Questions

3 min readNov 14, 2024

In this blog, I’ll be sharing some Java and Spring-related questions that came up during a DBS technical interview. The interview focused on evaluating whether the candidate had hands-on experience and practical knowledge in these areas.

Press enter or click to view image in full size
  1. What are the different class under Stream API , name some of them and explain their usage with examples?
  2. Write a program, given a String “Welcome” to produce a output containing all the odd characters using Streams concept.
    output: Wloe
  3. If suppose there are two classes, class A and class B, each class have three methods that throws exception. How are you going to handle it globally? Write the code to explain. refer

The next questions were based on the code written for above scenario,

4. Explain the difference between ControllerAdvice, RestControllerAdvice and ExceptionHandler annotations.

5. How Spring decides whether the exception should be handled Globally by Global Exception handler class?

6. I want to get Employee details, where employeeId is sent as Path Parameter. Write the entire code starting from Controller to Service layer for above scenario.
Note: Department is a different service which needs to be called from EmployeeService and you need to pass employeeId to fetch the details.
Interviewer mainly focused on Annotations used and service calls.

7. What are the different ways you can call one service from another in a REST application?

8. Which Caching mechanism are you using in your current project, explain.

9. What all Spring modules have you used in your project, explain Spring AOP.

Get Avinash Pratap Singh’s stories in your inbox

Join Medium for free to get updates from this writer.

This section contains the technical questions asked in interview second round .

  1. Explain the design creation process(low level design)
  2. What is Spring Batch? Which annotation will you use in your configuration class to enable this feature.
  3. What is VIEW and how it differs from TABLE in SQL? Which all DDL and DML operations cannot be performed in VIEW?
  4. Which database have you used in your previous project, write an SQL query to UPDATE column DEPARTMENT_NAME and POST_HOLD of the 1000th Employee?
  5. Have you used any messaging queue in your project? How will you implement KAFKA in your application?
    a) If suppose the producer is producing the events and consumer is unable to consume it, what will happen to the events
    b) How will you ensure that the events are consumed only once.
  6. How will you secure your SpringBoot application?(Basically focused on JWT authentication and authorisation mechanism)
  7. What all different design patterns have you used in Microservices? Have you heard of SAGA? Could you please elaborate on this?
  8. Why do we prefer using APIGateway in Microservices?
  9. What is Executor framework? How using Executor service we can determine that all threads have completed their execution?
  10. What is Optional classes and why were these classes introduced even when we can handle null check? write a code to explain it.
  11. Write a java 8 program to sort HashMap based on values?

I hope this will help someone who is preparing for JAVA Interview.

--

--

Avinash Pratap Singh
Avinash Pratap Singh

Written by Avinash Pratap Singh

Product Manager who loves creating roadmaps and solving the world's problems :) My hobbies are hitting the gym, badminton and running. Solves Java codes.