WT and OOPs Interview Question Updated
WT and OOPs Interview Question Updated
GREATER NOIDA-201306
(An Autonomous Institute)
School of Computer Science in Emerging Technologies
2. Infosys
Explanation: The CSS Box Model consists of margins, borders, padding, and the actual
content. It defines how these elements are structured and displayed.
3. Wipro
5. Tech Mahindra
Question: Explain the concept of Responsive Web Design and how it is achieved.
Explanation: Responsive Web Design is an approach to web design that makes web
pages render well on a variety of devices and window or screen sizes using flexible grids,
layouts, images, and CSS media queries.
6. Cognizant
Question: What are RESTful Web Services, and how do they work?
Explanation: RESTful Web Services use HTTP methods (GET, POST, PUT, DELETE)
for CRUD operations. They follow the principles of REST (Representational State
Transfer) to provide interoperability between computer systems on the internet.
7. Mindtree
Explanation: The DOM is a programming interface for web documents. It represents the
page so that programs can change the document structure, style, and content.
9. Mphasis
10. Hexaware
Question: What are CSS Preprocessors, and why are they used?
Explanation: CSS preprocessors like SASS and LESS add advanced features to CSS,
such as variables, nested rules, and functions, which make CSS more maintainable and
extendable.
11. Capgemini
Question: What are HTTP Cookies, and how do they work in web development?
Explanation: HTTP Cookies are small pieces of data stored on the client’s browser that
are sent back to the server with every request, used for session management, user
authentication, and tracking user behavior.
Question: What is the difference between GET and POST methods in HTTP?
Explanation: GET requests data from a specified resource and appends data to the URL,
while POST submits data to be processed to a specified resource and is used when dealing
with sensitive or large amounts of data.
13. Zensar Technologies
14. Wipro
15. Infosys
Explanation: Ensuring web security involves practices like input validation, using
HTTPS, implementing Content Security Policy (CSP), and protecting against SQL
injection, XSS, and CSRF attacks.
Explanation: A web server processes incoming network requests over HTTP and several
other related protocols, delivering web pages to users in response to their requests.
18. Mindtree
Question: What are the advantages of using Single Page Applications (SPA)?
Explanation: Error handling in JavaScript can be managed using try, catch, finally
blocks, and custom error messages, ensuring that unexpected errors are gracefully
managed.
22. Hexaware
23. Capgemini
24. Mphasis
Question: What are Meta Tags in HTML, and why are they important?
Explanation: Meta tags provide metadata about the HTML document, such as
description, keywords, author, and viewport settings, which are crucial for SEO and
controlling how pages are rendered.
25. Infosys
Explanation: The four main principles are Encapsulation, Abstraction, Inheritance, and
Polymorphism.
2. Infosys
Explanation: Encapsulation is the bundling of data with the methods that operate on that
data. For example, a class BankAccount can have private variables like balance and
methods like deposit() and withdraw() that modify the balance.
3. Wipro
Explanation: Inheritance is the mechanism by which one class (child class) inherits the
properties and behaviors (methods) of another class (parent class). In Java, it is
implemented using the extends keyword.
4. HCL Technologies
Explanation: Abstraction is the concept of hiding the complex implementation details and
showing only the essential features of an object. This can be achieved using abstract
classes and interfaces in languages like Java.
6. Cognizant
7. Mindtree
Explanation: A class is a blueprint for creating objects (instances), which define the
properties and behaviors. An object is an instance of a class, with its own specific values
for the properties defined by the class.
Explanation: Method Overloading is defining multiple methods with the same name but
different parameters within the same class. Method Overriding is redefining a method in a
subclass that already exists in the parent class.
9. Mphasis
Question: What is an Interface in OOP, and how is it different from an Abstract Class?
Explanation: An interface is a contract that defines a set of methods that implementing
classes must provide. Unlike abstract classes, interfaces cannot have any method
implementations, and a class can implement multiple interfaces.
10. Hexaware
Explanation: The this keyword refers to the current object instance. It is used to avoid
naming conflicts between instance variables and parameters, and to refer to the current
object within a method or constructor.
11. Capgemini
Explanation: The super keyword in Java is used to refer to the parent class’s members
(variables and methods) and to call the parent class’s constructor.
Question: What are access specifiers in OOP, and what are the different types available in
Java?
Explanation: Access specifiers control the visibility of class members. In Java, the main
access specifiers are private, default (no modifier), protected, and public.
Question: Explain the difference between static and non-static methods in OOP.
Explanation: Static methods belong to the class rather than any instance, meaning they
can be called without creating an object of the class. Non-static methods, however, require
an object instance to be called.
14. Wipro
Explanation: The final keyword can be applied to variables, methods, and classes in Java.
A final variable’s value cannot be changed, a final method cannot be overridden, and a
final class cannot be subclassed.
15. Infosys
Explanation: A Singleton Class is a design pattern where only one instance of the class
can exist. This is often achieved by making the constructor private and providing a static
method to get the instance.
18. Mindtree
Question: What is the difference between deep copy and shallow copy in OOP?
Explanation: A shallow copy copies an object’s reference, while a deep copy creates a
new object and recursively copies all objects it references, thus duplicating the entire
structure.
Explanation: Exception handling in Java is managed through the use of try, catch, finally,
and throw blocks. It helps to gracefully handle runtime errors and maintain normal
application flow.
Explanation: Multiple Inheritance refers to a class inheriting from more than one class.
Java does not support multiple inheritance through classes due to ambiguity issues, but it
can be achieved using interfaces.
22. Hexaware
24. Mphasis
25. Infosys
Question: Explain the relationship between UML (Unified Modeling Language) and
OOP.