Posted in

ICICI Bank Java Developer interview questions For 3 Years of Experience

ICICI Bank Java Developer interview questions

Interview Experience · Java Developer

Table of Contents

ICICI Bank Client Round – Java Developer Interview Questions and Answers

A practical account of a Level 2 client interview for the Mumbai location, covering Core Java, Spring Boot, Kafka, JWT, microservices, collections, and coding.

⏱️ 45–50 minutes
📍 Mumbai
💼 Level 2 client round

After completing the EY Round 1 interview, I received an email about the next stage within three days. It was a Level 2 client interview with ICICI Bank for a Java Developer role in Mumbai. The discussion lasted approximately 45–50 minutes and focused on whether I could explain concepts clearly and connect them to real project situations.

Quick interview tip: Do not stop at definitions. Give a short definition, explain how the feature works, and finish with one practical example from an application.

1. Core Java and OOP

What is object-oriented programming?

Object-oriented programming, or OOP, organizes software around objects that contain both data and behavior. For example, a BankAccount object can hold an account number and balance while providing methods such as deposit() and withdraw(). This makes code easier to model, reuse, test, and maintain.

Explain the four pillars of OOP.

  • Encapsulation: Keep data and related methods together and restrict direct access. A private balance updated through controlled methods is a common example.
  • Abstraction: Expose essential behavior while hiding implementation details. A payment interface can offer pay() without showing gateway internals.
  • Inheritance: Create a class from an existing class to reuse or extend behavior. SavingsAccount may extend Account.
  • Polymorphism: Use one interface or parent type with multiple implementations. A PaymentService reference may point to UPI, card, or net-banking implementations.

What is polymorphism, and what are its types in Java?

Polymorphism means “many forms.” The same method name or contract can behave differently depending on its arguments or the actual object.

  • Compile-time polymorphism: Method overloading. The compiler selects a method based on the parameter list.
  • Runtime polymorphism: Method overriding. The JVM selects the implementation based on the actual object at runtime.
interface Payment {
    void pay(double amount);
}

class UpiPayment implements Payment {
    @Override
    public void pay(double amount) {
        System.out.println("Paid ₹" + amount + " through UPI");
    }
}

Payment payment = new UpiPayment();
payment.pay(1500); // Runtime polymorphism

2. JVM Memory and Strings

What is the difference between stack and heap memory?

Stack Heap
Stores method frames, local primitive values, and object references. Stores objects and arrays.
Each thread has its own stack. Shared by threads in the JVM.
Memory is released when a method returns. Unused objects are reclaimed by garbage collection.
Usually faster and smaller. Larger, with dynamic allocation.

Where are String objects stored?

String objects are objects, so they live on the heap. String literals are placed in the String Constant Pool, which is also part of heap memory in modern JVMs. A string created with new String("ICICI") creates a separate heap object, while the literal may also exist in the pool.

What is the String Constant Pool?

It is a special pool used to reuse identical string values. If two variables use the same literal, they normally refer to the same pooled object. This saves memory and makes literal reuse efficient.

String a = "bank";
String b = "bank";
String c = new String("bank");

System.out.println(a == b);      // true: same pooled object
System.out.println(a == c);      // false: different object
System.out.println(a.equals(c)); // true: same content

Why are Strings immutable?

Once created, a String value cannot change. Immutability improves security for values such as class names, file paths, and connection details; makes strings naturally thread-safe; allows stable hash codes when strings are map keys; and enables safe reuse through the String Constant Pool.

String vs StringBuilder vs StringBuffer

  • String: Immutable. Best when the text changes rarely.
  • StringBuilder: Mutable and not synchronized. Usually the best choice for repeated modifications inside one thread.
  • StringBuffer: Mutable and synchronized. Thread-safe, but generally slower than StringBuilder.

3. Spring and Spring Data JPA

What is the difference between @Qualifier and @Primary?

