i
10405090xyzabc
Work with us
Filter interviews by
Checked exceptions must be declared or handled, while unchecked exceptions do not require explicit handling in Java.
Checked exceptions are subclasses of Exception (excluding RuntimeException). Example: IOException.
Unchecked exceptions are subclasses of RuntimeException. Example: NullPointerException.
Checked exceptions must be either caught using try-catch or declared in the method signature with 'throws'.
Unchecked...
Method overloading allows multiple methods with the same name but different parameters; overriding replaces a superclass method in a subclass.
Method Overloading: Same method name, different parameter types or counts.
Example of Overloading: 'void add(int a, int b)' and 'void add(double a, double b)'.
Use Overloading for convenience and readability when methods perform similar functions.
Method Overriding: Redefining ...
ArrayList uses dynamic arrays, while LinkedList uses linked nodes. Choose based on performance needs for insertion and access.
ArrayList is backed by a dynamic array, allowing fast random access (O(1)). Example: accessing elements by index.
LinkedList is backed by a doubly linked list, allowing fast insertions and deletions (O(1)) at both ends. Example: adding/removing elements from the front.
ArrayList has a fixed s...
In Java, '==' checks reference equality, while '.equals()' checks value equality. Use them appropriately to avoid bugs.
== compares object references, checking if both refer to the same memory location.
Example: String a = new String('test'); String b = new String('test'); a == b returns false.
.equals() compares the actual content of the objects.
Example: a.equals(b) returns true because the content is the same.
Use '...
Immutability in Java ensures objects cannot be changed after creation, enhancing thread safety and reducing side effects.
Immutable objects cannot be modified after creation, e.g., String class in Java.
Thread-safe: Since they cannot change, they prevent issues in multi-threaded environments.
Prevent unintended side effects, making code easier to understand and maintain.
To create an immutable class, use final fields ...
Immutability in Java means objects cannot be modified after creation, enhancing safety and performance.
Immutability ensures thread safety, as immutable objects can be shared without synchronization.
Example: String class in Java is immutable; once created, its value cannot change.
Immutable objects can be cached and reused, reducing memory overhead.
In the Flyweight pattern, immutable objects are shared to minimize m...
Java Streams enable parallel processing using ForkJoin framework, but have pitfalls like race conditions and performance issues with small datasets.
Use parallelStream() for parallel processing of collections.
Example: List<Integer> numbers = Arrays.asList(1, 2, 3, 4, 5); numbers.parallelStream().map(n -> n * 2).forEach(System.out::println);
Avoid shared mutable state to prevent race conditions.
Use forEachOr...
Java Streams enable parallel processing via ForkJoin framework, enhancing performance but with potential pitfalls.
Use parallelStream() for parallel processing: Example: list.parallelStream().map(...).collect(Collectors.toList());
Avoid shared mutable state to prevent race conditions: Use immutable objects or thread-safe collections.
Consider the size of the dataset: Parallel processing is beneficial for large datase...
Lambda expressions enhance Java code by making it more concise, readable, and easier to maintain through functional programming.
Conciseness: Lambda expressions reduce boilerplate code. For example, instead of creating an anonymous class for a Runnable, you can use: Runnable r = () -> System.out.println('Hello');
Readability: Code using lambda expressions is often more intuitive. For instance, using streams: list...
Java's garbage collector reclaims memory from unused objects, optimizing performance and managing memory efficiently.
Garbage collection is automatic, freeing developers from manual memory management.
Java uses different GC algorithms: Serial, Parallel, CMS, and G1, each suited for different scenarios.
Memory is divided into Young Generation (short-lived objects) and Old Generation (long-lived objects).
Minor GC occur...
I appeared for an interview in Jun 2025, where I was asked the following questions.
I appeared for an interview in Jun 2025, where I was asked the following questions.
I appeared for an interview in Jun 2025, where I was asked the following questions.
I appeared for an interview in Jun 2025, where I was asked the following questions.
I appeared for an interview in Jun 2025, where I was asked the following questions.
ArrayList offers fast access and is memory efficient, while LinkedList excels in insertions and deletions.
ArrayList allows O(1) access time, ideal for frequent retrievals (e.g., accessing elements by index).
LinkedList provides O(1) insertion/deletion at both ends, suitable for queue implementations.
ArrayList has lower memory overhead compared to LinkedList, which uses extra memory for pointers.
In scenarios with frequen...
Java's synchronized keyword offers simplicity for thread safety but can lead to performance issues and deadlocks.
Synchronized is easy to use and requires less code, making it suitable for simple scenarios.
It automatically releases the lock when the thread exits the synchronized block, reducing the risk of forgetting to unlock.
Performance can degrade with high contention, as threads may block each other, leading to incr...
== checks reference equality; .equals() checks value equality, can be overridden for custom comparison.
== compares memory addresses, while .equals() compares actual content.
Example: new String('hello') == new String('hello') returns false.
'hello'.equals('hello') returns true, as it compares values.
For wrapper classes like Integer, caching affects == behavior for small values (-128 to 127).
Override equals() when logical...
Java's garbage collector automatically manages memory, reclaiming space from unused objects through various algorithms.
Garbage collection in Java is automatic, freeing developers from manual memory management.
The JVM uses different GC algorithms: Serial, Parallel, CMS, and G1, each with unique characteristics.
Memory is divided into Young Generation (short-lived objects) and Old Generation (long-lived objects).
Minor GC ...
Lambda expressions enhance Java code by making it more concise, readable, and easier to maintain through functional programming.
Conciseness: Lambda expressions reduce boilerplate code. Example: Instead of writing an anonymous class for Runnable, use () -> System.out.println("Hello").
Readability: Code becomes more expressive. Example: Using lambdas with Collections: list.forEach(item -> System.out.println(item)).
M...
Checked exceptions require handling; unchecked exceptions do not. Custom exceptions can be either based on use case.
Checked exceptions must be caught or declared (e.g., IOException, SQLException).
Unchecked exceptions do not require explicit handling (e.g., NullPointerException, ArithmeticException).
Checked exceptions enforce robust error handling but can clutter code.
Unchecked exceptions indicate programming errors tha...
The Java Memory Model defines thread interactions with memory, ensuring visibility and ordering in multithreaded environments.
JMM specifies how threads see shared variables and their updates.
Volatile keyword ensures visibility of changes across threads.
Synchronized blocks provide mutual exclusion and visibility guarantees.
Without synchronization, threads may read stale or inconsistent data.
Compiler and CPU optimization...
Method overloading allows same method name with different parameters; overriding changes parent method behavior in subclasses.
Method Overloading: Same method name, different parameters (e.g., `int add(int a, int b)` and `double add(double a, double b)`)
Method Overriding: Subclass provides specific implementation of a parent method (e.g., `void sound()` in `Animal` class and `void sound()` in `Dog` class).
Overloading is...
Functional interfaces in Java enable concise lambda expressions for single abstract methods, enhancing API flexibility and usability.
A functional interface has exactly one abstract method, e.g., Runnable, Callable.
Lambda expressions provide a shorthand way to implement functional interfaces, e.g., () -> System.out.println("Hello World").
Functional interfaces can include multiple default or static methods, allowing f...
Java Streams enable functional operations on collections with lazy evaluation, differing from Iterators in several key aspects.
Streams support functional-style operations like filter(), map(), and reduce().
Example: stream.filter(x -> x > 10).map(x -> x * 2).collect(Collectors.toList());
Streams are not reusable; once consumed, they cannot be used again.
Iterators can be reset and reused, allowing for multiple tr...
Immutability in Java ensures objects cannot be changed after creation, enhancing thread safety and preventing unintended side effects.
Immutable objects cannot be modified after creation, e.g., String class.
Thread-safe by nature, as they prevent concurrent modification issues.
To create an immutable class, use final fields and avoid setters.
Collections can be made immutable using Collections.unmodifiableList().
Useful for...
final, finally, and finalize serve different purposes in Java: constants, cleanup, and garbage collection respectively.
final: Used to declare constants. Example: final int MAX_VALUE = 100;
final: Prevents method overriding. Example: final void display() {}
final: Prevents inheritance. Example: final class Constants {}
finally: Executes after try-catch for cleanup. Example: try { ... } catch { ... } finally { closeResource...
Singleton pattern ensures a class has only one instance, providing a global access point to it.
Private constructor prevents instantiation from outside the class.
Static instance variable holds the single instance of the class.
Lazy initialization creates the instance only when needed.
Eager initialization creates the instance at class loading time.
Thread safety can be achieved using synchronized methods or blocks.
Double-c...
Java annotations provide metadata to enhance code readability and reduce boilerplate in frameworks like Spring.
Annotations serve as metadata, providing additional information about classes, methods, and fields.
Common built-in annotations include @Override, @Deprecated, and @SuppressWarnings.
Spring framework uses annotations like @Component for defining beans and @Autowired for dependency injection.
Annotations reduce bo...
Java Streams enable parallel processing using ForkJoin framework, but have pitfalls like race conditions and performance issues with small datasets.
Use parallel streams for CPU-intensive tasks to leverage multiple cores.
Avoid using parallel streams for small datasets as overhead may outweigh benefits.
Minimize shared mutable state to prevent race conditions; prefer immutable objects.
Use forEachOrdered() for order-sensit...
I appeared for an interview in Jun 2025, where I was asked the following questions.
ArrayList offers fast access and is memory efficient, while LinkedList excels in insertions and deletions but has higher memory overhead.
ArrayList provides O(1) access time, ideal for frequent retrievals.
LinkedList allows O(1) insertions/deletions at both ends, suitable for dynamic data.
Example: Use ArrayList for a list of user names where frequent access is needed.
Example: Use LinkedList for a playlist where songs are...
Java's synchronized keyword offers simplicity for thread safety but can lead to performance issues and deadlocks.
Synchronized is easy to use and requires less code, making it suitable for simple scenarios.
It automatically releases the lock when the thread exits the synchronized block, reducing the risk of forgetting to unlock.
Performance can degrade due to thread contention, leading to blocking and context switching.
De...
== checks reference equality; .equals() checks value equality. Override equals() for custom comparison in user-defined classes.
== compares memory addresses, while .equals() compares actual content.
Example: new String("hello") == new String("hello") returns false.
"hello".equals("hello") returns true, showing value equality.
Wrapper classes like Integer cache values from -128 to 127, affecting == behavior.
Override equals(...
Java's garbage collector reclaims memory from unused objects, optimizing performance and managing memory regions.
Garbage collection in Java is automatic, freeing developers from manual memory management.
The heap is divided into Young Generation (short-lived objects) and Old Generation (long-lived objects).
Minor GC occurs in the Young Generation, quickly reclaiming memory from short-lived objects.
Major GC (Full GC) clea...
Lambda expressions enhance Java code by making it more concise, readable, and easier to maintain through functional programming.
Conciseness: Lambda expressions reduce boilerplate code. Example: Instead of writing an anonymous class for Runnable, use () -> System.out.println("Hello").
Readability: They express behavior more clearly. Example: list.forEach(item -> System.out.println(item)) is clearer than using an it...
Checked exceptions require handling; unchecked exceptions do not. Custom exceptions can be either, based on use case.
Checked exceptions must be caught or declared (e.g., IOException, SQLException).
Unchecked exceptions do not require explicit handling (e.g., NullPointerException, ArithmeticException).
Use checked exceptions for recoverable conditions and unchecked for programming errors.
Custom exceptions can be created f...
The Java Memory Model defines thread interactions with memory, ensuring visibility and ordering in multithreaded environments.
JMM specifies how threads read and write shared variables.
Volatile keyword ensures visibility of changes across threads.
Synchronized blocks provide mutual exclusion and visibility guarantees.
Without synchronization, threads may see stale or inconsistent data.
Compiler and CPU optimizations can re...
Method overloading allows multiple methods with the same name in a class, while overriding allows subclass methods to redefine parent methods.
Method Overloading: Same method name, different parameters (e.g., `int add(int a, int b)` and `double add(double a, double b)`)
Method Overriding: Subclass provides a specific implementation of a method defined in its superclass (e.g., `void display() { System.out.println('Subclas...
Functional interfaces in Java enable lambda expressions for concise implementation of single abstract methods.
A functional interface has exactly one abstract method, e.g., Runnable, Callable.
Lambda expressions provide a shorthand way to implement functional interfaces, e.g., () -> System.out.println("Hello").
Functional interfaces can have multiple default or static methods, allowing for added functionality without b...
Java Streams enable functional operations on collections, differing from Iterators in performance and usage.
Parallel streams can improve performance by utilizing multiple CPU cores, e.g., processing a large list of numbers concurrently.
They are best suited for CPU-intensive tasks, like complex calculations or data transformations.
However, they can introduce overhead due to thread management, which may negate performanc...
Immutability in Java ensures objects cannot be modified after creation, enhancing thread safety and consistency.
Immutable objects cannot be changed after creation, e.g., String class.
Thread-safe: Multiple threads can access immutable objects without synchronization issues.
Prevents unintended side effects in multi-threaded applications.
To create an immutable class, use final fields and avoid setters.
Collections can be m...
final, finally, and finalize serve different purposes in Java: constants, cleanup, and garbage collection respectively.
final: Used to declare constants. Example: final int MAX_VALUE = 100;
finally: Block that executes after try-catch. Example: try { ... } catch { ... } finally { cleanup(); }
finalize(): Method called by the garbage collector. Example: protected void finalize() { ... }
final variable cannot be reassigned a...
Singleton pattern restricts class instantiation to one object, useful for shared resources management.
Private constructor prevents instantiation from outside the class.
Static instance variable holds the single instance of the class.
Lazy initialization creates the instance only when needed.
Eager initialization creates the instance at class loading time.
Thread safety can be achieved using synchronized methods or blocks.
D...
Java annotations provide metadata for classes and methods, enhancing code readability and reducing boilerplate in frameworks like Spring.
Annotations like @Component and @Service simplify bean management in Spring.
Dependency injection is streamlined with @Autowired, reducing manual wiring.
Built-in annotations like @Override improve code clarity by indicating overridden methods.
Custom annotations can encapsulate specific...
Java Streams enable parallel processing using ForkJoin framework, but have pitfalls like race conditions and performance issues with small datasets.
Use parallelStream() for parallel processing: List<String> parallelList = myList.parallelStream().filter(...).collect(Collectors.toList());
Avoid shared mutable state to prevent race conditions: Use immutable objects or thread-safe collections.
Consider the size of the ...
ArrayList offers fast access and is memory efficient, while LinkedList excels in insertions and deletions.
ArrayList: Fast random access (O(1)), ideal for frequent retrievals. Example: Accessing elements in a list of user IDs.
LinkedList: Fast insertions/deletions (O(1) at head/tail), suitable for dynamic data structures. Example: Implementing a queue.
Memory Overhead: LinkedList has higher memory usage due to additional ...
Java's synchronized keyword offers simplicity for thread safety but has limitations like performance issues and potential deadlocks.
Synchronized is easy to use and requires less code, making it suitable for simple scenarios.
It automatically releases the lock when the thread exits the synchronized block, reducing the risk of forgetting to unlock.
Performance can degrade with high contention, as threads may block each oth...
== checks reference equality; .equals() checks value equality, can be overridden for custom comparison.
== compares memory addresses, while .equals() compares the actual content of objects.
Example: new String('hello') == new String('hello') returns false, but 'hello'.equals('hello') returns true.
For wrapper classes like Integer, small values (-128 to 127) are cached, affecting == behavior.
Override equals() when logical ...
Java's garbage collector reclaims memory from unused objects, optimizing performance and managing memory efficiently.
Garbage collection in Java is automatic, freeing developers from manual memory management.
The heap is divided into Young Generation (short-lived objects) and Old Generation (long-lived objects).
Minor GC occurs in the Young Generation, while Major GC (Full GC) affects the Old Generation and can cause appl...
Lambda expressions enhance Java code by promoting functional programming, improving readability, and simplifying code maintenance.
Concise syntax: Lambda expressions reduce boilerplate code, making it easier to read. Example: (x) -> x * 2 instead of creating a separate class.
Improved focus: They allow developers to focus on the 'what' rather than the 'how', enhancing clarity. Example: list.forEach(item -> System.o...
Checked exceptions require handling; unchecked exceptions do not. Custom exceptions can be either, based on use case.
Checked exceptions must be caught or declared (e.g., IOException, SQLException).
Unchecked exceptions do not require explicit handling (e.g., NullPointerException, ArithmeticException).
Checked exceptions promote robust error handling but can clutter code.
Unchecked exceptions indicate programming errors th...
The Java Memory Model defines thread interactions with memory, ensuring visibility and ordering in multithreaded environments.
JMM specifies how threads read and write shared variables.
Volatile keyword ensures visibility of changes across threads.
Synchronized blocks provide mutual exclusion and visibility guarantees.
Without synchronization, threads may see stale or inconsistent data.
Compiler and CPU optimizations can re...
Method overloading allows multiple methods with the same name but different parameters, while overriding changes a parent's method in a subclass.
Method Overloading: Same method name, different parameters (e.g., int add(int a, int b) vs. double add(double a, double b)).
Method Overriding: Subclass provides a specific implementation of a method defined in its superclass (e.g., class Animal has method sound(), class Dog ov...
Functional interfaces in Java enable concise implementations using lambda expressions, enhancing code readability and flexibility.
A functional interface has exactly one abstract method, e.g., Runnable, Callable.
Lambda expressions provide a shorthand way to implement functional interfaces, e.g., () -> System.out.println("Hello").
Functional interfaces can have multiple default or static methods, allowing for added fun...
Java Streams enable functional operations on collections with lazy evaluation, unlike Iterators which are more imperative.
Streams support functional-style operations like filter(), map(), and reduce().
Example: list.stream().filter(x -> x > 10).collect(Collectors.toList());
Streams are not reusable; once consumed, they cannot be used again.
Iterators can be reset and reused, allowing for multiple traversals.
Parallel...
Immutability in Java ensures objects cannot be modified after creation, enhancing safety and consistency in multi-threaded environments.
Immutable objects cannot be changed after creation, e.g., String class.
Thread-safe by nature, preventing unintended side effects in multi-threaded programs.
To create an immutable class, use final fields and avoid setters.
Collections can be made immutable using Collections.unmodifiableL...
final, finally, and finalize serve different purposes in Java: constants, cleanup, and garbage collection respectively.
final: Used to declare constants. Example: final int MAX_VALUE = 100;
finally: A block that executes after try-catch. Example: try { /* code */ } catch (Exception e) { /* handle */ } finally { /* cleanup */ }
finalize(): A method called by the garbage collector. Example: protected void finalize() { /* cl...
Singleton pattern ensures a class has only one instance, providing a global point of access to it.
Private constructor prevents instantiation from outside the class.
Static instance variable holds the single instance of the class.
Lazy initialization creates the instance only when needed.
Eager initialization creates the instance at class loading time.
Thread safety can be achieved using synchronized methods or blocks.
Doubl...
Java annotations provide metadata for classes and methods, enhancing code readability and reducing boilerplate in frameworks like Spring.
Annotations like @Component and @Service in Spring simplify bean management and dependency injection.
Built-in annotations such as @Override and @Deprecated improve code clarity by indicating method behavior and deprecation status.
Custom annotations can be created using @interface to e...
Java Streams enable parallel processing using ForkJoin framework, but have pitfalls like race conditions and performance issues with small datasets.
Use parallelStream() for parallel processing: List<String> parallelList = list.parallelStream().filter(...).collect(Collectors.toList());
Avoid shared mutable state to prevent race conditions: Use immutable objects or thread-safe collections.
Use appropriate data struct...
final, finally, and finalize serve different purposes in Java: constants, cleanup, and garbage collection respectively.
final: Used to declare constants. Example: final int MAX_VALUE = 100;
finally: A block that executes after try-catch. Example: try { ... } catch { ... } finally { cleanup(); }
finalize(): A method called by the garbage collector. Example: protected void finalize() { ... }
final variable: Cannot be reassig...
The Singleton pattern restricts a class to a single instance, useful for shared resources like database connections.
Private constructor prevents instantiation from outside the class.
Static instance variable holds the single instance of the class.
Lazy initialization creates the instance only when needed.
Eager initialization creates the instance at class loading time.
Thread safety can be achieved using synchronized metho...
Java annotations provide metadata for classes, enhancing readability and reducing boilerplate in frameworks like Spring.
Annotations like @Component and @Service simplify bean configuration in Spring.
Using @Autowired allows for automatic dependency injection, reducing manual wiring.
Custom annotations can encapsulate repetitive logic, improving code clarity.
Annotations like @Transactional manage database transactions dec...
Java Streams enable parallel processing via ForkJoin framework, enhancing performance but with potential pitfalls.
Use parallelStream() for parallel processing: Example: list.parallelStream().map(...).collect(Collectors.toList());
Avoid shared mutable state to prevent race conditions: Use immutable objects or thread-safe collections.
Consider the size of the dataset: Parallel processing is beneficial for large datasets bu...
I appeared for an interview in May 2025, where I was asked the following questions.
final, finally, and finalize serve different purposes in Java: constants, cleanup, and garbage collection respectively.
final: Used to declare constants. Example: final int MAX_VALUE = 100;
finally: A block that executes after try-catch. Example: try { ... } catch { ... } finally { cleanup(); }
finalize(): A method called by the garbage collector. Example: protected void finalize() { ... }
final variable cannot be reassign...
Singleton pattern ensures a class has only one instance, providing a global point of access to it.
Private constructor prevents instantiation from outside the class.
Static instance variable holds the single instance of the class.
Lazy initialization creates the instance only when needed.
Eager initialization creates the instance at class loading time.
Thread safety can be achieved using synchronized methods or blocks.
Doubl...
Java annotations provide metadata for classes and methods, enhancing code readability and reducing boilerplate in frameworks like Spring.
Annotations like @Component and @Service simplify bean registration in Spring.
Dependency injection is streamlined with @Autowired, reducing manual wiring.
Custom annotations can encapsulate repetitive configurations, improving code clarity.
Annotations reduce the need for XML configurat...
Java Streams enable parallel processing using ForkJoin framework, but have pitfalls like race conditions and debugging challenges.
Use parallelStream() for parallel processing: Example: list.parallelStream().map(...).collect(Collectors.toList());
Avoid shared mutable state to prevent race conditions: Use immutable objects or thread-safe collections.
Consider the size of the dataset: Parallel streams are beneficial for lar...
Top trending discussions
Some of the top questions asked at the 10405090xyzabc interview -
The duration of 10405090xyzabc interview process can vary, but typically it takes about 2-4 weeks to complete.
based on 64 interview experiences
Difficulty level
Duration
based on 38 reviews
Rating in categories
Software Developer
32.2k
salaries
| ₹5.4 L/yr - ₹12.5 L/yr |
Software Engineer
10.3k
salaries
| ₹4.7 L/yr - ₹10.1 L/yr |
Sales Officer
1.7k
salaries
| ₹1.5 L/yr - ₹5.4 L/yr |
Softwaretest Engineer
121
salaries
| ₹12 L/yr - ₹20.3 L/yr |
System Engineer
71
salaries
| ₹7.5 L/yr - ₹7.5 L/yr |
PwC
KPMG India
IQVIA
Max Healthcare