Filter interviews by
Thread in Java is a lightweight sub-process that allows concurrent execution within a single process.
Threads allow multiple tasks to be executed concurrently in a Java program.
Threads share the same memory space and resources within a process.
Java provides built-in support for creating and managing threads using the Thread class or implementing the Runnable interface.
Example: Creating a new thread - Thread myThread = n
Top trending discussions
I applied via Referral and was interviewed in Oct 2024. There was 1 interview round.
Find the length of the longest subsequence of contiguous integers in an array.
Sort the array
Iterate through the array and check for consecutive integers
Keep track of the longest subsequence found
Use flatMap and map to extract list of pincodes from Employee objects
Use flatMap to flatten the list of Addresses in each Employee object
Use map to iterate over the flattened list and extract the pincodes
Example: employeeList.stream().flatMap(emp -> emp.getAddresses().stream()).map(address -> address.getPincode()).collect(Collectors.toList())
Database pooling is a technique used to manage a pool of database connections for efficient resource utilization. HikariCP is a popular database connection pooling library in Java.
HikariCP is a high-performance database connection pooling library for Java applications.
It is known for its low latency and high throughput.
Configurations for HikariCP include settings such as maximum pool size, connection timeout, and idle ...
I applied via Recruitment Consulltant and was interviewed in Dec 2024. There was 1 interview round.
ArrayList is implemented as a resizable array, while LinkedList is implemented as a doubly linked list.
ArrayList provides fast random access, LinkedList provides fast insertion and deletion.
ArrayList uses more memory as it needs to allocate a fixed size array, LinkedList uses more memory for storing references to the next and previous elements.
Example: ArrayList is better for scenarios where random access is required, ...
HashMap is non-synchronized and allows null values, while HashTable is synchronized and does not allow null values.
HashMap is non-synchronized, meaning it is not thread-safe, while HashTable is synchronized and thread-safe.
HashMap allows null values for both keys and values, while HashTable does not allow null keys or values.
HashMap is faster than HashTable as it is non-synchronized, but HashTable is preferred in multi...
The contract between hashCode and equals method is that if two objects are equal according to the equals method, then their hash codes must also be equal.
hashCode and equals method must be consistent - if two objects are equal according to equals method, their hash codes must be equal
If two objects have the same hash code, they may or may not be equal according to equals method
Overriding equals method in a class requir...
Java 8 introduced several new features including lambda expressions, functional interfaces, streams, and default methods in interfaces.
Lambda expressions allow you to pass functions as arguments.
Functional interfaces have a single abstract method and can be used with lambda expressions.
Streams provide a way to work with sequences of elements.
Default methods allow interfaces to have method implementations.
Ways to start a thread in Java
Extending the Thread class and overriding the run() method
Implementing the Runnable interface and passing it to a Thread object
Using a thread pool from the Executors class
The thread will continue running as it is already active
The thread will not be started again if it is already running
Attempting to start a thread that is already running will not have any effect
The thread will continue its execution without any interruption
Join method is used to wait for a thread to finish its execution, while sleep method is used to pause the execution of a thread for a specified amount of time.
Join method is used to wait for a thread to finish its execution before moving on to the next task.
Sleep method is used to pause the execution of a thread for a specified amount of time, allowing other threads to run.
Example: thread1.join() will wait for thread1 ...
I was interviewed in Jul 2024.
Microservices can introduce complexity, communication overhead, and potential performance issues.
Increased complexity due to managing multiple services
Communication overhead between services
Potential performance issues due to network latency
Difficulty in maintaining consistency across services
No, @FunctionalInterface cannot be extended. Map and flatMap are default methods in the interface and cannot be overridden.
No, @FunctionalInterface cannot be extended as it is a single abstract method interface.
Map and flatMap are default methods in the interface and cannot be overridden.
Example: public interface MyInterface { void myMethod(); default void myDefaultMethod() { // implementation } }
Using Java8 to filter vowels from an array of strings
Use Java8 stream and filter to iterate through each string in the array
Use a lambda expression to check if each character is a vowel
Collect the filtered strings into a new array
I applied via Company Website and was interviewed in Mar 2024. There were 5 interview rounds.
30 multiple choice questions
Two coding questions
posted on 30 Nov 2023
I applied via Naukri.com and was interviewed in Oct 2023. There were 2 interview rounds.
OOPs concepts are fundamental principles of object-oriented programming that help in designing and implementing software solutions.
Encapsulation: Bundling data and methods together in a class.
Inheritance: Creating new classes by inheriting properties and behaviors from existing classes.
Polymorphism: Ability of an object to take on many forms.
Abstraction: Hiding complex implementation details and providing a simplified ...
This program counts the occurrence of each letter in a given string.
Use a HashMap to store the count of each letter.
Iterate through the characters of the string and update the count in the HashMap.
Finally, print the count of each letter.
SQL query to find third highest salary from employee table.
Use the ORDER BY clause to sort the salaries in descending order
Use the LIMIT clause to limit the result to the third row
Use a subquery to exclude the highest and second highest salaries
Array is a fixed-size data structure while ArrayList is a dynamic-size data structure in Java.
Array has a fixed length, while ArrayList can grow dynamically.
Array can store both primitive types and objects, while ArrayList can only store objects.
Array uses square brackets [] for declaration, while ArrayList uses angle brackets <>.
Array provides direct access to elements using index, while ArrayList provides methods for...
ArrayList is a dynamic array that can grow or shrink in size. It stores objects and provides methods for adding, removing, and accessing elements.
ArrayList is part of the Java Collections Framework.
It is implemented as a resizable array.
Elements can be added using the add() method.
Elements can be accessed using the get() method.
Elements can be removed using the remove() method.
The size() method returns the number of el...
The default size of an ArrayList is 10.
The default initial capacity of an ArrayList is 10.
If the number of elements exceeds the initial capacity, the ArrayList automatically increases its size.
The capacity of an ArrayList can be increased manually using the ensureCapacity() method.
based on 1 interview
Interview experience
based on 3 reviews
Rating in categories
Associate
151
salaries
| ₹2 L/yr - ₹4.5 L/yr |
Senior Officer
106
salaries
| ₹4.2 L/yr - ₹10.9 L/yr |
Officer
101
salaries
| ₹3 L/yr - ₹9 L/yr |
Manager
72
salaries
| ₹5 L/yr - ₹16 L/yr |
Senior Manager
72
salaries
| ₹6.2 L/yr - ₹20.7 L/yr |
TCS
Infosys
Wipro
Tech Mahindra