eClinicalWorks
10+ NTPC GE Power Services Interview Questions and Answers
Q1. Can we write controller annotation instead of service annotation
No, controller and service annotations serve different purposes in a software application.
Controller annotations are used to define the entry points for incoming requests and map them to specific methods in a controller class.
Service annotations are used to mark a class as a service component that can be injected into other classes for business logic implementation.
Mixing up controller and service annotations can lead to confusion in the application structure and functionalit...read more
Q2. What is difference heap vs stack memory
Heap memory is used for dynamic memory allocation, while stack memory is used for static memory allocation.
Heap memory is allocated at runtime and can be accessed randomly, while stack memory is allocated at compile time and is accessed in a LIFO order.
Heap memory is managed manually by the programmer, while stack memory is managed automatically by the system.
Heap memory is larger in size compared to stack memory, but slower in access speed.
Examples: Dynamic memory allocation...read more
Q3. What === parameter in javascript?
=== is a strict equality operator in JavaScript that checks if two values are equal in type and value.
=== compares two values without type conversion
Returns true if both values are strictly equal, false otherwise
Example: 5 === '5' returns false because they are of different types
Q4. What is immutable class ?
Immutable class is a class whose instances cannot be modified after creation.
Instances of immutable class cannot be changed once created
Immutable classes are often used for objects that should not be modified, like dates or strings
Examples of immutable classes in Java are String, Integer, and LocalDate
Q5. How create immutable class?
Immutable class can be created by making all fields private and final, providing only getters and no setters.
Make all fields private and final
Provide only getters, no setters
Avoid modifying state within the class
Q6. Difference between controller vs restcontroller
Controller is a general term for classes that handle incoming requests, while RestController is specifically for RESTful web services in Spring.
Controller is a general term for classes that handle incoming requests in a web application.
RestController is a specialized version of a controller that is used for creating RESTful web services in Spring framework.
RestController is annotated with @RestController, which combines @Controller and @ResponseBody annotations.
RestController...read more
Q7. What is singleton class
A singleton class is a class that can only have one instance created throughout the entire application.
Singleton classes are often used for logging, driver objects, caching, thread pools, database connections, etc.
They have a private constructor to prevent instantiation from other classes.
They provide a global point of access to the instance.
Q8. Write program for immutable class
Immutable class is a class whose state cannot be modified after creation.
Use final keyword to make class immutable
Make all fields private and final
Do not provide setter methods
Return new instances when modifying state
Q9. What is JSP ?
JSP stands for JavaServer Pages, a technology used for creating dynamic web pages using Java.
JSP allows embedding Java code in HTML pages
It is compiled into servlets by the server before execution
JSP simplifies the process of developing web applications by separating the presentation layer from the business logic
Q10. Write Immutable class program
Immutable class program in Java
Use the 'final' keyword to make class immutable
Make all fields private and final
Do not provide setter methods, only getter methods
Ensure deep copy of mutable objects in constructor or getter methods
Reviews
Interviews
Salaries
Users/Month