IITIAN1997 STUDIO

Internet and web technology

JLEE CSE · 10 practice questions with answers

Practise and take a mock test →

Internet, HTML, CSS, JavaScript and server side

Topics: Internet history, ISPs and connectivity; WWW, browsers, URLs; HTML tags, forms, tables, CSS; JavaScript; server-side scripting; XML; search engines and security.

Internet, WWW and URLs

The web is documents and services on the internet reached by URLs: scheme://host:port/path?query#fragment. A browser looks up the host by DNS, sends an HTTP request and renders the response. Status codes: 200 OK, 301 moved permanently, 404 not found, 500 server error.

  • URL: scheme, host, port, path, query
  • DNS turns names into IP addresses
  • 200, 301, 404, 500

Example: Name the parts of https://www.example.com:443/notes?page=2.

  1. Scheme https, host www.example.com, port 443.
  2. Path /notes, query page=2.

Answer: scheme, host, port, path, query

Example: What does status code 404 mean?

  1. The server was reached but the resource was not found.
  2. Not Found.

Answer: Not Found

HTML and CSS

HTML structures content with elements (headings, paragraphs, links, images, lists, tables, forms). CSS styles it; rules cascade, and more specific selectors win: inline > id > class > element. In the default content-box model, the total width = width + left and right padding + left and right border (+ margin outside).

  • Specificity: inline > id > class > element
  • Box: content + padding + border + margin
  • <form>, <input>, <table>, <a href>

Example: A div has width 200px, padding 10px and a 2px border (content-box). How wide is it on screen?

  1. 200 + 2 × 10 + 2 × 2.
  2. = 224 px (plus any margin).

Answer: 224 px

Example: Which rule wins: #title { color: red } or .big { color: blue } on the same element?

  1. An id selector is more specific than a class.
  2. Red.

Answer: Red (#title)

JavaScript, server side and security

JavaScript runs in the browser (and on servers with Node.js). Its loose typing surprises: + joins strings, other arithmetic converts to numbers. Server-side code (PHP, Node.js, Python) builds pages and talks to databases. XML and JSON carry structured data. Security: HTTPS encrypts traffic; never build SQL from user text (use prepared statements); escape output to stop cross-site scripting.

  • + with a string concatenates
  • HTTPS encrypts
  • Prepared statements and output escaping

Example: What are "5" + 3 and "5" − 3 in JavaScript?

  1. + with a string joins: "53".
  2. − converts to numbers: 2.

Answer: "53" and 2

Example: How do you prevent SQL injection in a login form?

  1. User input must never be pasted into the SQL text.
  2. Use parameterised (prepared) queries.

Answer: Prepared statements

The web runs on HTTP between browsers and servers; a URL has scheme, host, path and query. HTML structures pages with tags (h1, p, a, img, table, form), CSS styles them with selectors, and JavaScript adds client-side behaviour in the browser. A GET request sends data in the URL, while POST sends it in the body. Server-side languages such as PHP run before the page is sent. Cookies store small data on the client, and sessions on the server. XML has user-defined tags for data. HTTPS encrypts traffic with TLS.

  • <a href> links; <img src> images; <ul>/<ol> lists.
  • CSS id selector #x, class selector .x.
  • JavaScript runs in the browser; PHP on the server.
  • HTML form methods: GET, POST.
  • Status: 200 OK, 404 Not Found, 500 Server Error.

Key formulas

  • scheme://host:port/path?query
  • color: red; (CSS rule)

Practice questions

The tag for a hyperlink is

  1. <a>
  2. <img>
  3. <link> only
  4. <p>
Show the answer

Answer: A. <a> Anchor.

CSS class selector begins with

  1. #
  2. .
  3. @
  4. $
Show the answer

Answer: B. . .class

CSS id selector begins with

  1. #
  2. .
  3. %
  4. &
Show the answer

Answer: A. # #id

JavaScript usually runs on the

  1. client
  2. printer
  3. DNS server
  4. router
Show the answer

Answer: A. client Browser.

PHP runs on the

  1. server
  2. mouse
  3. browser only
  4. printer
Show the answer

Answer: A. server Server-side.

HTTP 404 means

  1. OK
  2. not found
  3. server error
  4. redirect
Show the answer

Answer: B. not found Missing resource.

GET sends form data in the

  1. URL
  2. body only
  3. cookie only
  4. file
Show the answer

Answer: A. URL Query string.

XML tags are

  1. user-defined
  2. fixed like HTML
  3. only numbers
  4. binary
Show the answer

Answer: A. user-defined Extensible.

A cookie is stored on the

  1. client
  2. router
  3. DNS root
  4. keyboard
Show the answer

Answer: A. client Browser.

An ISP is

  1. an Internet service provider
  2. an image software pack
  3. an input signal port
  4. an index search page
Show the answer

Answer: A. an Internet service provider Access company.

The practice questions were written for this studio; they are not copied from ASTU papers. ASTU publishes no topic syllabus for these exams, so the topics are an informed guide based on diploma courses, not an official list.

Practise and take a mock test →