Oracle Cerner
Purchasing Power Interview Questions and Answers
Q1. What is meant by function overloading and function overriding?
Function overloading is when multiple functions have the same name but different parameters. Function overriding is when a subclass provides its own implementation of a method that is already present in the parent class.
Function overloading is used to provide multiple ways to call a function with different parameters.
Function overriding is used to provide a specific implementation of a method in a subclass.
Function overloading is resolved at compile-time based on the number a...read more
Q2. What is meant by closure in javascript?
Closure is a function that has access to its parent scope, even after the parent function has closed.
Closure is created when a function is defined inside another function.
The inner function has access to the outer function's variables and parameters.
The outer function returns the inner function, which can be called later with the parent scope still accessible.
Closures are used for data privacy, event handlers, and callbacks.
Q3. What is abstract class in javascript?
There is no abstract class in JavaScript.
JavaScript does not have a built-in abstract class concept.
However, it is possible to create abstract classes using functions and prototypes.
Abstract classes are used as blueprints for other classes to inherit from.
They cannot be instantiated on their own and must be extended by a subclass.
Abstract methods can be defined in the abstract class and must be implemented in the subclass.
Q4. Algorithm to convert roman numeral to numbers?
Algorithm to convert roman numeral to numbers
Create a dictionary to map roman numerals to their corresponding values
Iterate through the roman numeral string from right to left
If the current value is less than the previous value, subtract it from the total
If the current value is greater than or equal to the previous value, add it to the total
Return the total
Q5. What is React Context?
React Context is a feature in React that allows data to be passed down the component tree without having to pass props manually.
Context provides a way to share values like themes, user data, etc. across the component tree.
It avoids prop drilling, where props are passed down multiple levels to reach a component that needs them.
Context consists of two parts: a Provider component that provides the data and a Consumer component that consumes the data.
Context can be used with the ...read more
Q6. Implement counter in react app
Implement a counter in a React app
Create a state variable to hold the count
Render the count in the UI
Add buttons to increment and decrement the count
Update the state variable on button click
Top SDE-2 Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month