Infosys
10+ Indiglobe IT Solutions Interview Questions and Answers
Q1. Write a functional interface. Refer it to a Lamda Expression. Show it practically while explaining each step
A functional interface is a single abstract method interface. It can be referred to using a lambda expression.
Functional interfaces have only one abstract method
Lambda expressions can be used to implement functional interfaces
Lambda expressions provide a concise way to write anonymous functions
Functional interfaces can be used as method parameters or return types
Q2. What is HashMap? While Interating through it is it mutable?
HashMap is a data structure in Java that stores key-value pairs. It is mutable while iterating through it.
HashMap is part of the Java Collections Framework.
It allows null values and at most one null key.
It provides constant-time performance for basic operations like get and put.
While iterating through a HashMap, it is mutable and can throw ConcurrentModificationException if modified.
To avoid this, use an Iterator or ConcurrentHashMap.
Q3. What are the various annotations used in SpringBoot (explain)
Various annotations used in SpringBoot
1. @SpringBootApplication: Marks the main class of a Spring Boot application
2. @RestController: Marks a class as a RESTful controller
3. @RequestMapping: Maps HTTP requests to handler methods
4. @Autowired: Injects dependencies automatically
5. @Component: Marks a class as a Spring component
6. @Service: Marks a class as a service component
7. @Repository: Marks a class as a repository component
8. @Configuration: Marks a class as a source of b...read more
Q4. Find the duplicate element in a given array using Java 8 features.
Find duplicate element in array using Java 8 features.
Convert array to stream using Arrays.stream()
Use Collectors.groupingBy() to group elements by their occurrence
Filter the grouped elements to find duplicates
Q5. What are the different bean scopes in Spring
The different bean scopes in Spring are singleton, prototype, request, session, and application.
Singleton scope creates a single instance of a bean per Spring IoC container.
Prototype scope creates a new instance of a bean every time it is requested.
Request scope creates a new instance of a bean for each HTTP request.
Session scope creates a new instance of a bean for each HTTP session.
Application scope creates a single instance of a bean per ServletContext.
Q6. Coding: Sort list of student details using mark.
Sort list of student details by mark.
Create a custom class Student with attributes like name, mark.
Implement Comparator interface to sort by mark.
Use Collections.sort() method to sort the list of students.
Q7. What is transient keyword in Java?
The transient keyword in Java is used to indicate that a variable should not be serialized.
Variables marked as transient are not included in the serialization process
Transient variables are not saved when an object is serialized and are set to their default values when the object is deserialized
Useful for excluding sensitive or unnecessary data from being serialized
Q8. Is Java pass by value or by reference
Java is pass by value
Java is pass by value, meaning a copy of the variable is passed to a method
Changes made to the copy inside the method do not affect the original variable
However, if the variable is an object reference, the reference is passed by value
Q9. What is Method Overloading vs Overriding
Method Overloading is having multiple methods with the same name but different parameters. Method Overriding is having a method in a subclass with the same name and parameters as in the superclass.
Method Overloading is used to provide different ways of calling the same method with different parameters.
Method Overriding is used to provide a specific implementation of a method that is already provided by its superclass.
Method Overloading is resolved at compile-time based on the...read more
Q10. Difference btw string builder, and buffer
String Builder is not synchronized, while String Buffer is synchronized.
String Builder is faster than String Buffer because it is not synchronized.
String Buffer is thread-safe, while String Builder is not.
Use String Builder when you do not need thread safety, and String Buffer when you do.
Q11. What are the features of Java8
Java 8 introduced several new features including lambda expressions, functional interfaces, streams, and default methods.
Lambda expressions allow writing concise and functional code.
Functional interfaces provide a way to define and use lambda expressions.
Streams enable processing collections of data in a functional and parallel way.
Default methods allow adding new methods to existing interfaces without breaking compatibility.
Other features include the new Date and Time API, i...read more
Q12. list out second largest salary using java 8
Using Java 8, find the second largest salary from a list of salaries.
Sort the list of salaries in descending order using streams and lambda expressions.
Skip the first element (largest salary) and find the first element (second largest salary).
Q13. Given is two arrays! Merge and sort them
Merge and sort two arrays
Use the merge sort algorithm to merge and sort the arrays
Convert the arrays to a list of strings before merging and sorting
Handle null or empty arrays as special cases
Q14. Find the third highest salary in sql
To find the third highest salary in SQL, you can use the 'ORDER BY' clause and 'LIMIT' keyword.
Write a SQL query to select distinct salaries from the table
Order the salaries in descending order using the 'ORDER BY' clause
Use the 'LIMIT' keyword to limit the result to the third row
Retrieve the third highest salary from the result
Q15. list all the sum of list
Calculate the sum of all elements in a list
Iterate through the list and add each element to a running total
Return the total sum at the end
Q16. What is streams API
Streams API is a feature in Java that allows for processing sequences of elements efficiently.
Streams API provides a way to perform operations on collections of objects in a functional style.
It supports operations like filter, map, reduce, and collect.
Streams can be sequential or parallel, allowing for efficient processing of large datasets.
Example: List<String> names = Arrays.asList("Alice", "Bob", "Charlie"); names.stream().filter(name -> name.startsWith("A")).forEach(Syste...read more
Q17. Why String immutable
String is immutable to ensure security, thread-safety, and caching benefits.
Immutable strings prevent malicious code from modifying the string content.
Immutable strings can be safely shared across multiple threads without synchronization issues.
Immutable strings can be cached for better performance.
Examples of immutable string methods include substring(), toUpperCase(), and trim().
Top HR Questions asked in Indiglobe IT Solutions
Interview Process at Indiglobe IT Solutions
Top Java Developer Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month