Citibank Java developer interview questions

Upasana | November 20, 2020 | 2 min read | 10,921 views | algorithm-datastructures investment banking

Citibank Java programming interview questions on core java, multi-threading, executor framework, atomic package, design problems, database queries, db indexes and puzzles.
citibank cord cloud
Citibank interview topics

Core Java Questions

  1. Discuss method overriding in Java?

  2. Discuss internals of a HashMap? What is Role of equals() and hashcode() method in Object class? What will be behavior if we override hashcode() method to always return 1?

  3. What is difference between Future and Callable interface in Java?

  4. When should we use StringBuilder class in a program?

    Unlike String, StringBuilder is mutable and does not create too many intermittent string objects while manipulating textual data. So if your program mutates string too often by use of append/prepend function, its better to use StringBuilder than String.

  5. What is Executor Framework. How is it different from Fork Join Framework?

  6. What is a Immutable Class? How does it help in writing scalable applications?

  7. What is thread safety? How do you achieve it?

  8. How will you handle ConcurrentModificationException?

  9. What is difference between poll() and remove() method of an Queue?

    poll() method retrieves and remove the head of the queue. If the queue is empty then it just returns the null. remove() method also retrieves and removes the head of the queue. The only difference is that remove() method will throw an exception if the queue is empty.

  10. What is difference between fail-fast and fail-safe iterators?

  11. What makes Concurrent Collections different from Synchronized Collections?

  12. What is difference between Vector and ArrayList?

  13. What is difference between HashSet and HashMap?

  14. What is CopyOnWriteArrayList, how it is different than ArrayList and Vector?

  15. When to use serialization vs externalizable interface?

  16. What new features of Java 9, 10, 11 have you used recently?

    Hint: Java 9 non-blocking HttpClient, Local variable type inference (a.k.a var), Stream improvements (takeWhile, dropWhile, ofNullable), introduction of SHA-3 Hash Algorithms, Docker container awareness, etc.

Coding & Design Problems

  1. How do you pass a job from Thread 1 to Thread 2 to Thread 3?

    Hint: Some kind of blocking queue is be used to safely pass data from one thread to another. It is a typical Producer Consumer problem, more details you can find it here.

  2. How will you implement a Queue in Java?

  3. Discuss Singleton and Decorator Design Pattern. Discuss the practical usage of these design patterns. How to make singleton class thread safe?

  4. How will you implement pagination in a web application? What is difference between Factory and Abstract Factory Design Pattern?

  5. You have array of n size having numbers between 1 to 100. you need to provide algorithm for sorting array with BigO(n) iteration.

    Counting sort can achieve sorting for numbers (with limited range) in Big O(n) time complexity.

  6. How will you implement your own Binary Tree in Java?

  7. There is a very big text file containing words? How would you read & process it to print the below output.

    • Print the top ten ranked distinct words.

    • Print the occurrence of each alphabet in this file consider that the file can not fit into main memory of computer.

    • Solution discussed here

  8. How will you design your custom Connection Pool in Java?

  9. A service method calls multiple other microservices using REST in order to fulfill the response. Write code to invoke these external services in parallel and return the response once all calls are done.

Database Questions

Buy my ebook for complete question bank

Most of these questions has been answered in my eBook "Cracking the Core Java Interview" updated on June 2018, that you can buy from this link:

Buy from Shunya (DRM Free PDF download with updates)

investment banking:
  1. Finastra Investment Banking Interview Questions
  2. Markit Java Interview Questions
  3. Goldman Sachs Java Interview Questions
  4. Java topics covered in Investment Banking Interviews (Morgan Stanley, Barclays, RBS, UBS, BlackRock)
  5. Morgan Stanley Java Interview Questions
  6. UBS Java Interview Questions
  7. ION Trading Java Interview Questions
See all articles in investment banking
Top articles in this category:
  1. Multi-threading Java Interview Questions for Investment Bank
  2. Cracking core java interviews - question bank
  3. Sapient Global Market Java Interview Questions and Coding Exercise
  4. UBS Java Interview Questions
  5. Morgan Stanley Java Interview Questions
  6. Goldman Sachs Java Interview Questions
  7. ION Trading Java Interview Questions

Recommended books for interview preparation:

Find more on this topic:
Buy interview books

Java & Microservices interview refresher for experienced developers.