Java Interview Questions asked in Citibank

  1. Explain Autoboxing in Java?
  2. What are different types of database indexes?
  3. What is difference overloading and overriding?
  4. Which attribute specifies a JSP page that should process any exceptions thrown but not caught in the current page?
  5. Which services are provided to EJB components by the EJB container?
  6. Which HttpSession object is used to view and manipulate information about a session?
  7. How do you design microservices?
  8. Can the double-checked locking fail on a single processor system?
  9. What is a ConcurrentHashMap?
  10. Design an LRU cache in Java.
  11. What is an externalizable interface?
  12. What is the difference between Future and Callable interface in Java?
  13. Explain the difference between HashSet and Hashmap?
  14. What is thread safety? How do you achieve it?
Java Interview Questions asked in Citibank
Download Java Interview Questions asked in Citibank PDF

Autoboxing is the automatic conversion that the Java compiler makes between the primitive types and their corresponding object wrapper classes. For example, converting an int to an Integer, a double to a Double, and so on. If the conversion goes the other way, this is called unboxing.

Here is the simplest example of autoboxing:

Character ch = 'a';

There are mainly three types of database indexes, they are:

  • Clustered Indexing
  • Non-Clustered or Secondary Indexing
  • Multilevel Indexing

Differences between overloading and overriding

OverloadingOverriding
Overloading is performed at compilation time.Overriding is performed at runtime
Overloading is also called static binding.Overriding is also called dynamic binding.
Overloading is done within the class.Overriding occurs in between two classes that have an IS-A (inheritance) relationship.
It is an example of compile-time polymorphism.It is an example of run time polymorphism.

Overloading Example:

class ExampleClass{  
static int sum(int a,int b){return a+b;}  
static int sum(int a,int b,int c){return a+b+c;}  
}  

Overriding Example:

class Animal{  
	void eat(){System.out.println("eating...");}  
}  
class Dog extends Animal{  
	  void eat(){System.out.println("eating bread...");}  
}