When multiple beans implement the same interface, Spring needs help selecting one. @Primary marks the default bean. @Qualifier explicitly selects a particular bean at the injection point and takes precedence over the primary choice.

Real-life example: A banking application supports email and SMS notifications. Email can be the default, while an OTP service explicitly requests SMS.

@Service
@Primary
class EmailNotificationService implements NotificationService { }

@Service("smsNotificationService")
class SmsNotificationService implements NotificationService { }

@Service
class OtpService {
    OtpService(@Qualifier("smsNotificationService")
               NotificationService notificationService) {
        // SMS is selected even though email is @Primary
    }
}

What is Spring Data JPA?

Spring Data JPA simplifies database access on top of JPA. We define repository interfaces, and Spring generates common CRUD implementations. It also supports derived query methods, pagination, sorting, specifications, and custom JPQL or native queries.

JpaRepository vs CrudRepository

CrudRepository provides basic create, read, update, and delete operations. JpaRepository builds on the repository hierarchy and adds JPA-oriented conveniences such as flushing and batch operations; it also provides list-returning variants through the modern Spring Data hierarchy. Use JpaRepository for most JPA applications unless only a minimal repository contract is desired.

4. Asynchronous Processing and Multithreading

What is asynchronous processing?

Asynchronous processing allows the caller to continue without waiting for a long-running task to finish. For example, an API may accept a transaction request immediately while a separate task generates and emails the receipt.

How is asynchronous processing achieved in Spring Boot?

Enable it with @EnableAsync, mark a Spring-managed public method with @Async, and preferably configure a dedicated TaskExecutor. The method may return void or CompletableFuture<T>.

Spring normally applies @Async through a proxy. Calls coming through that proxy are submitted to an executor. A direct call from one method to another method in the same object usually bypasses the proxy, so the work will not become asynchronous.

@Configuration
@EnableAsync
class AsyncConfig { }

@Service
class StatementService {
    @Async
    public CompletableFuture<String> generateStatement() {
        return CompletableFuture.completedFuture("Statement ready");
    }
}

What is multithreading?

Multithreading is the execution of multiple threads within one process. Threads share heap memory but have separate stacks. It can improve responsiveness and throughput for independent tasks, but shared mutable data requires careful synchronization.

What are the ways to create threads in Java?

You can extend Thread, implement Runnable, implement Callable and submit it to an executor, or submit lambdas/tasks to an ExecutorService. In production, executors are normally preferred because thread creation and reuse are managed centrally.

What are ExecutorService and a thread pool?

ExecutorService is an API for submitting tasks, controlling execution, obtaining results, and shutting down an executor. A thread pool maintains reusable worker threads. Reuse avoids the overhead and instability of creating an unlimited new thread for every request.

Runnable vs Callable

  • Runnable: Its run() method returns no value and cannot declare checked exceptions.
  • Callable: Its call() method returns a value and may throw checked exceptions.

Future vs CompletableFuture

A Future represents a pending result, but get() normally blocks and composition is limited. CompletableFuture supports callbacks, chaining, combining independent operations, exception handling, and non-blocking pipelines such as thenApply(), thenCompose(), and allOf().

5. Apache Kafka

What is Apache Kafka?

Apache Kafka is a distributed event-streaming platform used for high-throughput, durable, and scalable messaging. Producers publish records to topics, and consumers read them independently. Banking uses might include transaction events, fraud checks, audit streams, and notifications.

How does Kafka work internally?

  1. A producer sends a record to a topic.
  2. The topic is divided into partitions, which enable parallelism and preserve order within each partition.
  3. A partition is stored on a broker and replicated to other brokers for fault tolerance. One replica acts as leader.
  4. Records are appended to an immutable log and identified by an offset.
  5. Consumers in a consumer group divide partitions among themselves. Within one group, a partition is assigned to only one consumer at a time.
  6. Consumers track or commit offsets, allowing them to resume or replay records.

