Filter interviews by
I applied via Naukri.com and was interviewed in Mar 2022. There was 1 interview round.
Top trending discussions
I applied via Walk-in and was interviewed before Jul 2020. There were 3 interview rounds.
I applied via Company Website and was interviewed in Sep 2021. There was 1 interview round.
ArrayList uses dynamic arrays, while LinkedList uses doubly linked nodes for storage, affecting performance and use cases.
ArrayList is backed by a dynamic array, allowing fast random access (O(1)). Example: accessing an element at index 5 is quick.
LinkedList consists of nodes that hold data and references to the next and previous nodes, making insertions/removals faster (O(1)) when at known positions.
ArrayList has a fi...
Java's synchronized keyword offers simple thread safety but has limitations compared to ReentrantLock's flexibility and features.
Advantages of synchronized: Simple to use, built-in language feature.
Disadvantages of synchronized: Can lead to thread contention, no timeout options.
ReentrantLock allows for more advanced features like tryLock() and timed lock acquisition.
Example of synchronized: synchronized void method() {...
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 '==' f...
Java's garbage collector automatically manages memory by reclaiming unused objects, improving performance and preventing memory leaks.
Java uses automatic garbage collection to manage memory, freeing developers from manual memory management.
The main garbage collection algorithms in Java include: Serial, Parallel, Concurrent Mark-Sweep (CMS), and G1 (Garbage-First).
The Serial GC is a simple, single-threaded collector sui...
Java 8 introduced lambdas, Stream API, and other features that enhance functional programming and improve code readability.
Lambda Expressions: Allow concise representation of single-method interfaces (functional interfaces). Example: (x, y) -> x + y.
Stream API: Facilitates functional-style operations on collections. Example: list.stream().filter(x -> x > 10).collect(Collectors.toList()).
Default Methods: Enable...
Checked exceptions must be declared or handled, while unchecked exceptions do not require explicit handling.
Checked exceptions are subclasses of Exception but not of RuntimeException.
Example: IOException, SQLException are checked exceptions.
Unchecked exceptions are subclasses of RuntimeException.
Example: NullPointerException, ArrayIndexOutOfBoundsException are unchecked exceptions.
Checked exceptions must be caught or d...
The Java Memory Model defines how threads interact through memory, ensuring visibility and ordering of shared variables.
The Java Memory Model (JMM) specifies how threads interact through memory and what behaviors are allowed.
It ensures visibility of shared variables across threads, preventing stale data issues.
Synchronization mechanisms (like synchronized blocks) enforce mutual exclusion and visibility.
The 'volatile' k...
I appeared for an interview in Apr 2025, where I was asked the following questions.
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 size, ...
Java's synchronized keyword offers thread safety but has limitations compared to ReentrantLock.
Advantages of synchronized: Simple to use, built-in language feature.
Disadvantages of synchronized: Can lead to deadlocks, less flexible than ReentrantLock.
ReentrantLock allows for tryLock() method, enabling non-blocking attempts to acquire a lock.
ReentrantLock supports fairness policies, allowing threads to acquire locks in ...
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 '==' f...
Java's garbage collector automatically manages memory by reclaiming unused objects, improving performance and preventing memory leaks.
Java uses automatic garbage collection to manage memory, freeing developers from manual memory management.
The main types of garbage collection algorithms in Java include: Serial, Parallel, Concurrent Mark-Sweep (CMS), and G1 (Garbage-First).
The Serial Garbage Collector is simple and suit...
Java 8 introduced lambdas, Stream API, and other features that enhance functional programming and simplify code.
Lambdas: Enable concise representation of functional interfaces. Example: (x, y) -> x + y.
Stream API: Facilitates functional-style operations on collections. Example: list.stream().filter(x -> x > 10).collect(Collectors.toList()).
Default Methods: Allow adding new methods to interfaces without breakin...
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 exce...
The Java Memory Model defines how threads interact through memory, ensuring visibility and ordering of shared variables.
The Java Memory Model (JMM) specifies how threads interact with memory, ensuring consistency and visibility.
It defines rules for visibility, atomicity, and ordering of operations in a multithreaded environment.
Without proper synchronization, threads may see stale or inconsistent data due to caching an...
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 a met...
I applied via Company Website and was interviewed in Apr 2022. There were 2 interview rounds.
Mcq
I applied via Naukri.com and was interviewed in Jun 2021. There was 1 interview round.
This question involves creating a program using HTML to demonstrate web development skills.
Understand the structure of an HTML document: <html>, <head>, <body>.
Use semantic HTML elements like <header>, <footer>, <article> for better accessibility.
Incorporate CSS for styling and JavaScript for interactivity.
Example: Create a simple webpage with a title, a paragraph, and a button that ...
I applied via Campus Placement and was interviewed in Aug 2024. There were 3 interview rounds.
They asked technical mcqs of html , css, javascript, C, C++
They will ask u coding questions
I applied via Campus Placement
Assignment was based on figma
Nice wonderful dsa and what this company
based on 1 interview experience
Difficulty level
Duration
Amazon Sellers Services
Primus Global Technologies
GAMMON INDIA
Magneti Marelli Motherson Auto System