Filter interviews by
I applied via Naukri.com and was interviewed before Dec 2023. There were 3 interview rounds.
Using Go routines to send and receive data between two concurrent processes.
Create two Go routines, one for sending data and one for receiving data
Use channels to communicate between the two Go routines
Example: sender Go routine sends data to a channel, receiver Go routine receives data from the same channel
Top trending discussions
I applied via Referral and was interviewed before Jul 2023. There were 3 interview rounds.
Online Coding test on hackrerrank platform
Find the second largest element in an array
Sort the array in descending order and return the second element
Iterate through the array and keep track of the largest and second largest elements
Handle edge cases like duplicates and empty arrays
I was interviewed in Jan 2025.
ArrayList and LinkedList are both implementations of the List interface in Java. ArrayList uses a dynamic array to store elements, while LinkedList uses a doubly linked list.
ArrayList is more efficient for random access and traversal, while LinkedList is better for frequent insertions and deletions.
ArrayList uses less memory overhead due to storing elements in a contiguous block of memory, while LinkedList requires ext...
Using Java's synchronized keyword for thread synchronization has advantages like simplicity and disadvantages like potential deadlocks. ReentrantLock offers more flexibility and control.
Advantages of synchronized keyword: easy to use, built-in support in Java, ensures mutual exclusion
Disadvantages of synchronized keyword: potential for deadlocks, limited flexibility
ReentrantLock advantages: more control over locking, a...
In Java, == compares memory addresses while .equals() compares the actual values of objects.
Use == to compare primitive data types and to check if two objects reference the same memory address.
Use .equals() to compare the actual values of objects, especially for String comparison.
Improper usage can lead to unexpected results, such as comparing memory addresses instead of values.
The Java garbage collector automatically manages memory by reclaiming unused objects.
Java garbage collector runs in the background to identify and remove objects that are no longer needed.
Different types of garbage collection algorithms in Java include Serial, Parallel, CMS, G1, and Z Garbage Collector.
For example, the Serial garbage collector uses a single thread for garbage collection, while the Parallel garbage coll...
Java 8 introduced features like lambdas and Stream API which have revolutionized the way Java applications are written.
Lambdas allow for more concise and readable code by enabling functional programming paradigms.
Stream API provides a way to process collections of objects in a functional style, allowing for easier parallel processing and improved performance.
Java 8 also introduced default methods in interfaces, allowin...
Checked exceptions are checked at compile time, while unchecked exceptions are not. Proper handling involves either catching or declaring the exception.
Checked exceptions must be either caught or declared in the method signature using 'throws'. Example: IOException.
Unchecked exceptions do not need to be caught or declared. Example: NullPointerException.
Proper handling of exceptions involves using try-catch blocks for c...
The Java Memory Model defines how threads interact through memory and how changes made by one thread are visible to others.
Java Memory Model ensures that threads have a consistent view of shared memory.
It defines the rules for reading and writing variables in a multithreaded environment.
Synchronization ensures that only one thread can access a shared resource at a time.
Volatile keyword in Java ensures visibility of cha...
Method overloading involves creating multiple methods in the same class with the same name but different parameters. Method overriding involves creating a new implementation of a method in a subclass.
Method overloading is used to provide multiple methods with the same name but different parameters, allowing for flexibility in method calls.
Method overriding is used to provide a new implementation of a method in a subcla...
Functional interfaces in Java are interfaces with a single abstract method. They can be used with lambda expressions for functional programming.
Functional interfaces have only one abstract method, but can have multiple default or static methods.
Lambda expressions can be used to implement the abstract method of a functional interface concisely.
An example of a custom functional interface is 'Calculator' with a single abs
Java Stream is a sequence of elements that supports functional-style operations. It differs from Iterator by being more declarative and allowing parallel processing.
Java Stream is a high-level abstraction over collections that allows for functional-style operations like map, filter, reduce, etc.
Streams are more declarative compared to Iterators, which are imperative. This means you specify what you want to do rather th...
Immutability in Java means objects cannot be modified after creation. String class achieves immutability by not allowing changes to its value.
Immutability means once an object is created, its state cannot be changed.
String class achieves immutability by making its value final and not providing any methods to modify it.
Advantages of immutable objects include thread safety, caching, and easier debugging.
Example: String s...
final, finally, and finalize have different meanings in Java.
final is a keyword used to restrict the user from changing the value of a variable, making it a constant.
finally is a block of code that is always executed, whether an exception is thrown or not.
finalize is a method used for cleanup operations before an object is garbage collected.
Singleton design pattern ensures a class has only one instance and provides a global point of access to it.
Create a private static instance of the class within the class itself.
Provide a public static method to access the instance, creating it if necessary.
Ensure the constructor is private to prevent instantiation from outside the class.
Use synchronized keyword or double-checked locking to ensure thread safety.
Java annotations are metadata that provide data about a program but do not affect the program itself. They are used in frameworks like Spring to configure and customize behavior.
Java annotations are used to provide metadata about a program, such as information about classes, methods, or fields.
In frameworks like Spring, annotations are used to configure various aspects of the application, such as defining beans, handli...
Java Streams can handle parallel processing using parallel streams. Pitfalls include increased complexity and potential for race conditions.
Java Streams can be processed in parallel by using the parallelStream() method.
Potential pitfalls of using parallel streams include increased complexity, potential for race conditions, and increased resource consumption.
To mitigate these pitfalls, ensure that the operations perform...
ArrayList is preferred for frequent retrieval operations, while LinkedList is suitable for frequent insertions/deletions.
Use ArrayList when you need fast random access and retrieval operations, such as searching for elements in a list.
Choose LinkedList when you need fast insertions/deletions, especially at the beginning or end of the list.
Consider memory overhead and performance trade-offs when deciding between ArrayLi...
ReentrantLock should be used instead of synchronized when more flexibility and control over locking mechanisms is needed.
Use ReentrantLock when you need to implement fair locking mechanisms.
ReentrantLock provides tryLock() and lockInterruptibly() methods for more control over locking.
Explicit unlocking in ReentrantLock reduces the chance of deadlocks compared to synchronized.
In Java, == checks for reference equality while equals() checks for value equality. Misuse of == can lead to logical errors.
Override equals() when you want to compare the actual content of objects in user-defined classes.
Override hashCode() alongside equals() to ensure proper functioning in collections like HashMap.
Implement the Comparable interface and override compareTo() for natural ordering of objects.
Garbage collection in Java automatically reclaims memory occupied by unused objects using different algorithms and memory regions.
Garbage collection in Java automatically reclaims memory occupied by unused objects
Different types of GC algorithms in JVM: Serial, Parallel, CMS, and G1 GC
Objects are managed in Young Generation, Old Generation, and PermGen/Metaspace
Minor GC cleans up short-lived objects in Young Generation
...
Lambda expressions in Java 8 improve readability and maintainability by enabling concise and functional-style programming.
Lambda expressions allow writing more compact code by removing boilerplate code.
They make code more readable by focusing on the behavior being implemented rather than the mechanics of implementation.
Lambda expressions promote functional programming paradigms, making code easier to understand and mai...
I was interviewed in Jan 2025.
ArrayList and LinkedList are both classes in Java that implement the List interface, but they have different underlying data structures.
ArrayList uses a dynamic array to store elements, providing fast random access but slower insertion and deletion.
LinkedList uses a doubly linked list to store elements, providing fast insertion and deletion but slower random access.
Choose ArrayList when you need fast random access and ...
Using Java's synchronized keyword for thread synchronization has advantages like simplicity and disadvantages like potential for deadlock. ReentrantLock offers more flexibility and control.
Advantages of synchronized keyword: simplicity, built-in support in Java
Disadvantages of synchronized keyword: potential for deadlock, lack of flexibility
ReentrantLock advantages: more flexibility, ability to try and lock with timeou...
In Java, == compares memory addresses while .equals() compares the actual values of objects.
Use == to compare primitive data types or to check if two objects reference the same memory location.
Use .equals() to compare the actual values of objects, especially for String comparisons.
Improper usage can lead to unexpected results, such as comparing objects instead of their values.
Java garbage collector manages memory by automatically deallocating memory that is no longer in use.
Java garbage collector runs in the background and identifies objects that are no longer reachable by the application.
It uses different algorithms like Mark-Sweep, Mark-Compact, and Copying to reclaim memory.
Mark-Sweep algorithm identifies and marks objects for deletion, then sweeps through and deallocates them.
Mark-Compa...
Java 8 introduced features like lambdas and Stream API which have revolutionized the way Java applications are written.
Lambdas allow for more concise and readable code by enabling functional programming style.
Stream API provides a way to process collections of objects in a functional way, allowing for easier parallel processing and improved performance.
Java 8 also introduced default methods in interfaces, allowing for ...
Checked exceptions must be handled at compile time, while unchecked exceptions do not need to be caught or declared.
Checked exceptions are subclasses of Exception class, while unchecked exceptions are subclasses of RuntimeException class.
Checked exceptions must be caught or declared in the method signature using 'throws', while unchecked exceptions do not have this requirement.
Examples of checked exceptions include IOE...
The Java Memory Model defines how threads interact through memory and how synchronization ensures visibility and consistency.
Java Memory Model specifies how threads interact with memory
Synchronization ensures visibility and consistency of shared data among threads
Volatile keyword ensures changes made by one thread are immediately visible to other threads
Example: Using volatile keyword to share a boolean flag among mult
Method overloading is when multiple methods have the same name but different parameters, while method overriding is when a subclass provides a specific implementation of a method in its superclass.
Method overloading is achieved within the same class by having multiple methods with the same name but different parameters.
Method overriding occurs in a subclass that provides a specific implementation of a method that is al...
Functional interfaces in Java are interfaces with a single abstract method. They can be used with lambda expressions for functional programming.
Functional interfaces have only one abstract method, but can have multiple default or static methods.
Lambda expressions can be used to implement the abstract method of a functional interface concisely.
An example of a custom functional interface is 'Calculator' with a single abs
Java Stream is a sequence of elements that supports functional-style operations. It differs from Iterator by being more declarative and allowing for parallel processing.
Java Stream is a high-level abstraction over collections that allows for functional-style operations like map, filter, reduce, etc.
Streams are more declarative compared to Iterators, which are imperative. This means that with Streams, you specify what y...
Immutability in Java means objects cannot be modified after creation. String class achieves immutability by not allowing changes to its value.
Immutability means once an object is created, its state cannot be changed.
String class in Java is immutable because its value cannot be modified once it is assigned.
Advantages of immutable objects include thread safety, security, and ease of caching.
final, finally, and finalize have different meanings in Java.
final is a keyword used to restrict the user from changing the value of a variable, making it a constant.
finally is a block of code that is always executed, whether an exception is thrown or not.
finalize is a method used for cleanup operations before an object is garbage collected.
Singleton design pattern ensures a class has only one instance and provides a global point of access to it.
Create a private static instance of the class within the class itself.
Provide a public static method to access the instance, creating it if necessary.
Make the constructor private to prevent instantiation from outside the class.
Use synchronized keyword or double-checked locking to ensure thread safety.
Java annotations are metadata that provide data about a program but do not affect the program itself. They are used in frameworks like Spring to configure and customize behavior.
Java annotations are used to provide metadata about classes, methods, fields, etc. in a program.
In frameworks like Spring, annotations are used to configure various aspects of the application, such as dependency injection, transaction managemen...
Java Streams can handle parallel processing using parallel streams. Pitfalls include increased complexity and potential for race conditions.
Java Streams can be processed in parallel by calling the parallel() method on a stream.
Potential pitfalls of using parallel streams include increased complexity, potential for race conditions, and performance overhead due to thread management.
To mitigate these pitfalls, ensure that...
ArrayList is preferred for frequent retrieval operations due to fast random access, while LinkedList is suitable for frequent insertions/deletions with fast O(1) complexity.
Use ArrayList for scenarios where frequent retrieval operations are needed, such as searching for elements in a large collection.
Choose LinkedList when frequent insertions/deletions are required, like maintaining a queue or stack with dynamic size.
C...
ReentrantLock should be used instead of synchronized when more flexibility and control over locking mechanisms is required.
Use ReentrantLock when you need to implement advanced locking mechanisms like tryLock() or lockInterruptibly()
ReentrantLock supports fair locking, ensuring that threads acquire the lock in the order they requested it
Explicit unlocking in ReentrantLock can help prevent deadlocks and improve performa
In Java, == checks for reference equality while equals() checks for value equality. Misuse of == can lead to logical errors.
Override equals() when you want to compare the actual content of objects in user-defined classes.
Override hashCode() method alongside equals() to ensure consistent behavior in collections like HashMap.
Implement Comparable interface and override compareTo() method for natural ordering of objects.
Garbage collection in Java automatically reclaims memory occupied by unused objects using different GC algorithms and memory regions.
Force garbage collection in Java can be done using System.gc() or Runtime.gc() methods.
It is generally not recommended to force garbage collection as it can disrupt the JVM's natural memory management process and cause performance issues.
Forcing garbage collection may not guarantee immedi...
Lambda expressions in Java 8 improve readability and maintainability by enabling concise and functional-style programming.
Lambda expressions allow writing more compact code by reducing boilerplate code.
They enable passing behavior as arguments to methods, making code more modular and flexible.
Example: (a, b) -> a + b is a lambda expression that adds two numbers.
Completed three medium-level coding challenges from LeetCode within 50 minutes.
I applied via Campus Placement and was interviewed before Nov 2020. There was 1 interview round.
I applied via Recruitment Consultant and was interviewed before Jul 2020. There was 1 interview round.
based on 2 interviews
Interview experience
Software Engineer
246
salaries
| ₹0 L/yr - ₹0 L/yr |
Technical Consultant
191
salaries
| ₹0 L/yr - ₹0 L/yr |
Senior Technical Associate
158
salaries
| ₹0 L/yr - ₹0 L/yr |
Data Engineer
158
salaries
| ₹0 L/yr - ₹0 L/yr |
Senior Software Engineer
126
salaries
| ₹0 L/yr - ₹0 L/yr |
IBM
SAP
Oracle
Microsoft Corporation