Persistent Systems
10+ Parle Elizabeth Tools Interview Questions and Answers
Q1. Request mapping annotation syntax and how and where we use it
Explaining request mapping annotation syntax and usage in Java development
RequestMapping annotation is used to map HTTP requests to specific methods in a controller class
It can be used to specify the URL path, HTTP method, request parameters, headers, and more
Example: @RequestMapping(value = '/users', method = RequestMethod.GET)
This maps a GET request to the '/users' URL path
Q2. Multithreading. Ways of synchronisation. How to handle exceptions.
Multithreading synchronization and exception handling in Java.
Synchronization can be achieved using synchronized keyword, locks, and semaphores.
Exceptions can be handled using try-catch blocks, finally block, and throwing exceptions.
Deadlock can be avoided by acquiring locks in a consistent order.
Thread safety can be ensured by using immutable objects and thread-safe collections.
Examples of thread-safe collections are ConcurrentHashMap and CopyOnWriteArrayList.
Q3. What if there is no server in springboot
Spring Boot is designed to be a standalone application, so it can run without a separate server.
Spring Boot includes an embedded server (like Tomcat or Jetty) so it can run independently.
The embedded server is included in the application's JAR file, making it self-contained.
This allows Spring Boot applications to be easily deployed and run without the need for a separate server installation.
Q4. How to access the Microservice end point
Microservice endpoints can be accessed using HTTP requests with the appropriate URL
Use HTTP methods like GET, POST, PUT, DELETE to interact with the microservice
Construct the URL with the base URL of the microservice and the specific endpoint path
Include any necessary headers or parameters in the request for authentication or data filtering
Q5. OOPs concepts, explain polymorphism, inheritance, etc
Polymorphism is the ability of an object to take on many forms. Inheritance is the process of creating new classes from existing ones.
Polymorphism allows objects of different classes to be treated as objects of a common superclass.
Inheritance allows a class to inherit properties and methods from another class.
Polymorphism and inheritance are key concepts in object-oriented programming (OOP).
Example of polymorphism: A superclass Animal with subclasses Dog, Cat, and Bird. They ...read more
Q6. How do Microservices communicate
Microservices communicate with each other through various communication protocols like HTTP, messaging queues, and gRPC.
Microservices can communicate over HTTP using RESTful APIs.
Messaging queues like RabbitMQ or Kafka can be used for asynchronous communication between microservices.
gRPC is a high-performance, open-source RPC framework that can be used for communication between microservices.
Service discovery mechanisms like Eureka or Consul can help microservices locate and ...read more
Q7. Non repeating characters in a array
Function to find and return all non-repeating characters in an array of strings.
Iterate through the array and count the occurrences of each character using a HashMap.
Then iterate through the array again and check if the count of each character is 1, if so add it to the result list.
Return the list of non-repeating characters.
Q8. find out duplicate element in array?
Use a HashSet to find duplicate elements in an array of strings.
Create a HashSet to store unique elements.
Iterate through the array and check if the element is already in the HashSet.
If it is, then it is a duplicate element.
Example: String[] array = {"apple", "banana", "apple", "orange"};
Q9. Why we use microservices
Microservices allow for modular, scalable, and flexible software development by breaking down applications into smaller, independent services.
Microservices enable easier maintenance and updates as each service can be developed, deployed, and scaled independently.
They improve fault isolation, as failures in one service do not necessarily affect the entire application.
Microservices promote agility and faster time-to-market by allowing teams to work on different services simulta...read more
Q10. what is Custom exception?
Custom exception is a user-defined exception that extends the functionality of the built-in exceptions in Java.
Custom exceptions are created by extending the Exception class or one of its subclasses.
They allow developers to define their own exception types for specific scenarios.
Custom exceptions can include additional methods and fields to provide more information about the exception.
Example: public class CustomException extends Exception { // custom exception code here }
Q11. What is functional programming
Functional programming is a programming paradigm that treats computation as the evaluation of mathematical functions and avoids changing state and mutable data.
Focuses on pure functions that do not have side effects
Emphasizes immutability and avoids changing state
Supports higher-order functions and function composition
Examples include languages like Haskell, Scala, and Clojure
Q12. Internal working of hashmap
HashMap in Java is a data structure that stores key-value pairs and uses hashing to efficiently retrieve values based on keys.
HashMap uses an array of buckets to store key-value pairs.
Keys are hashed to determine the index in the array where the key-value pair will be stored.
In case of hash collisions, a linked list or a balanced tree is used to store multiple key-value pairs in the same bucket.
HashMap allows null keys and values, but only one null key.
Example: HashMap
read more
Q13. Controller vs restcontroller
The main difference is that @RestController is a specialized version of @Controller that is used for RESTful web services.
Both @Controller and @RestController are used in Spring MVC to handle HTTP requests, but @RestController is specifically used for RESTful web services.
@Controller is used to create web pages, while @RestController is used to return data in JSON or XML format.
@RestController is a convenience annotation that combines @Controller and @ResponseBody, making it ...read more
Q14. Oops concepts with examples
OOP concepts include inheritance, encapsulation, polymorphism, and abstraction.
Inheritance: Allows a class to inherit properties and behavior from another class. Example: class Dog extends Animal.
Encapsulation: Bundling data and methods that operate on the data into a single unit. Example: private variables with public getter and setter methods.
Polymorphism: Ability for objects to be treated as instances of their parent class. Example: Animal class with different subclasses l...read more
Q15. What is java how
Java is a high-level programming language known for its portability, security, and object-oriented features.
Java is platform-independent, meaning it can run on any device with a Java Virtual Machine (JVM).
It is object-oriented, allowing for modular and reusable code.
Java is known for its security features like sandboxing and encryption.
Popular Java frameworks include Spring, Hibernate, and JavaFX.
Q16. Qualifier vs primary
A qualifier in Java is used to specify additional information about a primary, which is the main data type or variable.
A primary in Java is the main data type or variable, while a qualifier provides additional information about the primary.
Qualifiers can be used to modify the behavior or characteristics of a primary.
For example, in Java, 'final' is a qualifier that can be used to make a variable constant.
Interview Process at Parle Elizabeth Tools
Top Java Developer Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month