If all events for one account must remain ordered, use the account ID as the record key. Kafka will consistently route the same key to the same partition, subject to partitioning rules and partition-count changes.

6. Exception Handling

What is exception handling?

Exception handling lets an application detect abnormal conditions and respond without terminating unpredictably. Java uses try, catch, finally, throw, and throws.

What are the types of exceptions?

Checked exceptions are verified at compile time and must be caught or declared, such as IOException. Unchecked exceptions extend RuntimeException and commonly indicate programming or validation problems, such as NullPointerException or IllegalArgumentException. Errors, such as OutOfMemoryError, represent serious JVM or system problems and are generally not handled as normal business failures.

How do you create a custom exception?

public class InsufficientBalanceException extends RuntimeException {
    public InsufficientBalanceException(String message) {
        super(message);
    }
}

Which annotations handle exceptions in Spring Boot?

Use @ExceptionHandler for selected exceptions in a controller or advice class, @ControllerAdvice for centralized MVC handling, and @RestControllerAdvice when handlers should write response bodies by default. @ResponseStatus can associate an exception or handler with an HTTP status.

7. API Security and JWT

How do you secure a REST API?

Use HTTPS; authenticate callers; authorize each operation with least privilege; validate input; hash passwords with a strong adaptive algorithm; use short-lived tokens; protect secrets; configure CORS deliberately; apply rate limits where needed; avoid sensitive data in logs; return safe error messages; and maintain audit trails. Security should be layered instead of depending on a token alone.

What is Spring Security?

Spring Security is the standard Spring framework for authentication, authorization, and protection against common attacks. In a REST API, a SecurityFilterChain defines public and protected routes, session policy, authentication filters, access rules, and exception responses.

What is JWT?

A JSON Web Token is a compact token containing a header, payload, and cryptographic signature. The payload carries claims such as subject, roles, issuer, and expiry. A signed JWT provides integrity, not secrecy—the payload can be decoded—so sensitive information should not be placed in it.

How do you validate a JWT?

  1. Read it from the Authorization: Bearer header.
  2. Allow only the expected signing algorithm and verify the signature using the trusted secret or public key.
  3. Validate expiry and, where applicable, not-before time.
  4. Validate issuer and audience.
  5. Extract the subject and authorities, then create the authenticated security context.
  6. Reject malformed, expired, revoked, or otherwise untrusted tokens.

8. Microservices and the Saga Pattern

What is the Saga pattern, and why is it used?

A Saga manages a business transaction that spans multiple microservices. Instead of one distributed database transaction, it uses a sequence of local transactions. If a later step fails, compensating actions undo the earlier business effects. It is used because each microservice usually owns its database and traditional ACID transactions do not naturally span those boundaries.

For example, a transfer saga may debit Account A, credit Account B, and send a confirmation. If the credit step fails, a compensating transaction restores the debit. Compensation is a business action, not a database rollback.

What are the two types of Saga?

  • Choreography: Services publish and react to events without a central controller. It works well for simpler flows but can become difficult to trace as participants grow.
  • Orchestration: A central orchestrator instructs participants and tracks progress. It provides clearer control for complex workflows but adds an orchestration component.

Real implementations should also consider idempotency, retries, timeouts, durable state, duplicate events, and observability.

9. Java Collections

What is the Java Collections Framework?

It is a set of interfaces, implementations, and algorithms for storing and processing groups of objects. Core interfaces include List, Set, Queue, and Map, with implementations such as ArrayList, HashSet, and HashMap.

Collection vs Collections

Collection is the root interface for groups such as lists, sets, and queues. Collections is a utility class with static methods such as sort(), reverse(), and unmodifiableList(). Map belongs to the framework but does not extend Collection.

What is the default initial capacity of HashMap?

The commonly stated default initial capacity is 16, with a default load factor of 0.75. A useful nuance is that modern implementations allocate the backing table lazily, typically on the first insertion. When the number of entries crosses the threshold, the table is resized.

How does HashSet work internally?

