[go: up one dir, main page]

0% found this document useful (0 votes)
25 views12 pages

WT and OOPs Interview Question Updated

Uploaded by

ashish13057kp
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views12 pages

WT and OOPs Interview Question Updated

Uploaded by

ashish13057kp
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 12

NOIDA INSTITUTE OF ENGINEERING AND TECHNOLOGY

GREATER NOIDA-201306
(An Autonomous Institute)
School of Computer Science in Emerging Technologies

Department of CSE (Artificial Intelligence)


(Session 2024-25)
Web Tech Interview Question

1. TCS (Tata Consultancy Services)

Question: What is the difference between HTML and HTML5?

Explanation: HTML5 is the latest version of HTML, introducing new elements,


attributes, and behaviors, including support for multimedia, semantic elements, and
improved performance.

2. Infosys

Question: Explain the CSS Box Model and its components.

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

Question: How does JavaScript handle asynchronous code? Give an example.

Explanation: JavaScript handles asynchronous code using callbacks, promises, and


async/await, allowing non-blocking operations, such as fetching data from a server.
4. HCL Technologies

Question: What is AJAX, and how does it work in web applications?

Explanation: AJAX (Asynchronous JavaScript and XML) allows web pages to be


updated asynchronously by exchanging small amounts of data with the server behind the
scenes.

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

Question: What is the Document Object Model (DOM) in web development?

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.

8. L&T Infotech (LTI)

Question: What is the difference between localStorage and sessionStorage in JavaScript?


Explanation: localStorage stores data with no expiration time, while sessionStorage
stores data for the duration of the page session.

9. Mphasis

Question: How do you optimize a website for performance?

Explanation: Website optimization includes techniques such as minimizing HTTP


requests, using asynchronous loading for CSS and JavaScript, optimizing images,
leveraging browser caching, and using content delivery networks (CDNs).

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.

12. HCL Technologies

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

Question: How do you handle Cross-Browser Compatibility issues in web development?

Explanation: Handling cross-browser compatibility involves using standardized code,


CSS resets, browser developer tools, and testing across different browsers.

14. Wipro

Question: What is a CDN, and why is it important in web development?

Explanation: A Content Delivery Network (CDN) is a network of servers that deliver


web content to users based on their geographic location, improving load times and
reducing bandwidth costs.

15. Infosys

Question: How can you ensure web security during development?

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.

16. Tech Mahindra

Question: What is Bootstrap, and how does it help in web development?

Explanation: Bootstrap is a popular front-end framework that provides pre-designed


HTML, CSS, and JavaScript components for building responsive, mobile-first websites.

17. Tata Elxsi

Question: Explain the role of a Web Server in web development.

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 is JSON, and how is it used in web applications?

Explanation: JSON (JavaScript Object Notation) is a lightweight data-interchange format


that is easy for humans to read and write and easy for machines to parse and generate,
commonly used for transmitting data in web applications.

19. L&T Infotech (LTI)

Question: What are the advantages of using Single Page Applications (SPA)?

Explanation: SPAs provide a better user experience by loading content dynamically


without refreshing the entire page, leading to faster interactions and seamless transitions.

20. HCL Technologies

Question: What is WebSocket, and how does it differ from HTTP?

Explanation: WebSocket is a communication protocol that provides full-duplex


communication channels over a single TCP connection, enabling real-time data transfer,
unlike the request-response model of HTTP.

21. Zensar Technologies

Question: How do you handle error handling in JavaScript?

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

Question: What is the role of a Frontend Framework in web development?


Explanation: Frontend frameworks like Angular, React, and Vue provide a structured
approach to building dynamic user interfaces with reusable components, state
management, and efficient rendering.

23. Capgemini

Question: How do you manage state in a web application?

Explanation: State management can be handled through client-side techniques like


localStorage, sessionStorage, cookies, and frontend frameworks' state management
systems like Redux (for React).

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

Question: What is the difference between synchronous and asynchronous programming in


JavaScript?

Explanation: Synchronous programming executes code sequentially, blocking further


execution until the current operation completes, whereas asynchronous programming
allows the execution of other tasks while waiting for an operation to complete.
OOPs Interview Question
1. TCS (Tata Consultancy Services)

Question: What are the four main principles of Object-Oriented Programming?

Explanation: The four main principles are Encapsulation, Abstraction, Inheritance, and
Polymorphism.

2. Infosys

Question: Explain the concept of Encapsulation with an example.

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

Question: What is Inheritance in OOP, and how is it implemented in Java?

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

Question: What is Polymorphism in OOP? Provide an example.

Explanation: Polymorphism allows objects to be treated as instances of their parent class.


It can be achieved through method overriding (runtime polymorphism) or method
overloading (compile-time polymorphism).
5. Tech Mahindra

Question: Can you explain what Abstraction is in OOP?

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

Question: What is a Constructor in OOP, and what is its purpose?

Explanation: A constructor is a special type of method that is automatically called when


an instance of a class is created. It initializes the new object.

7. Mindtree

Question: What is the difference between a Class and an Object in OOP?

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.

8. L&T Infotech (LTI)

Question: Explain the concept of Method Overloading and Method Overriding.

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

Question: What is the significance of the this keyword in OOP?

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

Question: How does the concept of super work in Java OOP?

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.

12. HCL Technologies

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.

13. Zensar Technologies

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

Question: What is the significance of the final keyword in OOP?

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

Question: What is the concept of a Singleton Class in OOP?

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.

16. Tech Mahindra

Question: Explain the concept of Aggregation and Composition in OOP.

Explanation: Aggregation is a relationship where one class is a collection or container of


other classes, without strong ownership. Composition is a stronger relationship where the
contained classes cannot exist independently of the container class.

17. Tata Elxsi

Question: What is the purpose of an Abstract Class in OOP?

Explanation: An abstract class cannot be instantiated on its own and is meant to be


subclassed. It can have both abstract methods (without implementation) and concrete
methods (with implementation).

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.

19. L&T Infotech (LTI)

Question: How does exception handling work in OOP, particularly in Java?

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.

20. HCL Technologies

Question: What is Multiple Inheritance, and how is it handled in Java?

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.

21. Zensar Technologies

Question: Explain the concept of a copy constructor in OOP.

Explanation: A copy constructor is a special constructor in a class that is used to create a


new object as a copy of an existing object.

22. Hexaware

Question: What is meant by Object Cloning in OOP?

Explanation: Object Cloning refers to creating a duplicate of an object. This is typically


done using the clone() method in Java, which creates a shallow copy of the object.
23. Capgemini

Question: How does memory management work in OOP, especially in Java?

Explanation: Java manages memory using an automatic garbage collector, which


reclaims memory used by objects that are no longer accessible or needed by the program.

24. Mphasis

Question: What is the role of the instanceof operator in Java OOP?

Explanation: The instanceof operator is used to test whether an object is an instance of a


specific class or subclass.

25. Infosys

Question: Explain the relationship between UML (Unified Modeling Language) and
OOP.

Explanation: UML is a standardized modeling language used to visualize, specify, and


document the design of object-oriented systems. It includes various diagrams like class
diagrams, sequence diagrams, and use case diagrams.

You might also like