CognitivZen Technologies
InstaWeb Labs Interview Questions and Answers
Q1. Difference between Controller and Rest Controller
A Controller is used for handling requests in a web application, while a Rest Controller specifically handles RESTful requests.
A Controller is a component in the MVC architecture that handles user requests and returns a response.
A Rest Controller is a specialized type of Controller that is used for handling RESTful requests.
Rest Controllers are typically used in web services to handle HTTP requests and return JSON or XML responses.
Rest Controllers often use annotations like @...read more
Q2. what is Reflection Api
Reflection API is a feature in Java that allows examining and modifying the behavior of classes, methods, and fields at runtime.
Allows inspecting and modifying classes, methods, and fields at runtime
Provides a way to access metadata about classes and their members
Enables dynamic loading of classes and interfaces
Useful for creating generic code, serialization, and testing frameworks
Q3. Use of application.properties file
The application.properties file is used to store configuration settings for a Java application.
It is a key-value pair file where each line represents a configuration setting.
It is commonly used in Spring Boot applications to configure various properties such as database connection details, server port, logging levels, etc.
The file is typically located in the src/main/resources directory of the project.
Properties can be accessed programmatically using the Spring Environment ob...read more
Q4. Differences between heap and stack memory
Heap memory is used for dynamic memory allocation, while stack memory is used for static memory allocation.
Heap memory is used for storing objects and is managed by the JVM, while stack memory is used for storing method calls and local variables.
Heap memory is larger in size compared to stack memory.
Objects stored in heap memory can be accessed globally, while variables in stack memory are only accessible within the scope of the method.
Example: When you create a new object in...read more
Q5. enhanced version of level 1
The enhanced version of level 1 involves more complex tasks and challenges.
Implement additional features to improve functionality
Optimize code for better performance
Enhance user interface for improved user experience
Q6. What is Polymorphism
Polymorphism is the ability of a single function or method to operate on different types of data.
Polymorphism allows objects of different classes to be treated as objects of a common superclass.
There are two types of polymorphism: compile-time (method overloading) and runtime (method overriding).
Example: Animal superclass with subclasses Dog and Cat. Both Dog and Cat can be treated as Animals.
Q7. Changing the pattern in coding
Changing the pattern in coding involves modifying the structure or design of the code to improve efficiency or functionality.
Identify the current pattern and its limitations
Determine the desired outcome or improvements
Modify the code structure to align with the new pattern
Test the changes to ensure functionality is maintained
More about working at CognitivZen Technologies
Top Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month