HashSet is backed by a HashMap. Each set element is stored as a map key with the same dummy value. The element’s hashCode() helps select a bucket, and equals() confirms whether an equal element already exists. Therefore, correct and consistent implementations of both methods are essential. HashSet permits one null element and does not guarantee iteration order.

10. Coding Question: Find the Missing Number

Question: Given an array containing distinct numbers from a known consecutive range with one number missing, find the missing number.

If the range is 1 to n, the expected sum is n × (n + 1) / 2. Subtract the array’s actual sum to obtain the missing number.

public class MissingNumber {

    public static int findMissing(int[] numbers, int n) {
        long expectedSum = (long) n * (n + 1) / 2;
        long actualSum = 0;

        for (int number : numbers) {
            actualSum += number;
        }

        return (int) (expectedSum - actualSum);
    }

    public static void main(String[] args) {
        int[] numbers = {1, 2, 3, 5, 6};
        System.out.println(findMissing(numbers, 6)); // 4
    }
}

Complexity: O(n) time and O(1) extra space. The formula uses long during calculation to reduce the risk of integer overflow.

XOR alternative

XOR avoids sum overflow. XOR all values from 1 to n and all values in the array. Equal values cancel, leaving the missing value.

public static int findMissingWithXor(int[] numbers, int n) {
    int result = 0;

    for (int value = 1; value <= n; value++) {
        result ^= value;
    }

    for (int number : numbers) {
        result ^= number;
    }

    return result;
}

This solution also takes O(n) time and O(1) extra space. Both approaches assume the input contains distinct values from the stated range and exactly one value is missing.

How to prepare for a similar client round

  • Prepare a 60-second explanation and one project example for every major concept.
  • Understand internals, especially HashMap/HashSet, the JVM, Spring proxies, Kafka partitions, and JWT validation.
  • Explain trade-offs rather than calling one technology universally “better.”
  • Practice writing small Java programs without an IDE.
  • For banking systems, mention security, idempotency, auditability, failure handling, and data consistency where relevant.

Frequently Asked Questions

How long was the ICICI Bank Java Developer client interview?

The Level 2 client interview lasted approximately 45–50 minutes.

Was the interview focused only on Core Java?

No. It covered Core Java and OOP, JVM memory, strings, Spring, Spring Data JPA, asynchronous processing, multithreading, Kafka, exception handling, API security, JWT, Saga, collections, and a coding problem.

What coding difficulty should candidates expect?

The shared question was a straightforward array problem: find one missing number in a consecutive range. Candidates should still explain assumptions, complexity, overflow, and alternative approaches.

What is the best way to answer conceptual questions?

Use a three-part structure: give a precise definition, explain the internal behavior or trade-off, and connect it to a practical project example.

Which topics deserve the most revision?

Pay special attention to Java fundamentals, concurrency, Spring dependency injection and proxies, repository interfaces, Kafka partitions and consumer groups, JWT validation, distributed consistency, and collection internals.

Conclusion

The ICICI Bank client round tested both fundamentals and real-world backend judgment. The questions were not limited to definitions; they touched on how Java and Spring applications behave under concurrency, communicate through Kafka, secure APIs with JWT, and maintain consistency across microservices. If you can explain each topic in simple language, add a practical example, and discuss one important trade-off, you will be well prepared for a similar Java Developer interview.

📄

Want to Read It Offline?

Download the complete ICICI Bank Java Developer interview guide as a PDF and revise the questions whenever it is convenient.

⬇ Download Interview Guide PDF

Free PDF · Easy to save and share

Note: Interview questions and selection processes can vary by project, panel, role, and experience level. This article reflects one candidate’s shared experience.

I am a Software Engineer with a strong interest in writing technology-related articles, managing two websites. I am dedicated to learning new technologies and producing engaging content. Additionally, I possess expertise in digital marketing and SEO strategies.

Leave a Reply

Your email address will not be published. Required fields are marked *