Hard Coded
Corel Pharma Chem Interview Questions and Answers
Q1. What is singleton pattern. Where and how have you used it.
Singleton pattern ensures a class has only one instance and provides a global point of access to it.
Used to control access to a shared resource such as a database connection or a logger instance
Implemented by creating a class with a method that creates a new instance only if one doesn't exist, and returns the existing instance if it does
Commonly used in React applications for managing global state with Redux or Context API
Q2. What is strategy pattern based on real time usecase, where and how have you used it.
Strategy pattern is a behavioral design pattern that allows selecting an algorithm at runtime.
Used strategy pattern in a shopping cart application to dynamically apply different discount strategies based on user type (e.g. regular customer, premium customer)
Implemented strategy pattern in a payment processing system to handle different payment methods (e.g. credit card, PayPal, Apple Pay)
Utilized strategy pattern in a traffic management system to dynamically switch between di...read more
Q3. What is virtual dom. In reactjs.
Virtual DOM is a lightweight copy of the actual DOM in React, used for efficient updates.
Virtual DOM is a concept where a lightweight copy of the actual DOM is created in memory.
React uses the virtual DOM to efficiently update the actual DOM when there are changes in the application state.
By comparing the virtual DOM with the actual DOM, React determines the minimal number of changes needed to update the UI.
This helps in improving performance by reducing the number of DOM man...read more
Q4. What are benefits of using scss.
SCSS provides benefits such as variables, nesting, mixins, and inheritance for more efficient and maintainable CSS code.
Variables allow for easy reuse of values throughout stylesheets.
Nesting helps to organize CSS rules in a more intuitive way.
Mixins enable the reuse of styles across different elements.
Inheritance allows styles to be inherited from one selector to another.
SCSS can help improve code readability and maintainability.
Q5. What is dependency injection.
Dependency injection is a design pattern where components are provided with their dependencies rather than creating them internally.
Dependency injection helps in making components more modular and easier to test.
It allows for better separation of concerns by decoupling the creation of dependencies from their usage.
There are different types of dependency injection such as constructor injection, setter injection, and interface injection.
Example: In React, dependency injection c...read more
Q6. What is flexbox used for.
Flexbox is a layout model in CSS used for creating flexible and responsive layouts.
Flexbox allows for easy alignment and distribution of items within a container.
It provides a more efficient way to design complex layouts compared to traditional CSS methods.
Flexbox properties include justify-content, align-items, flex-direction, and flex-wrap.
Reviews
Interviews
Salaries
Users/Month