64 Web Technologies (Computer Science) questions asked in DSSSB TGT / PGT previous year papers, each with the correct answer and explanation. Read them free on UTpaper, or attempt the full papers as timed online tests.
The XML declaration in the prolog starts with <?xml, as in <?xml version="1.0"?>. Option A is the only one that uses the <? processing-instruction form.
Consider the following statements respect to JavaScript :
(I) A variable is created using the keyword.
(II) JavaScript is untyped language.
Which of the above are true ?
ANeither (I) not (II)
B(I) only
C(II) only
DBoth (I) and (II)
Show answerHide answer
Correct answer: (D) Both (I) and (II)
Explanation
Both statements are true as intended: in JavaScript a variable is created with the var keyword (the word is missing from the question), and JavaScript is loosely (dynamically) typed, so variables have no fixed type.
Which of the following is the correct code to create a framed webpage as in the figure below?
Figure: the window is split into two rows: the top row (25%) is Frame A; the bottom row (75%) is split into two equal columns (50% each): Frame B on the left and Frame C on the right.
The outer FRAMESET ROWS="25%,75%" makes two rows: Frame A in the first row, and a nested FRAMESET COLS="50%,50%" holding Frames B and C in the second. Options C and D swap FRAME and FRAMESET.
Consider the following statements respect to JavaScript :
(I) A variable is created using the var keyword.
(II) JavaScript is untyped language.
Which of the above are true ?
ANeither (I) not (II)
B(I) only
C(II) only
DBoth (I) and (II)
Show answerHide answer
Correct answer: (D) Both (I) and (II)
Explanation
JavaScript variables can be declared with var, and JavaScript is untyped (dynamically typed), so the same variable can hold any type. Both statements are true.
Which of the following is the most appropriate format for graphics that are to be embedded within an Internet documents?
AHTML
BBMP
CTIFF
DGIF
Show answerHide answer
Correct answer: (D) GIF
Explanation
GIF is a compressed, widely supported image format made for the web. BMP and TIFF files are large and not suited to web pages, and HTML is not a graphics format.
To declare the version of XML. the correct syntax is :
A</xml version = '1.0'/>
B<?xml version = "1.0"/>
C<*xml version = '1.0'/>
D<?xml version = 1.0"/>
Show answerHide answer
Correct answer: (B) <?xml version = "1.0"/>
Explanation
The XML declaration is a processing instruction: <?xml version="1.0"?>. It begins with <?xml and the version value is quoted. Option B is the closest to this form.
Rasleen is adding links to her company website. She wants to change the link colour as soon as the visitor's mouse hoven over the link and wants it should retain the original colour when visitor's mouse moves to any other location away from the link. Which of the following two event handless will be required to write a JavaScript code to achieve the same.
AOnMouseOver and OnMouseExit
BOnMouseOver and OnMouseOut
COnMouseIn and OnMouseOut
DOnMouseIn and OnMouseExit
Show answerHide answer
Correct answer: (B) OnMouseOver and OnMouseOut
Explanation
onmouseover fires when the pointer enters the link, and onmouseout fires when it leaves. There are no OnMouseIn or OnMouseExit events.
BIt contains the number of nested tags in the page.
CIt contains information about the webpage.
DIt contains the number of tags in the web page.
Show answerHide answer
Correct answer: (C) It contains information about the webpage.
Explanation
The tag described here seems to be <meta> (the tag name is missing in the source). It holds information about the page, such as description, keywords and author.
BIt is a special image in which different area point to different locators on the web
CIt contains the properties of the image
DIt contains the number of pixels in the image
Show answerHide answer
Correct answer: (B) It is a special image in which different area point to different locators on the web
Explanation
An image map is one image with clickable regions (<map>/<area>), where each region links to a different URL.
Q24DSSSB TGT Computer Science (Technical), 8 Aug 2021, Shift 2
Which colour specification in CSS use three numbers representing the hue (form 0 to 360 degree), saturation and lightness percentage?
AHexadecimal
BRGB
CHSL
DAlpha
Show answerHide answer
Correct answer: (C) HSL
Explanation
HSL stands for Hue, Saturation and Lightness, for example hsl(120, 100%, 50%). Hue is an angle from 0 to 360°, and saturation and lightness are percentages.
Q25DSSSB TGT Computer Science (Technical), 7 Aug 2021, Shift 3
Which property of CSS specifies the degree to which text should be emboldened?
AFont-style
BFont-family
CFont-weight
DFont-size
Show answerHide answer
Correct answer: (C) Font-weight
Explanation
font-weight sets how bold the text is (normal, bold, 100-900). font-style sets italic.
Q26DSSSB TGT Computer Science (Technical), 7 Aug 2021, Shift 3
Which property of CSS enables to set multiple list properties at once?
AList-style-type
BList-style-image
CList-style-position
DList-style
Show answerHide answer
Correct answer: (D) List-style
Explanation
list-style is the shorthand property that sets list-style-type, list-style-position and list-style-image in one declaration.
Q27DSSSB TGT Computer Science (Technical), 7 Aug 2021, Shift 3
________ produces a rough outline of what the website will look like when it is done.
AWirefalls
BWireframes
CWebframes
DWebflows
Show answerHide answer
Correct answer: (B) Wireframes
Explanation
A wireframe is a rough skeletal outline of a website's layout made before the actual design and development.
Q28DSSSB TGT Computer Science (Technical), 7 Aug 2021, Shift 2
Which of the following is/are the open-source software(s)?
I. PHP
II. Apache
AOnly I
BOnly II
CBoth I and II
DNeither I nor II
Show answerHide answer
Correct answer: (B) Only II
Explanation
Apache HTTP Server is open-source software. PHP is also free and open source, but the official key accepts only Apache (Only II).
Q29DSSSB TGT Computer Science (Technical), 7 Aug 2021, Shift 2
Which of the following statement(s) is/are true about wire framing of website?
I. Showing which content will appear on which page
II. Showing navigator between pages
AOnly I
BOnly II
CBoth I and II
DNeither I nor II
Show answerHide answer
Correct answer: (C) Both I and II
Explanation
A wireframe is a basic layout of a website that shows what content goes on each page and how the pages link (navigation between them). Both are true.
Q30DSSSB TGT Computer Science (Technical), 7 Aug 2021, Shift 2
________ URL is used to send electronic mail.
AMailto
BEto
CEmail URL
DEURL
Show answerHide answer
Correct answer: (A) Mailto
Explanation
A mailto: URL (e.g. mailto:abc@example.com) opens the user's email client to send an email.
Q31DSSSB TGT Computer Science (Technical), 1 Aug 2021, Shift 3
In JavaScript a ________ function can be defined as a function passed into another function as a parameter.
ACall front
BCall back
CRoll back
DRoll front
Show answerHide answer
Correct answer: (B) Call back
Explanation
A callback function is passed as an argument to another function and called back inside it, e.g. in setTimeout or event handlers.
Q32DSSSB TGT Computer Science (Technical), 1 Aug 2021, Shift 3
Which of the following statement(s) is/are correct regarding the strategies required to increase the visibility of e-commerce website?
I. The website name should be sensible that it can be guessed.
II. Uploading contents like special offers or eye catching information for the regular followers can increase traffic on the website.
III. Icons of social networks on the website have no major influence on e-visibility.
AI and II
BII and III
COnly II
DI, II and III
Show answerHide answer
Correct answer: (A) I and II
Explanation
A sensible, easily guessed name and fresh attractive content (offers) increase visibility (I and II). III is false: social network icons do help e-visibility.
Q33DSSSB TGT Computer Science (Technical), 1 Aug 2021, Shift 3
How many different levels of heading does HTML support?
How does one prevent a form from submitting when using JavaScript?
Aevent.preventDefault()
Bform.submit()
Creturn false;
Devent.stopPropagation()
Show answerHide answer
Correct answer: (A) event.preventDefault()
Explanation
Calling event.preventDefault() in the submit handler cancels the browser's default action, the form submission. stopPropagation() only stops the event from bubbling.
What will be the output of the following JavaScript code?
const email = "example@domain";
const regex = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/;
console.log(regex.test(email));
AError: Invalid regex
Bundefined
CFALSE
DTRUE
Show answerHide answer
Correct answer: (C) FALSE
Explanation
The regex needs a dot and a 2-4 letter top-level domain after the @ part. "example@domain" has no ".com"-style ending, so test() returns false.
Which of the following statements is true about JavaScript arrays?
AJavaScript arrays can store elements of multiple data types.
BJavaScript arrays are of fixed size.
CJavaScript arrays cannot be modified once created.
DJavaScript arrays can store elements of only one data type.
Show answerHide answer
Correct answer: (A) JavaScript arrays can store elements of multiple data types.
Explanation
JavaScript arrays are dynamic objects. One array can hold numbers, strings, objects and other types together, and it can grow, shrink or be changed after it is created.
BTo store data in a format that is readable by humans only
CTo enhance the visual appearance of a webpage
DTo represent and exchange data between different systems and platforms
Show answerHide answer
Correct answer: (D) To represent and exchange data between different systems and platforms
Explanation
XML is a platform-independent, self-describing text format used to store, represent and exchange structured data between different systems and applications. Presentation is the job of HTML/CSS.
Which of the following are key components of an XML document?
ATags, attributes, and comments
BHTML tags and hyperlinks
CClasses, objects, and functions
DScripts, styles, and images
Show answerHide answer
Correct answer: (A) Tags, attributes, and comments
Explanation
An XML document is made of elements (tags), attributes, text content, comments and a prolog/declaration. HTML tags, classes or scripts are not its components.
Correct answer: (D) To display and navigate web pages
Explanation
A web browser retrieves, renders and displays web pages and lets the user navigate between them through links. Creating websites and email are done with other software.
In DHTML, a style is changed at run time by assigning to the element's style object, e.g. element.style.backgroundColor = "red". There is no setCSS() method, and resize is an event, not a styling method.
Which of the following DHTML methods is used to control the browser window size, such as
resizing it dynamically via JavaScript?
Awindow.resizeTo()
Bwindow.setSize()
Cwindow.changeSize()
Ddocument.resizeWindow()
Show answerHide answer
Correct answer: (A) window.resizeTo()
Explanation
window.resizeTo(width, height) resizes the browser window to the given size (resizeBy changes it by an amount). setSize(), changeSize() and resizeWindow() do not exist.
Which of the following is an action or occurrence such as a mouse click, a key press, mouse movements or any system- generated notification in ASP.NET?
ADirective
BValidator
CControl
DEvent
Show answerHide answer
Correct answer: (D) Event
Explanation
In ASP.NET an event is an action or occurrence such as a click, key press, mouse movement or system notification that code can respond to.
Which of the following parameters is used to create a hyperlink in HTML?
ALink
Burl
CPath
DHref
Show answerHide answer
Correct answer: (D) Href
Explanation
The href attribute of the <a> tag gives the destination URL of a hyperlink, as in <a href="page.html">.
How to use these DSSSB TGT / PGT Computer Science questions
Every question here was asked in a real DSSSB TGT / PGT paper; the paper and shift are shown on the card, and the number opens the question on its own page. Try each one before tapping Show answer, then attempt the full DSSSB TGT / PGT papers as timed tests to check your speed under exam conditions.