Filter interviews by
Stream API in Java provides a functional approach to processing collections of objects.
Allows for concise and readable code by using functional programming concepts like map, filter, and reduce.
Enables parallel processing of data, improving performance for large datasets.
Supports lazy evaluation, allowing for efficient use of resources.
Example: List
Java code to filter even numbers from a list and store the square of those in another list
Create two ArrayLists to store the original list and the squared even numbers list
Iterate through the original list and check if each number is even
If the number is even, square it and add it to the squared even numbers list
Java code to check if two strings are anagrams
Create a function that takes in two strings as parameters
Convert both strings to char arrays and sort them
Compare the sorted char arrays to check if they are equal
Functional interfaces in Java are needed to enable the use of lambda expressions, which provide a concise way to implement single abstract method interfaces.
Functional interfaces have exactly one abstract method and can have multiple default or static methods.
They are used to enable the use of lambda expressions, which provide a concise way to implement the single abstract method.
Examples of functional interfaces in Ja...
Threads in Java can be created by extending the Thread class or implementing the Runnable interface.
Extend the Thread class and override the run() method
Implement the Runnable interface and implement the run() method
Use the Executor framework for managing threads
Top trending discussions
I was interviewed in Jan 2025.
A sequence was provided: 4181, 2684, 1597, 987, 610.
first 2 are given and write code for other value calculation using java 8
The second question required writing a reverse of a palindrome using both Java 8 streams. I was able to successfully write both and clear the first round.
I applied via Walk-in and was interviewed in Nov 2024. There was 1 interview round.
Use Streams to remove duplicates and retain only even numbers from an array.
Convert the array to a stream using Arrays.stream()
Use distinct() to remove duplicates
Filter out odd numbers using filter()
Collect the result using collect(Collectors.toList())
Static methods can be accessed without creating an instance of the class, while final keyword makes the method unchangeable.
Static methods belong to the class itself, not to any specific instance
Final keyword ensures that the method cannot be overridden in subclasses
Static methods are commonly used for utility methods that do not require access to instance variables
Example: Math class in Java has static methods like Ma
The @RestController annotation is used to define RESTful web services while @Controller annotation is used to define MVC controller.
RestController is a specialized version of Controller used for RESTful web services
RestController eliminates the need for @ResponseBody annotation
Controller is used for traditional MVC controller functionality
RestController returns data directly without needing to go through a view resolve...
Microservices are a software development technique where applications are composed of small, independent services that communicate with each other.
Microservices allow for easier scalability and maintenance of complex applications.
Each service in a microservices architecture can be developed, deployed, and scaled independently.
Microservices promote flexibility and agility in software development.
Examples of companies us...
I applied via Naukri.com and was interviewed in Dec 2024. There was 1 interview round.
I applied via Naukri.com and was interviewed in Nov 2024. There were 2 interview rounds.
Leading a team of developers in designing and implementing a new web application for a financial services company.
Managing a team of developers to ensure project milestones are met
Designing the architecture of the web application
Implementing new features and functionalities based on client requirements
Conducting code reviews and providing technical guidance to team members
posted on 10 Sep 2024
final is a keyword in Java used to declare constants, while finally is a block used in exception handling to ensure code is executed regardless of an exception.
final keyword is used to declare constants in Java
final variables cannot be reassigned once initialized
finally block is used in exception handling to ensure code is executed regardless of an exception
finally block is often used to release resources like closing
Developed a web application for a financial institution to manage customer accounts and transactions.
Used Java Spring framework for backend development
Implemented RESTful APIs for communication between frontend and backend
Utilized Hibernate for database interaction
Integrated third-party payment gateway for transactions
I applied via Company Website and was interviewed in Apr 2024. There was 1 interview round.
Garbage collection in Java is the process of automatically reclaiming memory by destroying unused objects.
Garbage collection is performed by the JVM to free up memory occupied by objects that are no longer needed.
It involves identifying and deleting objects that are no longer reachable by any part of the program.
Java provides automatic garbage collection, so developers do not have to manually manage memory allocation a...
The first statement creates a string literal in the string pool, while the second statement creates a new string object in the heap memory.
String s = "xyz" creates a string literal in the string pool.
String s = new String("xyz") creates a new string object in the heap memory.
Using String s = new String("xyz") can lead to unnecessary memory usage.
JVM is the virtual machine that runs Java programs, JRE is the runtime environment for Java programs, and JDK is the development kit for creating Java programs.
JVM (Java Virtual Machine) is the virtual machine that runs Java bytecode and converts it into machine code.
JRE (Java Runtime Environment) is the environment in which Java programs are executed. It includes JVM, libraries, and other necessary components.
JDK (Jav...
The public static void main method is the entry point of a Java program, where execution begins.
It must be declared as public so that it can be accessed from outside the class.
It must be declared as static so that it can be called without creating an instance of the class.
It must have a return type of void, indicating that it does not return any value.
It takes an array of strings (String[] args) as a parameter, which a...
final is a keyword used to declare constants, finally is a block used in exception handling, and finalize is a method used for cleanup.
final keyword is used to declare constants that cannot be changed
finally block is used in exception handling to ensure a piece of code is always executed
finalize method is used for cleanup operations before an object is garbage collected
HashSet is a collection class in Java that stores unique elements using a hash table.
Uses hashing to store elements
Does not maintain insertion order
Allows null values
Implements Set interface
ArrayList is a resizable array implementation in Java.
ArrayList is a class in Java that implements the List interface.
It allows dynamic resizing of the array, unlike regular arrays.
Elements can be added, removed, or accessed using index.
Example: ArrayList
I applied via Naukri.com and was interviewed in Mar 2024. There were 2 interview rounds.
I applied via Recruitment Consulltant and was interviewed in Jun 2024. There were 3 interview rounds.
Hacker rank test objective and coding
To remove autoconfiguration in Spring Boot, exclude the specific autoconfiguration class from the application.
Exclude the autoconfiguration class using @EnableAutoConfiguration annotation with exclude attribute
Create a configuration class and exclude the specific autoconfiguration class using @EnableAutoConfiguration annotation
Use application.properties or application.yml to exclude autoconfiguration classes
Interview experience
Senior Engineer
198
salaries
| ₹6.2 L/yr - ₹16.4 L/yr |
Senior Software Engineer
119
salaries
| ₹6.2 L/yr - ₹17 L/yr |
Lead Engineer
110
salaries
| ₹10.4 L/yr - ₹24 L/yr |
Software Engineer
108
salaries
| ₹3 L/yr - ₹12.1 L/yr |
Engineer
83
salaries
| ₹4.7 L/yr - ₹11 L/yr |
TCS
Infosys
Wipro
HCLTech