Filter interviews by
I applied via Internshala and was interviewed in Oct 2023. There were 3 interview rounds.
I applied via Naukri.com and was interviewed in Oct 2024. There was 1 interview round.
Method reference is a shorthand syntax for lambda expressions in Java.
Method reference is more concise and readable than lambda expressions.
Method reference can be used to refer to static methods, instance methods, and constructors.
Lambda expressions are more flexible and can be used in situations where method reference is not applicable.
I applied via Approached by Company and was interviewed in Mar 2024. There were 3 interview rounds.
Find repeat elements in an array of strings
Iterate through the array and store each element in a HashMap with its count
Check if the count of any element is greater than 1, then it is a repeat element
Return the repeat elements found in the array
Build a basic CRUD REST API endpoint
Create a REST API endpoint for each CRUD operation (Create, Read, Update, Delete)
Use HTTP methods like POST, GET, PUT, DELETE to perform CRUD operations
Implement data validation and error handling for each operation
Utilize a framework like Spring Boot or Express.js to simplify API development
To find the third highest salary in a SQL table, you can use the 'SELECT TOP 1' statement with 'ORDER BY salary DESC OFFSET 2 ROWS FETCH NEXT 1 ROWS ONLY'.
Use the 'SELECT TOP 1' statement to retrieve only one record
Order the records by salary in descending order using 'ORDER BY salary DESC'
Skip the first two highest salaries using 'OFFSET 2 ROWS'
Fetch the next record after skipping the first two using 'FETCH NEXT 1 ROW
I was interviewed in Aug 2023.
A simple program to print 'fizz' for multiples of 3, 'buzz' for multiples of 5, and 'fizzbuzz' for multiples of both.
Iterate through numbers from 1 to n.
Use modulo operator to check divisibility by 3 and 5.
Print 'fizz', 'buzz', or 'fizzbuzz' accordingly.
Yes, classes implementing an interface must implement interface methods.
Classes implementing an interface must provide concrete implementations for all methods declared in the interface.
Failure to implement all interface methods will result in a compilation error.
Interfaces are used to define a contract that implementing classes must adhere to.
Static method is a method that belongs to the class itself, not to any specific instance of the class.
Static methods can be called without creating an instance of the class.
They are commonly used for utility methods that do not require access to instance variables.
Static methods are declared using the 'static' keyword.
Example: Math.max() is a static method in the Math class that returns the maximum of two numbers.
I applied via Naukri.com and was interviewed in Jun 2023. There were 4 interview rounds.
In the first round there was apptiute round. Intermediate level question was there.
In coding round there was 2 question, i have done both. Hard level question was there
I applied via Company Website and was interviewed in Dec 2021. There were 3 interview rounds.
JDK is a development kit, JRE is a runtime environment, and JVM is a virtual machine for executing Java code.
JDK includes JRE and development tools like javac and java
JRE includes JVM and necessary libraries to run Java applications
JVM is responsible for interpreting Java bytecode and executing it
Example: JDK 8 includes JRE 8 and development tools like javac and java
Example: JRE 8 includes JVM 8 and necessary libraries
Design patterns are reusable solutions to common software problems.
Creational patterns: Singleton, Factory, Abstract Factory, Builder, Prototype
Structural patterns: Adapter, Bridge, Composite, Decorator, Facade, Flyweight, Proxy
Behavioral patterns: Chain of Responsibility, Command, Interpreter, Iterator, Mediator, Memento, Observer, State, Strategy, Template Method, Visitor
In my current project, I implemented object-oriented programming (OOPs) principles to design and develop a banking application.
Used encapsulation to protect sensitive customer data
Implemented inheritance to create different types of bank accounts
Utilized polymorphism to perform different operations on various account types
Applied abstraction to hide complex implementation details from users
Implemented interfaces to def
Stream API is used to perform operations on collections in a functional programming style.
Stream API provides a set of methods to perform operations on collections such as filtering, mapping, and reducing.
It allows for concise and readable code by using lambda expressions.
Stream API supports parallel processing for improved performance.
Examples: stream.filter(x -> x > 5), stream.map(x -> x * 2), stream.reduce(0, (x, y)
Dependency Injection (DI) is a design pattern used in Spring framework to manage object dependencies.
DI allows objects to be loosely coupled, making them easier to test and maintain.
In Spring, DI is achieved through inversion of control (IoC) container.
There are three types of DI in Spring: constructor injection, setter injection, and field injection.
Example: @Autowired annotation in Spring is used for DI.
DI promotes r...
Synchronization in Java is used to control access to shared resources by multiple threads.
Synchronization can be achieved using synchronized keyword or locks.
It ensures that only one thread can access the shared resource at a time.
Synchronization can be applied to methods or blocks of code.
Example: synchronized void method() { //code }
Example: synchronized(obj) { //code }
TCS
Accenture
Wipro
Cognizant