2023 question paper
Web Technology
26 questions
Q1a. Which of the following tag is used to embed CSS in HTML page? (i) <css> (ii) <!DOCTYPE html> (iii) <script> (iv) <style>20232m
Module I: Introduction to Web Technologies & Architectures
View this question on its own page →Which of the following tag is used to embed CSS in HTML page?
(i) <css>
(ii) <!DOCTYPE html>
(iii) <script>
(iv) <style>Worked SolutionAnswer
(iv)
<style>Step-by-step
- Embedded/Internal CSS means CSS written inside the HTML document.
- HTML provides the
<style>element specifically for containing CSS rules. <css>is not a standard HTML element.<!DOCTYPE html>declares the HTML document type.<script>is used for JavaScript.
Example
<style> p { color: blue; } </style>Final answer: (iv)
<style>Q1b. Which of the following is not a web server? (i) Apache Tomcat (ii) BlueGriffon (iii) Jetty (iv) Tornado20232m
Module II: Browser & Apache Web Server Architecture; Common Protocols
View this question on its own page →Which of the following is not a web server?
(i) Apache Tomcat
(ii) BlueGriffon
(iii) Jetty
(iv) TornadoWorked SolutionAnswer
(ii) BlueGriffon
Explanation
- Apache Tomcat, Jetty, and Tornado are web/server technologies used to serve web applications.
- BlueGriffon is a WYSIWYG web-page editor, not a web server.
Final answer: (ii) BlueGriffon
Q1c. Which of the following are automatically loaded and operate as a part of the browser? (i) Add-ons (ii) Plug-ins (iii) Utilities (iv) Widgets20232m
Module II: Browser & Apache Web Server Architecture; Common Protocols
View this question on its own page →Which of the following are automatically loaded and operate as a part of the browser?
(i) Add-ons
(ii) Plug-ins
(iii) Utilities
(iv) WidgetsWorked SolutionAnswer
(ii) Plug-ins
Explanation
Browser plug-ins extend browser functionality and, in the terminology used by this question, operate as components of the browser environment. Add-ons are broader browser extensions, while utilities and widgets are not the intended answer.
Final answer: (ii) Plug-ins
Q1d. A characteristic of a file server is which of the following? (i) Acts as a fat client and is limited to one PC (ii) Manages file operations and is limited to one PC (iii) Acts as a fat client and is shared on a network (iv) Manages file operations and is shared on a network20232m
Module II: Browser & Apache Web Server Architecture; Common Protocols
View this question on its own page →A characteristic of a file server is which of the following?
(i) Acts as a fat client and is limited to one PC
(ii) Manages file operations and is limited to one PC
(iii) Acts as a fat client and is shared on a network
(iv) Manages file operations and is shared on a networkWorked SolutionAnswer
(iv) Manages file operations and is shared on a network
Step-by-step
- A file server centrally stores and manages files.
- Clients on a network request files from the server.
- Therefore, file operations are managed centrally.
- A file server is intended to be accessible over a network, not restricted to one PC.
Final answer: (iv)
Q1e. Which of the following is the correct syntax for adding an external style sheet? (i) <style href='main.css'></style> (ii) <style src='main.css'></style> (iii) <link rel='stylesheet' type='text/css' src='main.css'> (iv) <link rel='stylesheet' type='text/css' href='main.css'>20232m
Module I: Introduction to Web Technologies & Architectures
View this question on its own page →Which of the following is the correct syntax for adding an external style sheet?
(i) <style href='main.css'></style>
(ii) <style src='main.css'></style>
(iii) <link rel='stylesheet' type='text/css' src='main.css'>
(iv) <link rel='stylesheet' type='text/css' href='main.css'>Worked SolutionAnswer
(iv)
<link rel='stylesheet' type='text/css' href='main.css'>Step-by-step
- An external stylesheet is attached with the HTML
<link>element. rel="stylesheet"identifies the linked resource as a stylesheet.href="main.css"specifies the CSS file location.srcis not the attribute used by<link>for the stylesheet URL.
Example
<link rel="stylesheet" href="main.css">Final answer: (iv)
- An external stylesheet is attached with the HTML
Q1f. What is HTML? (i) HTML describes the structure of a webpage (ii) HTML is the standard markup language mainly used to create web pages (iii) HTML consists of a set of elements that helps the browser how to view the content (iv) All of the mentioned20232m
Module I: Introduction to Web Technologies & Architectures
View this question on its own page →What is HTML?
(i) HTML describes the structure of a webpage
(ii) HTML is the standard markup language mainly used to create web pages
(iii) HTML consists of a set of elements that helps the browser how to view the content
(iv) All of the mentionedWorked SolutionAnswer
(iv) All of the mentioned
Explanation
HTML:
- Describes the structure of a webpage.
- Is the standard markup language used to create web pages.
- Uses elements that tell the browser how content should be structured and presented.
Therefore, all three statements are correct.
Final answer: (iv) All of the mentioned
Q1g. What is an event in delegation event model used by Java programming language? (i) An event is an object that describes a state change in a source (ii) An event is an object that describes a state change in processing (iii) An event is an object that describes any change by the user and system (iv) An event is a class used for defining objects, to create events20232m
Module III: Basics of Web Programming
View this question on its own page →What is an event in delegation event model used by Java programming language?
(i) An event is an object that describes a state change in a source
(ii) An event is an object that describes a state change in processing
(iii) An event is an object that describes any change by the user and system
(iv) An event is a class used for defining objects, to create eventsWorked SolutionAnswer
(i) An event is an object that describes a state change in a source
Step-by-step
- Java's Delegation Event Model represents an event as an object.
- The event describes a change or action involving an event source, such as a button being clicked.
- The source generates the event and a registered listener handles it.
Example
A button click can generate an
ActionEvent, which is delivered to anActionListener.Final answer: (i)
Q1h. XML is designed to ____ and ____ data. (i) design, style (ii) design, send (iii) store, style (iv) store, transport20232m
Module V: Web 3.0 — Semantic Web and Supporting Technologies
View this question on its own page →XML is designed to ____ and ____ data.
(i) design, style
(ii) design, send
(iii) store, style
(iv) store, transportWorked SolutionAnswer
(iv) store, transport
Explanation
XML (Extensible Markup Language) is designed to represent and structure data so that it can be stored and transported between systems.
Unlike HTML, XML is primarily concerned with describing data rather than displaying it.
Final answer: (iv) store, transport
Q1i. What will be the output of the following JavaScript code snippet? <p id="demo"></p> <script> var txt1 = "BEU_"; var txt2 = "Javascript"; document.getElementById("demo").innerHTML = txt1 + txt2; </script> (i) error (ii) BEU_Javascript (iii) undefined (iv) BEU_Javascript20232m
Module III: Basics of Web Programming
View this question on its own page →What will be the output of the following JavaScript code snippet?
<p id="demo"></p> <script> var txt1 = "BEU_"; var txt2 = "Javascript"; document.getElementById("demo").innerHTML = txt1 + txt2; </script>(i) error
(ii) BEU_Javascript
(iii) undefined
(iv) BEU_JavascriptWorked SolutionAnswer
(ii)
BEU_JavascriptStep-by-step
txt1is assigned the stringBEU_.txt2is assigned the stringJavascript.- The
+operator concatenates the two strings. - Therefore,
txt1 + txt2becomesBEU_Javascript. innerHTMLplaces that result inside the element withid="demo".
var txt1 = "BEU_"; var txt2 = "Javascript"; document.getElementById("demo").innerHTML = txt1 + txt2;Final answer: (ii)
BEU_JavascriptNote: Options (ii) and (iv) appear duplicated in the supplied paper; the value is still
BEU_Javascript.Q1j. Which server supports Ajax? (i) WWW (ii) SMTP (iii) HTTP (iv) All of the above20232m
Module II: Browser & Apache Web Server Architecture; Common Protocols
View this question on its own page →Which server supports Ajax?
(i) WWW
(ii) SMTP
(iii) HTTP
(iv) All of the aboveWorked SolutionAnswer
(iii) HTTP
Explanation
AJAX allows a browser to communicate asynchronously with a server. The
XMLHttpRequestAPI commonly sends requests using HTTP (or HTTPS).- WWW is the overall Web system, not the protocol used for the request.
- SMTP is used for email transfer.
- HTTP is the standard request/response protocol used by AJAX communication.
Final answer: (iii) HTTP
Q2a. Explain TCP/IP in detail.20237m
Module II: Browser & Apache Web Server Architecture; Common Protocols
View this question on its own page →Explain TCP/IP in detail.
Worked SolutionTCP/IP in Detail
TCP/IP (Transmission Control Protocol/Internet Protocol) is the protocol suite used for communication between computers over interconnected networks, including the Internet.
Layers of TCP/IP
Layer Main role Examples Application Provides network services to applications HTTP, FTP, SMTP, DNS Transport End-to-end delivery and reliability TCP, UDP Internet Logical addressing and routing IP, ICMP Network Access Transfers frames over the physical/local network Ethernet, Wi-Fi TCP
TCP is connection-oriented and reliable. It provides sequencing, acknowledgements, retransmission, flow control and congestion control.
Basic TCP communication
- A connection is established using the three-way handshake: SYN → SYN-ACK → ACK.
- Data is divided into segments and numbered.
- The receiver acknowledges received data.
- Lost data can be retransmitted.
- The connection is closed after communication finishes.
IP
IP provides addressing and routing of packets between networks. IPv4 uses 32-bit addresses, while IPv6 uses 128-bit addresses.
Advantages
- Reliable communication through TCP.
- Routing across different networks through IP.
- Scalable and interoperable.
- Supports many application protocols.
In short: TCP provides reliable transport; IP provides addressing and routing.
Q2b. Explain the server-side scripting and client-side scripting in detail with examples.20237m
Module III: Basics of Web Programming
View this question on its own page →Explain the server-side scripting and client-side scripting in detail with examples.
Worked SolutionClient-side vs Server-side Scripting
Client-side scripting
Client-side scripts execute in the user's browser after the page is delivered by the server.
Examples: JavaScript, DOM manipulation, form validation.
<script> document.getElementById('msg').innerHTML = 'Hello'; </script>Server-side scripting
Server-side scripts execute on the web server. They can access databases, authenticate users, process business logic and generate a response.
Examples: PHP, JSP/Servlets, ASP.NET, Python web frameworks.
<?php echo "Hello from server"; ?>Difference
Client-side Server-side Runs in browser Runs on server Usually used for UI and interaction Used for business logic/data processing Can reduce server requests for UI operations Can access server-side databases/resources Source is generally delivered to the client Implementation can remain on the server Summary: Client-side scripting improves browser-side interaction; server-side scripting processes requests and generates server responses.
Q3. Explain the XML parser. Describe DTD and Schema with an example.202314m
Module V: Web 3.0 — Semantic Web and Supporting Technologies
View this question on its own page →Explain the XML parser. Describe DTD and Schema with an example.
Worked SolutionXML Parser, DTD and Schema
XML Parser
An XML parser reads an XML document and converts its textual representation into a form that a program can process. It checks XML syntax and, for validating parsers, can also check the document against a DTD or schema.
Types
- DOM parser: loads the document into an in-memory tree; convenient for random access but uses more memory.
- SAX parser: processes XML sequentially through events; efficient for large documents but does not keep the whole tree in memory.
DTD
A Document Type Definition (DTD) defines the legal structure and elements of an XML document.
<!DOCTYPE student [ <!ELEMENT student (name, roll)> <!ELEMENT name (#PCDATA)> <!ELEMENT roll (#PCDATA)> ]>XML Schema (XSD)
An XML Schema Definition (XSD) also defines XML structure, but provides richer data types, namespaces and more precise constraints.
<xs:element name="roll" type="xs:integer"/>DTD vs Schema
DTD XML Schema Older validation mechanism XML-based validation language Limited data types Rich built-in data types Less expressive More expressive constraints Syntax is not XML Uses XML syntax Conclusion: The parser processes XML; DTD and XSD provide rules used to validate its structure.
Q4a. Write a JavaScript to print all prime numbers from 1 to 100.20237m
Module III: Basics of Web Programming
View this question on its own page →Write a JavaScript to print all prime numbers from 1 to 100.
Worked SolutionJavaScript: Prime Numbers from 1 to 100
A prime number is greater than 1 and has exactly two positive divisors: 1 and itself.
Program
for (let n = 2; n <= 100; n++) { let prime = true; for (let i = 2; i * i <= n; i++) { if (n % i === 0) { prime = false; break; } } if (prime) { console.log(n); } }Logic
- Start from
2because1is not prime. - Test each number up to
100. - Check possible divisors from
2through√n. - If any divisor divides
nexactly, it is not prime. - Otherwise print the number.
Output:
2, 3, 5, 7, 11, 13, ... , 97.- Start from
Q4b. Explain the difference between client-side and server-side JavaScript.20237m
Module III: Basics of Web Programming
View this question on its own page →Explain the difference between client-side and server-side JavaScript.
Worked SolutionClient-side vs Server-side JavaScript
Feature Client-side JavaScript Server-side JavaScript Execution Browser Server/runtime Main purpose UI interaction, DOM manipulation, validation Business logic, APIs, database access DOM access Yes, normally Not to the user's browser DOM Visibility Code is generally delivered to the client Server implementation can remain private Example Browser JavaScript Node.js Client-side example
document.getElementById('msg').textContent = 'Hello';Server-side example
// Node.js const http = require('http'); http.createServer((req, res) => { res.end('Hello from server'); }).listen(3000);Conclusion: Client-side JavaScript mainly controls behavior in the browser, whereas server-side JavaScript executes on the server to process requests and data.
Q5a. What is MySQL? Give its salient features.20237m
Module III: Basics of Web Programming
View this question on its own page →What is MySQL? Give its salient features.
Worked SolutionMySQL and Its Salient Features
MySQL is an open-source relational database management system (RDBMS) that uses SQL (Structured Query Language) to create, store, retrieve and manage structured data.
Salient features
- Relational database: Data is organized in tables with rows and columns.
- SQL support: Supports SQL for querying and manipulating data.
- Open source: MySQL Community Edition is freely available under its open-source licensing model.
- Multi-user: Multiple users/applications can access databases concurrently.
- Client-server architecture: Applications communicate with the database server.
- Transactions: Supports transactional operations with InnoDB and ACID properties.
- Security: Provides authentication and privilege management.
- Scalability and performance: Suitable for applications ranging from small systems to large services.
- Cross-platform: Available on major operating systems.
Example
CREATE TABLE Student ( id INT PRIMARY KEY, name VARCHAR(50) ); SELECT * FROM Student;Conclusion: MySQL provides a practical SQL-based system for storing and managing relational data.
Q5b. Write a note on type conversion in PHP with example.20237m
Module III: Basics of Web Programming
View this question on its own page →Write a note on type conversion in PHP with example.
Worked SolutionType Conversion in PHP
Type conversion means changing a value from one data type to another. PHP supports automatic type conversion in many expressions and explicit conversion using casting.
1. Automatic type conversion
PHP may convert a value automatically when an operation requires another type.
$a = "10"; $b = 5; a + $b; // 15Here the numeric string is converted to a number for the arithmetic operation.
2. Explicit type casting
A programmer can explicitly cast a value:
$x = "25"; x; x;Common casts include
(int),(float),(string),(bool)and(array).Example
$price = "99.50"; price; echo $amount + 10; // 109.5Conclusion: PHP supports both implicit conversion and explicit casting; explicit casting is useful when the required type should be clear and controlled.
Q6. Write the difference between HTML, DHTML and XHTML in detail.202314m
Module III: Basics of Web Programming
View this question on its own page →Write the difference between HTML, DHTML and XHTML in detail.
Worked SolutionHTML vs DHTML vs XHTML
HTML
HTML (HyperText Markup Language) is the standard markup language used to structure web pages.
Features:
- Defines page structure using elements and attributes.
- Works with CSS for presentation and JavaScript for behavior.
- Modern HTML is standardized as HTML5.
DHTML
DHTML (Dynamic HTML) is not a separate markup language. It is a combination of HTML, CSS, JavaScript and the DOM used to create dynamically changing web pages without necessarily loading a new page.
Examples include changing styles, content or visibility in response to user actions.
XHTML
XHTML (Extensible HyperText Markup Language) reformulates HTML using XML's stricter syntax rules.
Typical rules include properly nesting elements, closing elements, quoting attribute values and using well-formed markup.
Comparison
HTML DHTML XHTML Markup language Collection of technologies/approach XML-based reformulation of HTML Structures content Adds dynamic behavior Uses stricter, well-formed syntax Flexible HTML syntax historically Uses JavaScript + DOM + CSS More strict than traditional HTML Focus: structure Focus: dynamic interaction Focus: XML-style correctness Conclusion: HTML provides structure, DHTML combines web technologies for dynamic behavior, and XHTML applies XML-style rules to HTML.
Q7a. Write a JavaScript program to print this pattern: * ** *** **** *20237m
Module III: Basics of Web Programming
View this question on its own page →Write a JavaScript program to print this pattern:
*
**
Worked SolutionJavaScript Pattern Program
Required pattern
* ** *** **** *****Program
for (let i = 1; i <= 5; i++) { let row = ""; for (let j = 1; j <= i; j++) { row += "*"; } console.log(row); }Logic
- The outer loop controls the 5 rows.
- The inner loop adds
istars to each row. console.log(row)prints each row on a new line.
Output:
* ** *** **** *****Q7b. What is a search engine? Explain its working with an example.20237m
Module I: Introduction to Web Technologies & Architectures
View this question on its own page →What is a search engine? Explain its working with an example.
Worked SolutionSearch Engine and Its Working
A search engine is a software system that discovers, indexes and retrieves web pages or other online resources in response to a user's query.
Working
- Crawling: Automated programs called crawlers/spiders visit web pages and follow links to discover content.
- Indexing: Information about discovered pages is processed and stored in a searchable index.
- Query processing: When a user enters a query, the engine analyzes the words and intent.
- Ranking: Matching results are ranked using many signals such as relevance, quality and freshness.
- Retrieval and display: The ranked results are shown on the search results page.
Example
If a user searches for "TCP/IP tutorial", the search engine finds indexed pages related to TCP/IP, ranks them by relevance, and displays the most useful matches.
Flow:
Crawl → Index → Query → Rank → DisplayQ8a. What is HTTP? Explain the steps that are involved for each request from a client to the server.20237m
Module II: Browser & Apache Web Server Architecture; Common Protocols
View this question on its own page →What is HTTP? Explain the steps that are involved for each request from a client to the server.
Worked SolutionHTTP and Client-to-Server Request Steps
HTTP (HyperText Transfer Protocol) is an application-layer protocol used for communication between clients and web servers. It follows a request-response model.
Steps
- Enter/request URL: The browser determines the target resource.
- DNS resolution: The domain name is resolved to an IP address when necessary.
- Connection: The client establishes a connection to the server (typically TCP; HTTPS also establishes TLS security).
- HTTP request: The browser sends a request containing a method such as
GETorPOST, URL/path, headers and possibly a body. - Server processing: The web server/application processes the request, possibly accessing files, code or databases.
- HTTP response: The server returns a status code, headers and usually a response body.
- Browser processing: The browser interprets the response and renders the page; it may make additional requests for CSS, JavaScript, images, etc.
- Connection reuse/close: The connection may be reused or closed according to the protocol and headers.
Example
Browser → HTTP GET /index.html → Web Server Browser ← HTTP 200 + HTML ← Web ServerCommon status codes:
200 OK,404 Not Found,500 Internal Server Error.Q8b. AJAX (Asynchronous Javascript and XML) is used by web application client to communicate with server side scripts. What four XMLHttpRequest functions are required to make and handle an AJAX call? Write each step in detail.20237m
Module III: Basics of Web Programming
View this question on its own page →AJAX (Asynchronous Javascript and XML) is used by web application client to communicate with server side scripts. What four XMLHttpRequest functions are required to make and handle an AJAX call? Write each step in detail.
Worked SolutionAJAX and XMLHttpRequest
AJAX (Asynchronous JavaScript and XML) is a technique that allows browser JavaScript to communicate with a server asynchronously and update part of a page without a full page reload. JSON is also commonly used today even though the name contains XML.
Main XMLHttpRequest steps
1. Create the request object
const xhr = new XMLHttpRequest();2. Configure the request with
open()xhr.open("GET", "data.php", true);open()specifies the HTTP method, URL and whether the request is asynchronous.3. Handle the response with
onreadystatechangexhr.onreadystatechange = function () { if (xhr.readyState === 4 && xhr.status === 200) { document.getElementById("result").textContent = xhr.responseText; } };4. Send the request with
send()xhr.send();For a POST request, data can be supplied to
send(data).Complete example
const xhr = new XMLHttpRequest(); xhr.open("GET", "data.php", true); xhr.onreadystatechange = function () { if (xhr.readyState === 4 && xhr.status === 200) { document.getElementById("result").textContent = xhr.responseText; } }; xhr.send();Important terms
open()→ configures requestsend()→ sends requestonreadystatechange→ reacts to state changesresponseText→ contains text returned by the server
Exam point: The core request flow is create → open → set handler → send → receive/process response.
Q9a. Write a short note on Event-driven Programming.20237m
Module III: Basics of Web Programming
View this question on its own page →Write a short note on Event-driven Programming.
Worked SolutionEvent-driven Programming
Event-driven programming is a programming model in which program execution is controlled by events such as mouse clicks, keyboard input, network messages, timers or other system actions.
Main components
- Event source: The object that generates an event, e.g. a button.
- Event: Represents an occurrence, e.g. a click.
- Event handler/listener: Code that responds to the event.
- Event loop/dispatcher: Detects events and dispatches them to appropriate handlers.
Example
button.addEventListener("click", function () { alert("Button clicked"); });Here the button is the source,
clickis the event, and the function is the handler.Advantages
- Natural for interactive applications.
- Separates event detection from response logic.
- Useful for GUIs and web applications.
Conclusion: Instead of executing everything in one fixed sequence, an event-driven program waits for events and responds to them.
Q9b. Write a short note on Data Binding.20237m
Module III: Basics of Web Programming
View this question on its own page →Write a short note on Data Binding.
Worked SolutionData Binding
Data binding is the mechanism that connects data from a data source/model with UI elements or another representation so that values can be displayed or updated automatically.
Types
- One-way binding: Data flows in one direction, such as model → view.
- Two-way binding: Changes in the model can update the view, and user changes in the view can update the model.
Example concept
Suppose a model contains:
name = "Ravi"A bound text field displays
Ravi. If two-way binding is used and the user changes the field toAman, the model can also be updated toAman.Advantages
- Reduces repetitive UI update code.
- Keeps displayed data synchronized with application state.
- Improves maintainability of data-driven interfaces.
Conclusion: Data binding establishes a relationship between application data and the user interface, with one-way or two-way synchronization depending on the framework/design.
Q9c. Write a short note on Xlinks and Xpointer.20237m
Module V: Web 3.0 — Semantic Web and Supporting Technologies
View this question on its own page →Write a short note on Xlinks and Xpointer.
Worked SolutionXLink and XPointer
XLink
XLink (XML Linking Language) provides a framework for creating links between XML resources. It supports simple links as well as more complex linking relationships.
It uses attributes such as
xlink:hrefto identify a linked resource.<book xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple" xlink:href="chapter2.xml"> Chapter 2 </book>XPointer
XPointer (XML Pointer Language) extends the idea of URI references by allowing a link to identify a particular part or fragment of an XML document rather than only the whole document.
Difference
XLink XPointer Defines linking relationships Identifies locations/fragments in XML resources Describes how resources are linked Describes where a link points within a resource In short: XLink handles XML linking; XPointer provides fine-grained addressing within XML content.
Q9d. Write a short note on Dynamic HTML.20237m
Module III: Basics of Web Programming
View this question on its own page →Write a short note on Dynamic HTML.
Worked SolutionDynamic HTML (DHTML)
DHTML (Dynamic HTML) is a combination of technologies used to make web pages dynamic and interactive. It is not a separate programming language.
Main technologies
- HTML — provides the page structure.
- CSS — controls presentation and styles.
- JavaScript — provides behavior and logic.
- DOM — represents the document and allows scripts to change its content and structure.
Example
<p id="msg">Old text</p> <button onclick="changeText()">Change</button> <script> function changeText() { document.getElementById("msg").textContent = "New text"; } </script>When the button is clicked, JavaScript changes the paragraph without requiring the whole page to be reloaded.
Advantages
- Creates interactive pages.
- Allows dynamic content and style changes.
- Improves user experience.
- Can update selected page elements efficiently.
Conclusion: DHTML = HTML + CSS + JavaScript + DOM, working together to create dynamic web pages.