deloitte java developer interview questions

Top Deloitte Java Developer Interview Questions [2025 Updated]

Are you preparing for an interview with Deloitte as a Java Developer? Whether you’re aiming for a Java Full Stack Developer, a Senior Consultant Java role or preparing for 3 years experienced level, this is my real experince insight into the most frequently asked Deloitte Java Developer Interview Questions with experience-based answers.

These Deloitte interview questions for Java developer roles are categorized to help you prepare efficiently.

deloitte java developer interview questions
Deloitte Java Developer Interview Questions

🔹 Core Java Interview Questions

1. What is the difference between == and .equals() in Java?

Answer: This is a classic question. == checks if two object references point to the same memory location. On the other hand, .equals() checks if two objects have the same content or value. For example:

String a = new String("Hello");
String b = new String("Hello");
System.out.println(a == b); // false
System.out.println(a.equals(b)); // true

Interviewers expect you to explain with a practical example, not just the theory.

2. Can you explain how HashMap works internally?

Answer: HashMap uses a hashing technique. It stores data in buckets, and each key’s hashCode() determines the bucket. If two keys have the same hash, a collision happens, and they are stored using a LinkedList or Tree (in Java 8+). During retrieval, the hash and equals() method are both used to locate the correct key-value pair.

🔹 Multi-threading and Concurrency

3. What are the ways to create threads in Java?

Answer: Two main ways:

  1. Implement Runnable interface
  2. Extend Thread class

Runnable is preferred as it promotes loose coupling and allows inheritance from other classes.

4. What is a daemon thread?

Answer: A daemon thread is a background thread that dies when all user threads finish. Example: garbage collection. It’s used for low-priority tasks. You can set it using thread.setDaemon(true).

🔹 Exception Handling

5. Exception hierarchy in Java?

Answer: Exception Hierarchy in Java, commonly asked in interviews like Deloitte Java Developer, Java Full Stack, and Senior Consultant Java roles:

java.lang.Object  
  └── java.lang.Throwable  
       ├── java.lang.Error (Unchecked, usually system-level)  
       │    ├── OutOfMemoryError  
       │    └── StackOverflowError  
       └── java.lang.Exception (Checked)  
            ├── java.lang.RuntimeException (Unchecked)  
            │    ├── NullPointerException  
            │    ├── IndexOutOfBoundsException  
            │    ├── IllegalArgumentException  
            │    └── ArithmeticException  
            └── IOException, SQLException, ParseException (Checked)

5. Difference between throw and throws?

Answer: throw is used to explicitly throw an exception, while throws is used in method signatures to declare exceptions that might be thrown.

void myMethod() throws IOException {
    throw new IOException("File not found");
}

This is a commonly asked question in Deloitte Java Full Stack Developer Interview Questions.

🔹 Coding / DSA Round Questions

6. Detect a cycle in a linked list.

Answer:

public boolean hasCycle(ListNode head) {
    ListNode slow = head;
    ListNode fast = head;
    while (fast != null && fast.next != null) {
        slow = slow.next;
        fast = fast.next.next;
        if (slow == fast) return true;
    }
    return false;
}

Explain how Floyd’s Cycle Detection Algorithm works.

7. Reverse a string without using built-in reverse methods.

Answer:

public String reverseString(String input) {
    StringBuilder sb = new StringBuilder();
    for (int i = input.length() - 1; i >= 0; i--) {
        sb.append(input.charAt(i));
    }
    return sb.toString();
}

🔹 Spring Boot & Java Frameworks

8. What is the difference between @Component, @Service, and @Repository?

Answer:
All three are stereotype annotations used to declare beans.

  • @Component: Generic bean
  • @Service: Business logic
  • @Repository: DAO layer, with exception translation feature

9. What is Dependency Injection in Spring?

Answer: Dependency Injection (DI) allows Spring to inject dependencies automatically instead of creating objects manually using new. Helps with loose coupling and testing.

Example:

@Service
public class UserService {
    private final UserRepository repo;

    @Autowired
    public UserService(UserRepository repo) {
        this.repo = repo;
    }
}

🔹 SQL and Database

10. Write a SQL query to fetch the second highest salary.

Answer:

SELECT MAX(salary) FROM employee
WHERE salary < (SELECT MAX(salary) FROM employee);

This is a favorite in Deloitte Java Interview Questions for 3 Years Experienced roles.

11. How would you optimize a slow SQL query?

Answer: Suggestions include:

  • Use EXPLAIN to check execution plan
  • Add indexes
  • Avoid SELECT *
  • Use joins smartly, and avoid subqueries where possible

🔹 Managerial + Senior Consultant Java Questions

12. How do you handle production issues under pressure?

Answer: I usually follow a structured approach: check logs, replicate issue in staging, isolate the module, apply hotfix if necessary, and then analyze the root cause for a long-term fix. Communicating early with stakeholders is also key.

13. How do you ensure code quality in a large team?

Answer: I encourage:

  • Writing unit & integration tests
  • Following code reviews
  • Using tools like SonarQube
  • Following SOLID principles and clean code practices

This is a common in Deloitte Senior Consultant Java Interview Questions.

📌 Final Tips for Deloitte Java Developer Interview

  • Be clear with Java fundamentals
  • Brush up on your basic Spring Boot and REST concepts
  • Practice Stream API, Array, String coding and SQL regularly
  • Prepare for scenario-based and behavioural questions

FAQs

Q1: How many rounds are there in Deloitte Java Developer Interview?

Usually 2-3: Online Test, 1–2 Technical Rounds, followed by Managerial/HR.

Q2: Do Deloitte interviews focus on projects?

Yes. Expect questions like: “Which module did you own?”, “How did you solve performance issues?”

Q3: Is SQL mandatory?

Absolutely. CRUD queries, joins, group by, and optimization are regularly asked.

🔗 Useful Resources

Covers frequently asked Java questions with code examples and explanations:
.

🔗 GeeksforGeeks – Java Interview Questions

Similar Posts

One Comment

Leave a Reply

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