Persistent Systems
20+ Lions Hospital Interview Questions and Answers
Q1. What is oop, Will sorting the list for finding two lowest elements in list be an optimal solution, what are ACID properties
OOP stands for Object-Oriented Programming. Sorting the list for finding two lowest elements may not be optimal. ACID properties are atomicity, consistency, isolation, and durability.
OOP is a programming paradigm based on the concept of objects, which can contain data in the form of fields and code in the form of procedures.
Sorting the list to find two lowest elements may not be optimal as it has a time complexity of O(n log n). A more efficient solution would be to iterate t...read more
Q2. What is dependency Injection, how can we implement multiple interference?
Dependency Injection is a design pattern where components are given their dependencies rather than creating them internally.
Dependency Injection helps in making components more modular, testable, and reusable.
It can be implemented using constructor injection, setter injection, or interface injection.
Multiple inheritance can be implemented in languages like C++ using virtual inheritance to avoid the diamond problem.
Q3. What is Oopps? Concept of polmorphism.
OOPs stands for Object-Oriented Programming. Polymorphism is the ability of an object to take on many forms.
OOPs is a programming paradigm that focuses on objects and their interactions.
Polymorphism allows objects of different classes to be treated as if they are of the same class.
There are two types of polymorphism: compile-time and runtime.
Compile-time polymorphism is achieved through method overloading.
Runtime polymorphism is achieved through method overriding.
Example of p...read more
Q4. How our microservices are communicate with each other
Microservices communicate with each other through APIs and message queues.
Microservices use APIs to send and receive data between each other.
They can also utilize message queues for asynchronous communication.
APIs can be RESTful or use other protocols like gRPC.
Message queues like RabbitMQ or Kafka enable decoupled communication.
Microservices can also use events or pub/sub patterns for communication.
Q5. What is abstract class Difference between final,finally finalize Different types of polymorphism
Abstract class is a class that cannot be instantiated and may contain abstract methods.
Abstract class cannot be instantiated directly.
It may contain abstract methods that must be implemented by the subclass.
Example: abstract class Shape { abstract void draw(); }
Q6. what is inheritance and its type?
Inheritance is a concept in object-oriented programming where a class inherits properties and behaviors from another class.
Inheritance allows for code reuse and promotes modularity.
There are different types of inheritance: single, multiple, multilevel, and hierarchical.
Example: A 'Car' class can inherit properties and behaviors from a 'Vehicle' class.
Q7. AOT vs JIT compiler, Agile methodology
AOT and JIT compilers are used to compile code, while Agile methodology is a project management approach.
AOT (Ahead of Time) compiler compiles code before it is executed, while JIT (Just in Time) compiler compiles code during runtime.
AOT is used in languages like C++, while JIT is used in languages like Java.
Agile methodology is a project management approach that emphasizes on iterative development, continuous feedback, and collaboration.
Agile methodology is used in software ...read more
Q8. What is OOPs, What are OOPs pillers?
OOPs stands for Object-Oriented Programming. The pillars of OOPs are Inheritance, Encapsulation, Abstraction, and Polymorphism.
OOPs is a programming paradigm based on the concept of objects, which can contain data in the form of fields and code in the form of procedures.
The four pillars of OOPs are Inheritance, Encapsulation, Abstraction, and Polymorphism.
Inheritance allows a class to inherit properties and behavior from another class.
Encapsulation refers to the bundling of d...read more
Q9. Write a program to demonstrate virtual function
A program demonstrating virtual function in C++
Create a base class with a virtual function
Create derived classes that override the virtual function
Instantiate objects of derived classes and call the virtual function
Q10. One question to convert 1nf to 2nf
To convert 1NF to 2NF, identify partial dependencies and move them to separate tables.
Identify the primary key in the 1NF table
Identify any non-key attributes that are dependent on only part of the primary key
Move these attributes to a new table with a composite key including the partial key and the original primary key
Q11. diff between c#, Asp.net and mvc
C# is a programming language, ASP.NET is a web framework, and MVC is a design pattern for building web applications.
C# is used to write code for various applications, including web applications.
ASP.NET is a web framework that provides tools and libraries for building web applications.
MVC is a design pattern that separates an application into three components: Model, View, and Controller.
ASP.NET MVC is a web framework that uses the MVC pattern to build web applications using C...read more
Q12. Reverse a number in a given string
Reverse a number in a given string
Iterate through the string and identify numbers
Reverse the identified numbers
Join the reversed numbers back to the original string
Q13. What is encapsulation
Encapsulation is the concept of bundling data and methods that operate on the data into a single unit.
Encapsulation helps in hiding the internal state of an object and restricting access to it.
It allows for better control over the data by preventing direct access from outside the class.
Encapsulation also helps in achieving data abstraction, where the internal details are hidden and only the necessary information is exposed.
Example: In a class representing a bank account, the ...read more
Q14. What is oops concepts?
Object-oriented programming concepts that focus on objects and classes to organize code and improve reusability and maintainability.
Encapsulation: Bundling data and methods that operate on the data into a single unit (class).
Inheritance: Ability of 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 featur...read more
Q15. What is garbage collection ?
Garbage collection is a process in programming where the system automatically reclaims memory occupied by objects that are no longer in use.
Garbage collection helps in managing memory efficiently by automatically deallocating memory that is no longer needed.
It reduces the risk of memory leaks and helps in preventing bugs related to manual memory management.
Examples of programming languages with garbage collection include Java, C#, and Python.
Q16. Summation of numbers in an IntStream
Summation of numbers in an IntStream
Use the 'sum()' method on the IntStream to calculate the sum of numbers
Ensure the IntStream is properly initialized with numbers before calling 'sum()'
Example: IntStream numbers = IntStream.of(1, 2, 3, 4, 5); int sum = numbers.sum();
Q17. Why persistent systems pvt ltd
Persistent Systems Pvt Ltd is known for its innovative solutions, strong work culture, and opportunities for growth.
Strong reputation for delivering innovative solutions
Positive work culture that fosters growth and learning
Opportunities for career advancement and skill development
Global presence with diverse projects and clients
Q18. What is a comparator?
A comparator is a function that compares two objects to determine their ordering.
Used in sorting algorithms to determine the order of elements
Returns a negative value if the first object is less than the second, zero if they are equal, and a positive value if the first object is greater
Commonly used in Java with the Comparator interface
Q19. what is reentrant lock?
A reentrant lock is a synchronization primitive that allows a thread to re-enter a critical section it already holds.
Prevents deadlock by allowing a thread to acquire the lock multiple times
Each lock acquisition must be followed by a corresponding release
Commonly used in multi-threaded programming to protect shared resources
Q20. string vs stringbuffer vs stringbuilder
String, StringBuffer, and StringBuilder are classes in Java used for manipulating strings.
String is immutable, meaning its value cannot be changed once created.
StringBuffer is mutable and thread-safe, making it suitable for multi-threaded environments.
StringBuilder is also mutable but not thread-safe, providing better performance in single-threaded scenarios.
Q21. what is sql injection
SQL injection is a type of cyber attack where malicious SQL code is inserted into input fields to manipulate a database.
SQL injection occurs when a user input is not properly sanitized and allows an attacker to execute malicious SQL commands.
It can lead to unauthorized access to sensitive data, data loss, and even complete server takeover.
Example: Entering ' OR '1'='1' into a login form to bypass authentication and gain access to the system.
Q22. Hashmap working internal details
Hashmap is a data structure that stores key-value pairs and uses hashing to map keys to values.
Hashmap uses hashing function to determine the index of the key in the underlying array.
Collision handling is done by chaining or open addressing.
Hashmap provides constant time complexity O(1) for insertion, deletion, and retrieval.
Example: HashMap
map = new HashMap<>(); map.put("key", 123); int value = map.get("key");
Q23. What is 1 nf 2nf
1NF and 2NF are normalization forms in database design to reduce redundancy and improve data integrity.
1NF (First Normal Form) ensures that each column in a table contains atomic values and there are no repeating groups.
2NF (Second Normal Form) builds on 1NF by ensuring that all non-key attributes are fully functional dependent on the primary key.
For example, if we have a table 'Orders' with columns 'OrderID', 'ProductID', 'ProductName', and 'ProductPrice', we can normalize i...read more
Q24. what is polymorphism
Polymorphism is the ability of an object to take on many forms. It allows objects of different classes to be treated as the same type.
Polymorphism is a fundamental concept in object-oriented programming.
It enables code reusability and flexibility.
Polymorphism can be achieved through method overriding and method overloading.
Example: A parent class Animal can have multiple child classes like Dog, Cat, and Bird. They can all be treated as Animals.
Polymorphism allows for the use ...read more
Q25. multithreading working in java
Multithreading is a concept in Java that allows concurrent execution of multiple threads.
Multithreading improves performance by utilizing multiple threads to execute tasks concurrently.
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.
Synchronization mechanisms like locks and semaphores can be used to control access to shared resources.
Th...read more
Q26. Merge sort algorithm working
Merge sort is a divide and conquer algorithm that divides the input array into two halves, sorts them recursively, and then merges the sorted halves.
Divide the input array into two halves
Recursively sort the two halves
Merge the sorted halves back together
Q27. Define SOLID Principles
SOLID principles are a set of five design principles that help make software designs more understandable, flexible, and maintainable.
Single Responsibility Principle (SRP) - A class should have only one reason to change.
Open/Closed Principle (OCP) - Software entities should be open for extension but closed for modification.
Liskov Substitution Principle (LSP) - Objects of a superclass should be replaceable with objects of its subclasses without affecting the functionality.
Inter...read more
Q28. design a website
A modern and user-friendly e-commerce website for selling clothing and accessories.
Create a visually appealing homepage with featured products
Include easy navigation and search functionality
Implement secure payment gateways for online transactions
Allow users to create accounts and track their orders
Optimize for mobile responsiveness and fast loading times
Interview Process at Lions Hospital
Top Software Developer Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month