web tech banner

Web Technology Multiple Choice Questions (MCQs) and Answers

Master Web Technology with Practice MCQs. Explore our curated collection of Multiple Choice Questions. Ideal for placement and interview preparation, our questions range from basic to advanced, ensuring comprehensive coverage of Web Technology concepts. Begin your placement preparation journey now!

Q61

Q61 Which CSS property is used to make an image responsive?

A

max-width

B

position

C

flex

D

float

Q62

Q62 How do you implement a flexible grid using CSS?

A

display: block;

B

display: grid;

C

display: flex;

D

display: inline-flex;

Q63

Q63 Why might a responsive layout not adapt properly on smaller screens?

A

Missing meta viewport tag

B

Fixed-width elements

C

Incorrect media query syntax

D

Large image sizes

Q64

Q64 A navigation bar overflows on smaller screens. What could be the cause?

A

Excessive padding

B

Improper CSS flex properties

C

Fixed dimensions

D

Invalid HTML structure

Q65

Q65 Why might flexbox-based layouts break on older browsers?

A

Flex properties not supported

B

Incorrect syntax

C

CSS file not linked

D

Incompatible images

Q66

Q66 Which of the following frameworks uses a virtual DOM for performance optimization?

A

Angular

B

React

C

Vue

D

All of the above

Q67

Q67 What is the primary difference between Angular and React?

A

Angular is a library, React is a framework

B

Angular uses two-way binding, React uses one-way binding

C

React supports TypeScript, Angular does not

D

Angular does not use components

Q68

Q68 Which of the following features is unique to Vue.js?

A

JSX support

B

Directives like v-bind

C

Component lifecycle hooks

D

Virtual DOM

Q69

Q69 Which framework uses a hierarchical dependency injection system?

A

React

B

Angular

C

Vue

D

None of the above

Q70

Q70 What is the correct syntax for creating a functional component in React?

A

function MyComponent() { return <h1>Hello</h1>; }

B

def MyComponent() { <h1>Hello</h1>; }

C

function MyComponent => { return <h1>Hello</h1>; }

D

createComponent MyComponent { <h1>Hello</h1>; }

Q71

Q71 How do you bind a class conditionally in Vue.js?

A

class="isActive"

B

:class="{ active: isActive }"

C

v-class="{ active: isActive }"

D

bind-class="active"

Q72

Q72 What is the correct syntax to define a two-way data binding in Angular?

A

[ng-model]="data"

B

[(ngModel)]="data"

C

{ngModel: data}

D

bind="data"

Q73

Q73 A React component fails to update its state. What could be the issue?

A

State mutation

B

Improper setState usage

C

Undefined state variable

D

Component lifecycle mismatch

Q74

Q74 Why might a Vue.js app fail to display data bindings?

A

Missing el property

B

Incorrect Vue instance syntax

C

Improper use of directives

D

Unregistered components

Q75

Q75 Why might Angular’s ngModel directive not work as expected?

A

Missing FormsModule import

B

Incorrect two-way binding syntax

C

Component template error

D

Uninitialized variables

Q76

Q76 What does AJAX stand for?

A

Asynchronous JavaScript and XML

B

Advanced Java Application

C

Automatic Java API XML

D

Asynchronous Java Action XML

Q77

Q77 Which HTTP method is typically used in AJAX requests to send data to the server?

A

GET

B

POST

C

PUT

D

DELETE

Q78

Q78 What is a key difference between AJAX and the Fetch API?

A

Fetch is synchronous

B

Fetch supports Promises

C

AJAX is browser-compatible

D

AJAX does not support XML

Q79

Q79 Why might you prefer Fetch API over XMLHttpRequest in modern web applications?

A

Simplified syntax

B

Promise-based architecture

C

Supports JSON natively

D

All of the above

Q80

Q80 Which is the correct syntax to make a GET request using Fetch API?

A

fetch('url').then(response => response.json());

B

fetch('url', method: 'GET').done(data);

C

GET.fetch('url').success(data => data.json());

D

fetch.get('url').json();

Q81

Q81 How do you send JSON data in a POST request using Fetch API?

A

fetch('url', { method: 'POST', data: JSON.stringify(obj) });

B

fetch('url', { method: 'POST', body: JSON.stringify(obj) });

C

fetch.post('url', { body: obj });

D

fetch('url').post(JSON.stringify(obj));

Q82

Q82 How can you include custom headers in a Fetch request?

A

fetch('url', { headers: { 'Content-Type': 'application/json' } });

B

fetch.setHeaders({ 'Content-Type': 'application/json' });

C

fetch.headers({ 'Content-Type': 'application/json' });

D

fetch('url').headers = { 'Content-Type': 'application/json' };

Q83

Q83 Why might an AJAX request fail to fetch data?

A

Incorrect URL

B

CORS error

C

Network issues

D

Invalid HTTP method

Q84

Q84 A Fetch API request throws a "TypeError: Failed to fetch" error. What could be the reason?

A

Network connectivity issues

B

CORS restrictions

C

Invalid URL

D

Timeout configuration issues

Q85

Q85 Why might a JSON response from a Fetch API request not parse correctly?

A

Invalid JSON format

B

Incorrect response headers

C

Syntax errors in JSON

D

Response is empty

Q86

Q86 What is the primary purpose of server-side scripting?

A

To handle database interactions

B

To design UI

C

To style web pages

D

To validate client data

Q87

Q87 Which of the following is a server-side scripting language?

A

JavaScript

B

HTML

C

PHP

D

CSS

Q88

Q88 What is the primary function of Node.js?

A

To serve static files

B

To execute JavaScript on the server

C

To style content

D

To handle web hosting

Q89

Q89 What is a middleware in server-side scripting?

A

A database connection

B

A function handling requests and responses

C

A static file

D

A client-side library

Q90

Q90 How does server-side rendering differ from client-side rendering?

A

It renders content dynamically in the browser

B

It improves SEO by rendering content on the server

C

It reduces server load

D

It only works offline

ad verticalad vertical
ad