0% found this document useful (0 votes)
2 views3 pages

System Analysis and Design - Web Programming 2024 PDF

The document discusses various technical topics including the advantages of JSP over Servlets, benefits of HTTP/2 compared to HTTP 1.1, differences between XHTML and HTML, new features in HTML5, and best practices for web application development considering SEO, maintainability, UX, performance, and security. It also covers denormalization scenarios, the concept of indexing in databases, and type coercion in JavaScript. Each topic is addressed with concise explanations and examples.

Uploaded by

Ciara
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)
2 views3 pages

System Analysis and Design - Web Programming 2024 PDF

The document discusses various technical topics including the advantages of JSP over Servlets, benefits of HTTP/2 compared to HTTP 1.1, differences between XHTML and HTML, new features in HTML5, and best practices for web application development considering SEO, maintainability, UX, performance, and security. It also covers denormalization scenarios, the concept of indexing in databases, and type coercion in JavaScript. Each topic is addressed with concise explanations and examples.

Uploaded by

Ciara
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/ 3

Question 1:What are the advantages of JSP over Servlet?

(3 marks)

Answer:Separation of Concerns: JSP allows better separation of presentation (HTML) and


business logic (Java code), making it easier to maintain and read compared to Servlets, where
HTML is often mixed with Java code via out.println().Simplified Development: JSP pages are
automatically compiled into Servlets by the server, reducing the need to manually write and
manage Servlet code for rendering dynamic content.Built-in Features: JSP provides implicit
objects (e.g., request, response, session) and tag libraries (e.g., JSTL), which simplify tasks like
form handling and session management compared to Servlets.

Question 2:List three (03) added benefits of HTTP/2 compared to HTTP 1.1? (3 marks)

Answer:Multiplexing: HTTP/2 allows multiple requests and responses to be sent over a single
connection simultaneously, reducing latency compared to HTTP 1.1’s sequential request
handling.Header Compression: HTTP/2 uses HPACK to compress headers, reducing overhead
and improving performance over HTTP 1.1’s uncompressed headers.Server Push: HTTP/2
enables the server to proactively send resources (e.g., CSS, JavaScript) to the client before
they are requested, speeding up page loading compared to HTTP 1.1.

Question 3:How is XHTML different from HTML? (3 marks)

Answer:Syntax Strictness: XHTML is stricter than HTML; it requires well-formed XML syntax
(e.g., all tags must be closed, properly nested, and attributes quoted), whereas HTML is more
lenient.XML-Based: XHTML is based on XML, making it more suitable for integration with other
XML-based technologies, while HTML is SGML-based and less strict.Case Sensitivity: XHTML
is case-sensitive (e.g., tags must be lowercase), while HTML is not (e.g., <P> and <p> are the
same in HTML).Question 4:List out newly introduced input types, APIs, form elements in
HTML5? (3 marks)Answer:New Input Types: HTML5 introduced input types like email, url, date,
range, color, and tel, which provide better validation and user experience.New APIs: HTML5
added APIs like Canvas API (for 2D drawing), Geolocation API, Web Storage (localStorage,
sessionStorage), and WebSockets for real-time communication.New Form Elements: HTML5
introduced elements like <datalist> (for autocomplete suggestions), <progress> (for progress
bars), and <meter> (for scalar measurements), along with attributes like placeholder and
required.Question 5:While building a web application, how do you consider SEO,
maintainability, UX, performance, and security? (5 marks)Answer:SEO (Search Engine
Optimization): Use semantic HTML5 tags (e.g., <header>, <article>), optimize meta tags (title,
description), ensure fast loading with compressed assets, and create a sitemap for better
indexing.Maintainability: Structure code with clear separation (e.g., MVC pattern), use modular
CSS (e.g., BEM), comment code, and follow consistent naming conventions to make updates
easier.UX (User Experience): Design intuitive navigation, ensure responsive design for all
devices, provide feedback (e.g., loading spinners), and use accessible elements (e.g., ARIA
labels) for inclusivity.Performance: Minimize HTTP requests, use lazy loading for images,
leverage browser caching, and optimize assets (e.g., compress images, minify CSS/JS) to
reduce load times.Security: Implement HTTPS, sanitize user inputs to prevent XSS, use secure
headers (e.g., CSP), validate forms server-side, and protect against SQL injection with prepared
statements.

Question 6:Describe three situations that can be good candidates for denormalization. (6 marks)

Answer:Read-Heavy Applications: In systems where read operations (e.g., reporting, analytics)


far outnumber writes, denormalization can improve performance by reducing the need for
complex joins. For example, storing a user’s total order count directly in the user table instead of
calculating it from an orders table.Real-Time Data Access: In applications requiring fast data
retrieval, like e-commerce dashboards showing product details with category names,
denormalizing by storing the category name in the product table avoids joins and speeds up
queries.Caching Frequently Accessed Data: For systems with repetitive queries, such as social
media platforms displaying user profiles with post counts, denormalizing by storing the post
count in the user table reduces query overhead and improves response time.

Question 7:What is an index and how can it improve the performance of a system? (3 marks)

Answer:What is an Index?: An index is a database structure that allows faster data retrieval by
creating a lookup mechanism for specific columns (e.g., a B-tree or hash index). It acts like a
book’s index, pointing to data locations without scanning the entire table.How it Improves
Performance:Faster Queries: Indexes speed up SELECT queries and WHERE clauses by
reducing the number of rows scanned (e.g., finding a user by user_id in a million-row
table).Efficient Sorting: Indexes improve ORDER BY and GROUP BY operations by pre-sorting
data.Reduced Disk I/O: By narrowing down the search space, indexes minimize disk reads,
improving overall system performance. However, they add overhead for INSERT, UPDATE, and
DELETE operations due to index maintenance.

Question 8:Describe the concept of Type Coercion in JavaScript. (5 marks)

Answer:What is Type Coercion?: Type coercion in JavaScript is the automatic conversion of


one data type to another during operations or comparisons.
JavaScript is a loosely typed language, so it often coerces values to make operations possible
(e.g., converting a string to a number).Types of Coercion:Implicit Coercion: Done automatically
by JavaScript. For example, in 5 + "5", the number 5 is coerced to a string, resulting in
"55".Explicit Coercion: Done manually using functions like Number(), String(), or Boolean(). For
example, Number("5") converts the string "5" to the number 5.Examples:"5" == 5: JavaScript
coerces the string "5" to the number 5, so the comparison returns true.null + 0: null is coerced to
0, so the result is 0.false + 1: false is coerced to 0, so the result is 1.Potential Issues: Coercion
can lead to unexpected results (e.g., "5" - 1 results in 4 because - coerces the string to a
number). To avoid ambiguity, use strict equality (===) or explicit conversion.Best Practice:
Understand coercion rules (e.g., how +, -, == behave) and use explicit coercion when clarity is
needed to prevent bugs.

You might also like