TCS
100+ iServeU Interview Questions and Answers
Q101. Diffrence between arry and arry list
Array is a fixed-size data structure while ArrayList is a dynamic data structure in Java.
Array is a basic data structure in Java that stores a fixed-size sequential collection of elements of the same type.
ArrayList is a dynamic data structure that can grow or shrink in size as needed.
Arrays are faster and more efficient for accessing elements, while ArrayLists are more flexible and easier to use.
Example: int[] arr = new int[5]; ArrayList
list = new ArrayList<>(); Example: arr[...read more
Q102. Explain the usage of multithreading
Multithreading allows multiple threads to run concurrently, improving performance and responsiveness.
Multithreading is useful for tasks that can be split into smaller, independent parts.
It can improve performance by allowing multiple threads to execute simultaneously.
It can also improve responsiveness by allowing the UI thread to remain responsive while other tasks are running in the background.
Examples include downloading files while the user continues to interact with the a...read more
Q103. Why we use application.propeties?
application.properties is used to store configuration settings for Java applications.
Centralized storage for configuration settings
Easy to update without changing code
Allows for different configurations for different environments (development, testing, production)
Can be used to store database connection details, API keys, logging settings, etc.
Q104. Data transfer between components in angular
Data transfer between components in Angular can be achieved using input/output properties, services, and state management libraries like NgRx.
Use @Input and @Output decorators to pass data between parent and child components.
Create a service to share data between components that are not directly related.
Utilize state management libraries like NgRx for managing application state and sharing data between components.
Use event emitters to communicate between components.
Consider u...read more
Q105. what are plugins in springboot?
Plugins in Spring Boot are external modules that can be easily integrated into the application to add new functionalities.
Plugins in Spring Boot are typically implemented as Spring beans that can be dynamically loaded and executed at runtime.
They can be used to extend the functionality of the application without modifying the core codebase.
Examples of plugins in Spring Boot include custom authentication providers, logging frameworks, and database connectors.
Q106. How many data types in C?
C programming language has 5 primary data types: int, float, double, char, and void.
Primary data types in C are int, float, double, char, and void.
Examples: int num = 10; float value = 3.14; char letter = 'A';
Additional data types like long, short, signed, unsigned, etc. can be derived from these primary types.
Q107. What is Java, please explain ?
Java is a high-level programming language known for its portability, security, and versatility.
Java is an object-oriented language, meaning it focuses on creating objects that interact with each other.
It is platform-independent, meaning Java programs can run on any device that has a Java Virtual Machine (JVM).
Java is known for its security features, such as automatic memory management and built-in exception handling.
Popular Java frameworks include Spring, Hibernate, and Apach...read more
Q108. difference between Array and ArrayList
Array is a fixed-size data structure while ArrayList is a dynamic-size data structure.
Array is a primitive data type while ArrayList is a class in Java.
Array has a fixed size while ArrayList can grow or shrink dynamically.
Array can hold only homogeneous data types while ArrayList can hold heterogeneous data types.
Array uses [] to declare while ArrayList uses <>.
Example: int[] arr = new int[5]; ArrayList
list = new ArrayList<>();
Q109. What are the component annotations
Component annotations are used in Java to declare a class as a component of Spring framework.
@Component - declares a class as a Spring component
@Repository - declares a class as a data repository
@Service - declares a class as a service component
@Controller - declares a class as a controller component
Q110. capacity 16 and its only one null element
Capacity 16 with only one null element means there are 15 non-null elements in the array.
The array has a total capacity of 16 elements.
There is only one null element in the array.
This implies that there are 15 non-null elements in the array.
Q111. What is collection framework? Microservices
Collection framework in Java is a set of classes and interfaces that provide a standard way to store and manipulate groups of objects.
It provides interfaces like List, Set, and Map to store collections of objects.
Classes like ArrayList, LinkedList, HashSet, and HashMap implement these interfaces.
Collections framework simplifies the process of storing, retrieving, and manipulating data in Java programs.
Q112. What is Java and hibernate
Java is a programming language while Hibernate is an ORM tool for Java.
Java is an object-oriented programming language used for developing applications.
Hibernate is an ORM tool that simplifies the process of mapping Java objects to database tables.
Hibernate provides a framework for querying and manipulating data from a database using Java objects.
Hibernate supports various database management systems such as MySQL, Oracle, and PostgreSQL.
Hibernate reduces the amount of boiler...read more
Q113. What is jdk and its function
JDK stands for Java Development Kit, it is a software development kit used for developing Java applications.
JDK includes tools for developing, debugging, and monitoring Java applications.
It contains JRE (Java Runtime Environment) which is necessary for running Java programs.
JDK also includes a compiler, debugger, and other tools needed for Java development.
Examples of JDK versions include JDK 8, JDK 11, and JDK 15.
Q114. what is hibernate?
Hibernate is an open-source Java framework that simplifies the development of database interactions in Java applications.
Hibernate is an Object-Relational Mapping (ORM) tool that maps Java objects to database tables.
It provides a way to perform database operations using Java objects instead of writing SQL queries.
Hibernate handles the mapping of Java classes to database tables and vice versa, as well as the generation of SQL queries.
It helps in managing the database connectio...read more
Q115. What is Garbage collection?
Garbage collection is the process of automatically reclaiming memory occupied by objects that are no longer in use by the program.
Garbage collection is a feature in Java that automatically manages memory by deallocating memory for objects that are no longer needed.
It helps in preventing memory leaks and ensures efficient memory usage.
Garbage collection runs in the background and identifies objects that are no longer reachable by the program.
Examples of garbage collection algo...read more
Q116. What is method overloading?
Method overloading is when multiple methods in the same class have the same name but different parameters.
Allows multiple methods with the same name but different parameters to be defined in a class.
Parameters can differ in number, type, or order.
Example: void print(int a) and void print(String s) are overloaded methods in the same class.
Q117. Javaa features and technology
Java is a popular programming language known for its features like platform independence, object-oriented programming, and automatic memory management.
Java is platform-independent, meaning that it can run on any platform that has a Java Virtual Machine (JVM) installed.
Java supports object-oriented programming (OOP) concepts like encapsulation, inheritance, and polymorphism.
Java has automatic memory management, which means that the programmer does not have to manually allocate...read more
Q118. what is a classLoader?
A classLoader is a part of the Java Runtime Environment that dynamically loads Java classes into the Java Virtual Machine.
ClassLoader is responsible for loading classes at runtime in Java.
It follows a delegation hierarchy to search for classes.
There are different types of class loaders like Bootstrap, Extension, and System class loaders.
Custom class loaders can be created to load classes from different sources like network or database.
Q119. what is Polymorphism?
Polymorphism is the ability of an object to take on multiple forms.
Polymorphism allows objects of different classes to be treated as objects of a common superclass.
There are two types of polymorphism: compile-time (method overloading) and runtime (method overriding).
Example: Animal superclass with Dog and Cat subclasses, both overriding the makeSound() method.
Q120. Median of sub array in given array
Find the median of a subarray in a given array.
Sort the subarray and find the middle element for odd length subarrays.
For even length subarrays, find the average of the middle two elements.
Use a sliding window approach to iterate through all subarrays.
Q121. Difference between failsafe and faifast
Failsafe is a mechanism to handle failures without affecting the system's overall functionality, while failfast immediately stops the system upon encountering an error.
Failsafe is used to ensure that a system remains operational even in the face of failures, by providing alternative paths or fallback options.
Failfast is a strategy where the system stops as soon as an error is detected, to prevent further damage or incorrect results.
Example: Failsafe can be implemented in a di...read more
Q122. Frequency of numbers in an array
Count the frequency of numbers in an array of strings.
Iterate through the array and use a HashMap to store the count of each number.
Handle edge cases like empty array or null values.
Return the HashMap with number frequencies.
Q123. How HashMap works internally?
HashMap works internally using an array of buckets to store key-value pairs, with each bucket containing a linked list of entries.
HashMap uses hashing to determine the index of the bucket where the key-value pair should be stored.
If multiple key-value pairs hash to the same index, they are stored in a linked list within that bucket.
When retrieving a value, the key's hash code is used to find the correct bucket, then the linked list is traversed to find the matching key.
HashMa...read more
Q124. difference between array & arry list
Array is a fixed size data structure while ArrayList is a dynamic size data structure in Java.
Array is a primitive data type while ArrayList is a class in Java.
Array can hold only homogeneous data types while ArrayList can hold heterogeneous data types.
Array needs to be initialized with a fixed size while ArrayList can be initialized without a size.
Array uses [] brackets to declare while ArrayList uses <> brackets to declare.
Array is faster than ArrayList for accessing elemen...read more
Q125. What is marker interface
Marker interface is an interface with no methods, used to mark a class as having a certain property or behavior.
Marker interfaces are used for metadata purposes.
They are used to provide information to the compiler or runtime environment.
Examples of marker interfaces in Java include Serializable, Cloneable, and Remote.
Marker interfaces can also be used to enforce design patterns, such as the Decorator pattern.
Q126. What is multi threading
Multi threading is the ability of a program to execute multiple threads concurrently, allowing for better performance and responsiveness.
Allows multiple tasks to be performed simultaneously
Improves performance by utilizing multiple CPU cores
Can lead to synchronization issues if not handled properly
Example: A web server handling multiple client requests concurrently
Q127. How microservices communicate
Microservices communicate through lightweight protocols like HTTP, messaging queues, and RPC.
HTTP: RESTful APIs are commonly used for communication between microservices.
Messaging queues: Services can communicate asynchronously through message brokers like RabbitMQ or Kafka.
RPC (Remote Procedure Call): Services can directly call each other's functions over the network.
Q128. Rest controller and controller difference
Rest controller is used in Spring MVC for RESTful web services, while controller is used for general web requests.
Rest controller is used for creating RESTful web services in Spring MVC
Controller is used for handling general web requests in Spring MVC
Rest controller uses @RestController annotation, while controller uses @Controller annotation
Rest controller returns data in JSON or XML format, while controller returns data in HTML format
Q129. What is string immutable?
String in Java is immutable because once created, its value cannot be changed.
String objects are constant and their values cannot be changed after they are created.
Any operation that appears to modify a String actually creates a new String object.
Example: String str = "Hello"; str.concat(" World"); // This does not change the original value of str.
Q130. Difference between comparator and comparable
Comparator is used to compare objects of a class, while Comparable is implemented by a class to define its natural ordering.
Comparator is an interface that can be used to define custom comparison logic for objects.
Comparable is an interface that is implemented by a class to define its natural ordering.
Comparator can be used to sort objects in different ways, even if they don't implement Comparable.
Comparable allows objects to be sorted based on their natural ordering, such as...read more
Q131. Explain memory management in Java
Java uses automatic memory management through garbage collection to allocate and deallocate memory for objects.
Java uses garbage collection to automatically manage memory by deallocating objects that are no longer in use.
Memory is divided into stack and heap. Stack stores primitive types and references to objects, while heap stores objects.
Java automatically allocates memory for objects on the heap and deallocates memory when the object is no longer referenced.
Developers can ...read more
Q132. Comparison of Arraylist and LinkedList
ArrayList is implemented as a resizable array, 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 is a dynamic array, LinkedList uses more memory for storing references to next and previous elements.
ArrayList is better for storing and accessing data sequentially, LinkedList is better for manipulating data frequently.
Q133. What are literals in java
Literals in Java are fixed values that are directly used in the code.
Literals can be of various types such as integer literals, floating-point literals, character literals, string literals, boolean literals, and null literals.
Examples: int num = 10; double pi = 3.14; char letter = 'A'; String name = "John"; boolean flag = true; Object obj = null;
Q134. What is collection framework
Collection framework is a set of classes and interfaces that provide a way to store and manipulate groups of objects.
It includes interfaces like List, Set, and Map
It provides implementations like ArrayList, HashSet, and HashMap
It simplifies the process of storing and manipulating data
It allows for easy iteration and sorting of collections
Example: List
names = new ArrayList<>(); Example: Map
ages = new HashMap<>();
Q135. What is thread in java
Thread is a lightweight sub-process, a separate path of execution within a program.
Threads allow concurrent execution of two or more parts of a program.
Java provides built-in support for multithreading through the Thread class and Runnable interface.
Threads can be created by extending the Thread class or implementing the Runnable interface.
Thread.sleep() method is used to pause the execution of a thread for a specified amount of time.
Thread.join() method is used to wait for a...read more
Q136. What is micro services
Microservices is an architectural style that structures an application as a collection of small, independent services.
Microservices are independently deployable and scalable.
Each microservice focuses on a specific business capability.
Communication between microservices is usually done through APIs.
Microservices can be developed using different programming languages and technologies.
Examples of companies using microservices include Netflix, Amazon, and Uber.
Q137. What is constructor chaining
Constructor chaining is calling one constructor from another constructor within the same class.
It allows to reuse the code of one constructor in another constructor.
It is achieved using the 'this' keyword followed by the constructor parameters.
It can be used to set default values or to initialize variables before calling another constructor.
Example: public MyClass(int x) { this(x, 0); } public MyClass(int x, int y) { this.x = x; this.y = y; }
Q138. What is Singleton class?
Singleton class is a class that allows only one instance of itself to be created and provides a global point of access to that instance.
Singleton class restricts the instantiation of a class to one object.
It provides a way to access its unique instance globally.
Commonly used in scenarios where only one instance of a class is needed, such as database connections or configuration settings.
Q139. What is css? And types
CSS stands for Cascading Style Sheets. It is a language used for styling web pages.
CSS is used to control the layout and appearance of HTML elements on a webpage
There are three types of CSS: inline, internal, and external
Inline CSS is applied directly to an HTML element using the style attribute, e.g.
Internal CSS is defined within the
Q140. Explain equals() method
The equals() method is used to compare the contents of two objects for equality.
The equals() method is a method of the Object class in Java.
It is used to compare the contents of two objects for equality.
The default implementation of equals() in the Object class compares memory addresses, so it is often overridden in custom classes to compare content.
Example: String class overrides equals() method to compare the content of two strings.
Q141. Explain Synchronized keyword
Synchronized keyword is used in Java to control access to shared resources by multiple threads.
Synchronized keyword can be applied to methods or code blocks to ensure only one thread can access the synchronized code at a time.
It prevents race conditions and ensures thread safety by creating a lock on the object or class.
Example: synchronized void myMethod() { // synchronized code block }
Q142. Explain Executor framework
Executor framework is a framework in Java that provides a way to manage and execute tasks asynchronously.
Allows for managing thread execution in a more efficient way
Provides a way to decouple task submission from task execution
Supports various types of executors like ThreadPoolExecutor and ScheduledExecutorService
Helps in handling tasks concurrently and asynchronously
Q143. Explain BlockingQueue
BlockingQueue is an interface in Java that represents a queue which supports operations that wait for the queue to become non-empty when retrieving an element and wait for space to become available in the queue when adding an element.
BlockingQueue is part of the java.util.concurrent package.
It is used for implementing producer-consumer scenarios where multiple threads are involved.
Methods like put() and take() are used to add and remove elements from the queue, respectively.
Q144. API Gateway implementation
API Gateway implementation is a centralized service that routes, manages, and secures API calls.
API Gateway acts as a single entry point for all API calls
It can handle authentication, rate limiting, caching, and request/response transformations
Examples include AWS API Gateway, Apigee, Kong
Q145. Circuit breaker implementation
Circuit breaker is a design pattern used to prevent system overload by temporarily stopping requests to a failing service.
Circuit breaker monitors requests to a service and opens when the service fails repeatedly.
It helps prevent cascading failures and allows the system to gracefully degrade.
Once the circuit breaker is open, it can periodically check if the service has recovered before allowing requests again.
Q146. Runnable vs Callable interface
Runnable is a functional interface with a single run() method, while Callable is a functional interface with a single call() method.
Runnable is used for tasks that do not return a result, while Callable is used for tasks that return a result.
Callable can throw checked exceptions, while Runnable cannot.
Callable returns a Future object, which can be used to retrieve the result of the computation.
Example: Runnable - executing a task in a separate thread without returning a resul...read more
Q147. Runnable and callable difference
Runnable and Callable are interfaces in Java for creating threads. Runnable is used for tasks that don't return a result, while Callable is used for tasks that return a result.
Runnable is a functional interface with a single run() method, while Callable is a generic interface with a single call() method.
Runnable tasks are executed using the void run() method, while Callable tasks are executed using the Future
call() method. Runnable tasks cannot throw checked exceptions, while...read more
Q148. Explain streams and its advantage
Streams in Java are sequences of elements that support functional-style operations. They provide advantages like lazy evaluation and parallel processing.
Streams allow for functional-style operations like map, filter, and reduce.
They support lazy evaluation, meaning elements are processed only when needed.
Streams can be easily parallelized to improve performance.
Example: List
names = Arrays.asList("Alice", "Bob", "Charlie"); Stream stream = names.stream();
Q149. What is service discovery
Service discovery is the process of automatically finding and connecting to services in a network.
Service discovery allows applications to dynamically locate and communicate with services without hardcoding their locations.
It helps in load balancing, fault tolerance, and scalability by enabling services to be added or removed without manual intervention.
Examples of service discovery tools include Consul, Eureka, and Zookeeper.
Q150. what is oops
OOPs stands for Object-Oriented Programming. It is a programming paradigm based on the concept of objects.
OOPs focuses on creating objects that contain both data and functions to manipulate that data.
It emphasizes on encapsulation, inheritance, and polymorphism.
Java, C++, Python, and Ruby are some of the popular OOPs languages.
Example: A car can be considered as an object that has properties like color, model, and functions like start, stop, and accelerate.
Q151. Java programming structure
Java programming structure refers to the organization of code in a Java program.
Java programs are organized into classes, which contain methods and variables.
Classes can be grouped into packages for better organization.
Java follows a strict syntax and structure, with curly braces indicating code blocks.
Code must be compiled before it can be executed.
Java programs follow an object-oriented programming paradigm.
Q152. What is MicroServices
Microservices are a software development technique where applications are composed of small, independent services that communicate over well-defined APIs.
Microservices break down a large application into smaller, independent services
Each service is responsible for a specific function and can be developed, deployed, and scaled independently
Services communicate with each other over APIs, often using lightweight protocols like HTTP or messaging queues
Microservices architecture p...read more
Q153. Wat are containers in SpringBoot
Containers in SpringBoot are used to manage and deploy Spring applications.
Containers in SpringBoot provide a lightweight and portable way to package and run applications.
They include all the necessary dependencies and configurations needed to run the application.
Containers can be easily deployed and scaled using tools like Docker and Kubernetes.
Examples of containers in SpringBoot include Docker containers running SpringBoot applications.
Q154. Springboot vs Spring mvc difference
Spring Boot is an opinionated framework for building stand-alone, production-grade Spring-based Applications. Spring MVC is a part of the Spring Framework for building web applications.
Spring Boot is an opinionated framework that simplifies the setup and configuration of Spring applications, while Spring MVC is a part of the Spring Framework that focuses on building web applications.
Spring Boot provides embedded servers for deploying applications, whereas Spring MVC requires ...read more
Q155. Internal working of HashMap
HashMap is a data structure that stores key-value pairs and uses hashing to efficiently retrieve values based on keys.
HashMap internally uses an array of linked lists to store key-value pairs.
When a key-value pair is added, the key is hashed to determine the index in the array where it will be stored.
If multiple keys hash to the same index, a linked list is used to handle collisions.
HashMap allows one null key and multiple null values.
Example: HashMap<String, Integer> map = n...read more
Q156. Use of synchronized keyword
The synchronized keyword in Java is used to control access to shared resources by allowing only one thread to execute a synchronized block of code at a time.
Synchronized keyword can be used with methods or blocks of code to ensure thread safety.
It can be used to prevent race conditions and ensure data consistency in multi-threaded applications.
Example: synchronized void myMethod() { // synchronized method implementation }
Q157. WHat is java used for
Java is a versatile programming language used for developing a wide range of applications, from web and mobile apps to enterprise software.
Java is used for developing web applications, such as online banking systems and e-commerce websites.
It is commonly used for creating mobile applications for Android devices.
Java is also used for developing enterprise software, like customer relationship management (CRM) systems and supply chain management software.
Q158. Difference between jdbc & hibernate
JDBC is a low-level API for connecting to databases, while Hibernate is a high-level ORM framework.
JDBC requires manual coding for CRUD operations, while Hibernate provides automatic mapping of objects to database tables.
JDBC is more suitable for small-scale applications, while Hibernate is better for large-scale applications.
Hibernate provides caching and lazy loading, which improves performance, while JDBC does not have these features.
Hibernate supports inheritance mapping,...read more
Q159. What is constructor?
Constructor is a special method that is used to initialize objects in Java.
Constructor has the same name as the class name
It does not have a return type
It can be overloaded
It is called automatically when an object is created
Example: public class Car { public Car() { // constructor code here } }
Q160. What are microservices
Microservices are a software development technique where applications are broken down into smaller, independent services that communicate with each other.
Microservices are small, independent services that work together to form a complete application
Each microservice is responsible for a specific function or feature
Microservices communicate with each other through APIs
They can be developed, deployed, and scaled independently
Examples of companies using microservices include Net...read more
Q161. Write a smal program
A program to print the elements of an array of strings in reverse order.
Declare an array of strings.
Initialize the array with some values.
Loop through the array in reverse order.
Print each element of the array.
Q162. Explain Java 8 features
Java 8 introduced several new features including lambda expressions, streams, and functional interfaces.
Lambda expressions allow for functional programming and simplify code.
Streams provide a way to process collections of data in a functional way.
Functional interfaces allow for the use of lambda expressions.
Default methods allow for adding methods to interfaces without breaking existing implementations.
Date and time API improvements.
Nashorn JavaScript engine.
Parallel array so...read more
Q163. Java8 features and with example
Java8 introduced several new features including lambda expressions, functional interfaces, streams, and default methods.
Lambda expressions allow for more concise code by enabling functional programming.
Functional interfaces are interfaces with a single abstract method, such as Runnable or Comparator.
Streams provide a way to process collections of objects in a functional style.
Default methods allow interfaces to have method implementations.
Example: Lambda expression - (a, b) -...read more
Q164. What is Jvm process?
JVM process is an instance of Java Virtual Machine that executes Java bytecode.
JVM process is responsible for interpreting and executing Java bytecode.
It manages memory, handles garbage collection, and provides runtime environment for Java programs.
Examples of JVM implementations include Oracle HotSpot, OpenJ9, and GraalVM.
Q165. How java api work
Java API works by providing a set of classes and interfaces that allow developers to interact with various functionalities and services.
Java API provides a standardized way for developers to access and use pre-built classes and interfaces.
Developers can use Java API to perform tasks such as file handling, networking, database access, and more.
Java API documentation provides detailed information on how to use each class and interface, along with examples and best practices.
Q166. What is HTTP servlet
HTTP servlet is a Java class that extends the capabilities of servers that host applications accessed by HTTP protocol.
HTTP servlet is a Java class that extends the capabilities of servers that host applications accessed by HTTP protocol
It is used to handle HTTP requests and responses
It provides methods to get information about the request and to send a response back to the client
It can be used to create dynamic web pages, handle form data, and manage sessions
Example: HttpSer...read more
Q167. Why java?
Java is a versatile, platform-independent language with a vast community and extensive libraries.
Java is object-oriented and easy to learn.
It has a vast community and extensive libraries.
It is platform-independent and can run on any device.
Java is secure and reliable.
It is used in various domains like web development, mobile app development, and enterprise applications.
Examples: Android apps, Spring framework, Hadoop, Minecraft.
Q168. Hashmap of internal working
HashMap is a data structure that stores key-value pairs and uses hashing to efficiently retrieve values.
HashMap uses hashing to store and retrieve key-value pairs.
It allows null keys and values.
HashMap does not maintain insertion order.
Example: HashMap
map = new HashMap<>();
Q169. Spring vs spring boot
Spring is a framework for building Java applications, while Spring Boot is a tool for quickly creating standalone Spring-based applications.
Spring is a comprehensive framework that provides support for various functionalities like dependency injection, aspect-oriented programming, and more.
Spring Boot is an opinionated tool that simplifies the setup and configuration of Spring applications, allowing developers to quickly create standalone applications with minimal configurati...read more
Q170. what is Truncate
Truncate is a SQL command used to delete all rows from a table without logging the individual row deletions.
Truncate is a DDL (Data Definition Language) command in SQL.
It is used to quickly delete all rows from a table, but it does not log individual row deletions.
Truncate is faster than using the DELETE command, as it does not generate individual row deletion logs.
Truncate also resets any auto-incrementing keys in the table.
Example: TRUNCATE TABLE table_name;
Q171. List some functional interfaces
Functional interfaces in Java are interfaces with a single abstract method, used for lambda expressions.
Consumer
Supplier
Predicate
Function
Q172. Explain Profiles
Profiles in Java are configurations that define the capabilities of a Java platform.
Profiles allow developers to target specific types of devices or applications.
They help in reducing the size of the Java runtime environment by including only the necessary APIs.
Examples include Java SE Embedded Profile for embedded devices and Java SE Compact Profile for resource-constrained environments.
Q173. What is Springboot
Spring Boot is a framework that simplifies the development of Java applications by providing pre-configured settings and tools.
Spring Boot eliminates the need for manual configuration by providing defaults for most settings.
It allows for standalone Spring applications that can be started with a simple 'java -jar' command.
Spring Boot includes embedded servers like Tomcat, Jetty, or Undertow for deploying web applications.
It promotes convention over configuration, reducing the ...read more
Q174. Patch and put difference
Patch and put are HTTP methods used for updating resources on a server.
PATCH is used to partially update a resource, while PUT is used to completely replace a resource.
PATCH requests only include the changes that need to be made, while PUT requests require sending the entire updated resource.
PATCH is often used for incremental updates, while PUT is used for full updates.
Example: PATCH request to update the 'name' field of a user resource, and PUT request to replace the entire...read more
Q175. What is Array ?
An array is a collection of similar type of elements stored in contiguous memory locations.
Arrays can be of primitive data types or objects.
Arrays have a fixed size and can be accessed using an index.
Arrays can be multidimensional.
Example: int[] arr = {1, 2, 3};
Example: String[][] arr = { {"John", "Doe"}, {"Jane", "Doe"} };
Q176. Explain OOPs concepts
OOPs concepts are the foundation of object-oriented programming, including inheritance, encapsulation, polymorphism, and abstraction.
Inheritance: Allows a class to inherit properties and behavior from another class.
Encapsulation: Bundling data and methods that operate on the data into a single unit.
Polymorphism: Ability to present the same interface for different data types.
Abstraction: Hiding the complex implementation details and showing only the necessary features.
Q177. String concept in detail
String is a sequence of characters used to represent text in programming languages.
Strings are immutable in Java, meaning their values cannot be changed once they are created.
Strings can be created using double quotes or by calling the String constructor.
String concatenation can be done using the '+' operator.
Common methods for manipulating strings include length(), charAt(), substring(), toUpperCase(), toLowerCase().
Q178. What is Api gateway
API gateway is a server that acts as an API front-end, receiving API requests, enforcing throttling and security policies, passing requests to the back-end service, and then passing the response back to the requester.
API gateway acts as a single entry point for all API requests
It can handle tasks like authentication, authorization, rate limiting, caching, and request routing
Examples of API gateways include Amazon API Gateway, Apigee, and Kong
Q179. Sorting array of given array
Sorting array of strings
Use Arrays.sort() method to sort the array in ascending order
Use Comparator.reverseOrder() to sort the array in descending order
Implement your own sorting algorithm if required
Q180. Features of java8
Java 8 introduced new features like lambda expressions, streams, default methods, and functional interfaces.
Lambda expressions allow you to write code in a more concise way.
Streams provide a way to work with sequences of elements.
Default methods allow interfaces to have method implementations.
Functional interfaces have a single abstract method and can be used with lambda expressions.
Q181. What is jvm mean is
JVM stands for Java Virtual Machine, which is an abstract computing machine that enables a computer to run Java programs.
JVM is responsible for converting Java bytecode into machine code that can be executed by the computer's operating system.
It provides a platform-independent execution environment for Java programs.
JVM manages memory, handles garbage collection, and provides security features for Java applications.
Q182. Explain about Oops concept
OOPs (Object-Oriented Programming) is a programming paradigm based on the concept of objects, which can contain data and code.
OOPs focuses on creating objects that interact with each other to solve a problem.
Key principles include encapsulation, inheritance, polymorphism, and abstraction.
Encapsulation involves bundling data and methods that operate on the data into a single unit.
Inheritance allows a class to inherit properties and behavior from another class.
Polymorphism allo...read more
Q183. Explain in oops concept
OOPs is a programming paradigm based on the concept of objects.
OOPs stands for Object-Oriented Programming.
It focuses on creating objects that contain both data and functions.
Encapsulation, Inheritance, and Polymorphism are the three main pillars of OOPs.
Java, C++, Python, and Ruby are some of the popular OOPs languages.
Example: A car can be an object with properties like color, model, and functions like start, stop, and accelerate.
Q184. Tell me about java
Java is a popular programming language known for its platform independence and object-oriented approach.
Java is a high-level, class-based, object-oriented programming language.
It is designed to have as few implementation dependencies as possible, making it platform-independent.
Java applications are typically compiled to bytecode that can run on any Java virtual machine (JVM).
Q185. Hash map vs hashMap table
HashMap is non-synchronized and allows null values, while hash table is synchronized and does not allow null values.
HashMap is non-synchronized and not thread-safe, while hash table is synchronized and thread-safe.
HashMap allows null values and one null key, while hash table does not allow null keys or values.
HashMap is generally preferred for non-thread-safe applications, while hash table is used in thread-safe applications.
Q186. Spring boot vs Spring
Spring Boot is a framework that simplifies the development of Spring applications by providing pre-configured settings and conventions.
Spring Boot is opinionated and provides defaults for configuration, reducing the need for manual setup.
Spring Boot includes embedded servers like Tomcat, Jetty, or Undertow, making it easy to deploy standalone applications.
Spring Boot offers a variety of starters to quickly set up common dependencies and configurations.
Spring Boot is ideal for...read more
Q187. Oops concepts explanation
Oops concepts are fundamental principles of object-oriented programming such as inheritance, polymorphism, encapsulation, and abstraction.
Inheritance: Allows a class to inherit properties and behavior from another class.
Polymorphism: Ability of an object to take on many forms.
Encapsulation: Bundling of data with the methods that operate on that data.
Abstraction: Hiding the complex implementation details and showing only the necessary features of an object.
Q188. Life cycle of multi-threading
The life cycle of multi-threading involves the creation, execution, and termination of threads.
Threads are created using the Thread class or by implementing the Runnable interface
Threads can be in various states such as new, runnable, blocked, waiting, timed waiting, or terminated
Thread execution involves the start, run, and sleep methods
Threads can communicate and synchronize using methods like wait, notify, and join
Threads can be terminated using the stop or interrupt metho...read more
Q189. Features of java 8
Java 8 introduced several new features including lambda expressions, functional interfaces, streams, and default methods in interfaces.
Lambda expressions allow you to write code in a more concise and readable way.
Functional interfaces are interfaces with a single abstract method, used for lambda expressions.
Streams provide a way to work with sequences of elements in a functional style.
Default methods in interfaces allow you to add new methods to interfaces without breaking ex...read more
Q190. Explain oops concept
OOPs is a programming paradigm based on the concept of objects that interact with each other.
OOPs stands for Object-Oriented Programming.
It focuses on creating objects that have properties and methods.
Encapsulation, Inheritance, Polymorphism, and Abstraction are the four main pillars of OOPs.
Java, C++, Python, and Ruby are some of the popular OOPs languages.
Example: A car can be an object with properties like color, model, and methods like start, stop, and accelerate.
Q191. OOPs concepts explain
OOPs concepts are the foundation of object-oriented programming, including encapsulation, inheritance, polymorphism, and abstraction.
Encapsulation: Bundling data and methods that operate on the data into a single unit (class).
Inheritance: Allows a class to inherit properties and behavior from another class.
Polymorphism: Ability to present the same interface for different data types.
Abstraction: Hiding the complex implementation details and showing only the necessary features ...read more
Q192. Explain HashSet
HashSet is a collection that does not allow duplicate elements and does not guarantee the order of elements.
HashSet implements the Set interface in Java.
Elements are stored using a hash table.
Addition, removal, and lookup operations have constant time complexity.
Example: HashSet
set = new HashSet<>(); Example: set.add("apple");
Q193. hash map internally
HashMap internally uses an array of linked lists to store key-value pairs.
HashMap uses hashing to determine the index of the key in the array.
If multiple keys hash to the same index, a linked list is used to store them.
HashMap allows one null key and multiple null values.
Example: HashMap
map = new HashMap<>();
More about working at TCS
Top HR Questions asked in iServeU
Interview Process at iServeU
Top Java Developer Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month