Mintoak Innovations
IDFC FIRST Bank Interview Questions and Answers
Q1. How to sort a class object having roll no names add to roll no
You can sort a class object by implementing the Comparable interface and overriding the compareTo method.
Implement the Comparable interface in the class and override the compareTo method to compare objects based on roll number.
Use Collections.sort() method to sort the list of objects based on roll number.
Example: class Student implements Comparable<Student> { public int compareTo(Student s) { return this.rollNo - s.rollNo; }}
Q2. Spring Boot Annotations, how they work with each other
Spring Boot annotations are used to simplify the development process by providing metadata to the Spring framework.
Annotations like @RestController, @RequestMapping, and @Autowired are commonly used in Spring Boot to define controllers, request mappings, and dependency injection.
Annotations like @SpringBootApplication are used to bootstrap the Spring application context.
Annotations like @ComponentScan and @EnableAutoConfiguration help Spring Boot to automatically configure co...read more
Q3. Differences in diff SQL DBs - postgresql vs oracle sql
PostgreSQL and Oracle SQL differ in terms of licensing, features, performance, and cost.
PostgreSQL is open-source while Oracle SQL is proprietary.
PostgreSQL is known for its extensibility and support for advanced features like JSON data types, while Oracle SQL is known for its robustness and scalability.
PostgreSQL is generally considered more cost-effective for small to medium-sized projects, while Oracle SQL is preferred for large enterprise applications.
PostgreSQL has a str...read more
Q4. What is hashmap in java
HashMap in Java is a data structure that stores key-value pairs and allows fast retrieval of values based on keys.
HashMap is part of the Java Collections framework.
It uses hashing to store key-value pairs, allowing for fast retrieval.
Keys in a HashMap must be unique, but values can be duplicated.
Example: HashMap<String, Integer> map = new HashMap<>(); map.put("John", 25);
Q5. What is constructor
A constructor in Java is a special type of method that is used to initialize objects. It has the same name as the class and no return type.
Constructors are called when an object of a class is created.
They can be used to initialize instance variables or perform any other setup required for the object.
Constructors can be overloaded, meaning a class can have multiple constructors with different parameters.
If a class does not have any constructors defined, Java provides a default...read more
Q6. What is comparator
A Comparator in Java is an interface used to compare objects for sorting purposes.
Comparator interface is used to define custom comparison logic for objects.
It has a method called compare() which takes two objects as arguments and returns an integer value based on their comparison.
It is commonly used with sorting algorithms like Collections.sort() or Arrays.sort().
Q7. Functional Interfaces in Java
Functional interfaces in Java are interfaces with a single abstract method, used for lambda expressions and method references.
Functional interfaces have only one abstract method, but can have multiple default or static methods.
Examples include java.lang.Runnable, java.util.Comparator, and java.util.function.Predicate.
Functional interfaces can be used with lambda expressions and method references for concise code.
Q8. Streams in Java
Streams in Java are sequences of elements that support functional-style operations.
Streams are used to process collections of objects in a functional way.
They allow for concise and readable code by enabling operations like filter, map, reduce, etc.
Example: List
names = Arrays.asList("Alice", "Bob", "Charlie"); Stream stream = names.stream();
Top Java Developer Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month