CS511 – Fundamentals of Web Development: Midterm Important MCQs (135 Solved Questions)
Computer Science • Read every solved MCQ with its verified answer key directly on this page. Free, no login required.
All 664 Midterm Packs · CS511 Course Page · CS511 Subjective Pack (62 Q&As)
-
ARPANET, the early network funded and controlled by the United States government, was created in which year?
Topic: Web & Internet Fundamentals
- 1969 ✓ Correct answer
- 1974
- 1979
- 1990
-
In TCP/IP, the letters 'IP' stand for:
Topic: Web & Internet Fundamentals
- Internet Program
- Internal Protocol
- Internet Protocol ✓ Correct answer
- Interconnection Process
-
A formal set of publicly available rules that manage data exchange between two points is called a:
Topic: Web & Internet Fundamentals
- Server
- Protocol ✓ Correct answer
- Browser
- Domain
-
According to the notes, the difference between the Internet and the World Wide Web is that:
Topic: Web & Internet Fundamentals
- The Internet is the software part and the Web is the hardware part
- The Internet is the hardware part (networks connected by wires, fiber or wireless), while the Web is the software part (pages connected through hyperlinks and URLs) ✓ Correct answer
- The Web and the Internet are exactly the same thing
- The Web is a service that does not run on the Internet
-
Tim Berners-Lee and Robert Cailliau published their 1990 proposal for a hypertext system while working at:
Topic: Web & Internet Fundamentals
- MIT
- CERN ✓ Correct answer
- NASA
- Oxford University
-
Which of the following was NOT one of the essential elements of the early web developed by Berners-Lee?
Topic: Web & Internet Fundamentals
- A Uniform Resource Locator (URL)
- The Hypertext Transfer Protocol (HTTP)
- Hypertext Markup Language (HTML)
- Search Engine Optimization (SEO) ✓ Correct answer
-
A static website consists of:
Topic: Web & Internet Fundamentals
- Pages generated at run time by a server program
- HTML pages that look identical for all users at all times ✓ Correct answer
- Pages that users can edit and contribute to
- Pages stored in a database
-
In a dynamic server-side website, the page content is:
Topic: Web & Internet Fundamentals
- Published once by the webmaster and never changed
- Created at run time by a program running on the web server ✓ Correct answer
- Written by the users of the website
- Generated inside the browser by JavaScript only
-
Web 2.0 is mainly characterized by:
Topic: Web & Internet Fundamentals
- Publisher-generated content
- Static websites
- User Generated Content (UGC) ✓ Correct answer
- Machine-understandable content
-
Web 3.0 is expected to be the semantic web, mainly characterized by:
Topic: Web & Internet Fundamentals
- User-generated content
- Machine-understandable content ✓ Correct answer
- Static HTML pages
- Company-generated content
-
In the client-server model, a server is a computer agent that:
Topic: Web & Internet Fundamentals
- Makes requests and receives responses
- Is normally active 24/7, listening for requests from clients ✓ Correct answer
- Runs only when a user logs in
- Stores web pages in the browser cache
-
A mail server typically creates and satisfies mail requests using which protocol?
Topic: Web & Internet Fundamentals
- HTTP
- FTP
- SMTP ✓ Correct answer
- DNS
-
Server farms are typically housed in special facilities called:
Topic: Web & Internet Fundamentals
- Internet exchange points
- Server racks
- Data centers ✓ Correct answer
- Head-ends
-
A router decides where a data packet should be sent by using a:
Topic: Web & Internet Fundamentals
- Routing table ✓ Correct answer
- Domain name
- MAC address book
- Load balancer
-
An Internet Exchange Point (IX or IXP) provides:
Topic: Web & Internet Fundamentals
- A way for networks within a country and between different countries to interconnect ✓ Correct answer
- A service that registers domain names
- A facility that stores server farms
- A protocol for sending email
-
Companies that combine hosting, design, and application solutions into one company are called:
Topic: Web & Internet Fundamentals
- Start-up companies
- Design companies
- Hosting companies
- Vertically integrated companies ✓ Correct answer
-
The TCP/IP Internet protocols were originally abstracted as a stack of how many layers?
Topic: Internet Protocols, DNS, URLs & HTTP
- Three layers
- Four layers ✓ Correct answer
- Five layers
- Seven layers
-
The lowest layer of the TCP/IP stack, responsible for the physical transmission of data as raw bits, is the:
Topic: Internet Protocols, DNS, URLs & HTTP
- Internet layer
- Transport layer
- Link layer ✓ Correct answer
- Application layer
-
MAC (media access control) addresses, used at the link layer, are unique identifiers of:
Topic: Internet Protocols, DNS, URLs & HTTP
- 32 bits
- 48 or 64 bits ✓ Correct answer
- 128 bits
- 256 bits
-
The Internet layer provides 'best effort' communication, which means it:
Topic: Internet Protocols, DNS, URLs & HTTP
- Guarantees every message arrives in order
- Sends a message to its destination but provides no guarantee the message will arrive intact, or at all ✓ Correct answer
- Encrypts every packet before sending
- Requires an acknowledgement for every packet
-
An IPv4 address is made up of:
Topic: Internet Protocols, DNS, URLs & HTTP
- Eight 16-bit integers
- Four 8-bit integers (32 bits in total) ✓ Correct answer
- Two 16-bit integers
- Six 8-bit integers
-
IPv6 was created to overcome the IPv4 address limit; it provides approximately how many unique addresses?
Topic: Internet Protocols, DNS, URLs & HTTP
- 4.2 billion
- 2^32
- 2^64
- 2^128 ✓ Correct answer
-
Which transport-layer protocol is used instead of TCP when guaranteed transmission is not wanted, for example in live streaming, Voice over IP and DNS?
Topic: Internet Protocols, DNS, URLs & HTTP
- UDP (User Datagram Protocol) ✓ Correct answer
- FTP
- SMTP
- SSH
-
In TCP, how does the sender realize that a packet has been lost?
Topic: Internet Protocols, DNS, URLs & HTTP
- The receiver sends the packet back
- No ACK (acknowledgement) arrives for that packet ✓ Correct answer
- The packet's sequence number changes
- The router reports the loss
-
The extensions .us, .ca, .uk and .au are examples of:
Topic: Internet Protocols, DNS, URLs & HTTP
- Generic top-level domains
- Country code top-level domains (ccTLD) ✓ Correct answer
- Sponsored top-level domains
- Second-level domains
-
The nonprofit organization that oversees the management of top-level domains, accredits registrars and coordinates DNS is:
Topic: Internet Protocols, DNS, URLs & HTTP
- IANA
- W3C
- ICANN ✓ Correct answer
- IETF
-
IANA authorizes how many root name servers for DNS?
Topic: Internet Protocols, DNS, URLs & HTTP
- 13 ✓ Correct answer
- 25
- 100
- 252
-
In a URL, the query string (information passed to the file as key-value pairs) starts with which delimiter?
Topic: Internet Protocols, DNS, URLs & HTTP
- #
- &
- ? ✓ Correct answer
- /
-
In a URL, the fragment, used to request a specific portion of a web page, is represented by which symbol?
Topic: Internet Protocols, DNS, URLs & HTTP
- ?
- &
- :
- # ✓ Correct answer
-
HTTP servers usually listen for requests on which port?
Topic: Internet Protocols, DNS, URLs & HTTP
- Port 21
- Port 25
- Port 80 ✓ Correct answer
- Port 443
-
The HTTP response code 404 means:
Topic: Internet Protocols, DNS, URLs & HTTP
- OK
- Moved Permanently
- Bad Request
- Not Found ✓ Correct answer
-
In HTTP, response codes in the 500 range indicate:
Topic: Internet Protocols, DNS, URLs & HTTP
- Successful responses
- Redirection
- Client errors
- Server errors ✓ Correct answer
-
The most commonly used application stack, LAMP, consists of:
Topic: Internet Protocols, DNS, URLs & HTTP
- Linux, Apache, MySQL and PHP ✓ Correct answer
- Linux, Apache, MongoDB and Python
- Windows, IIS, SQL Server and ASP.NET
- Linux, Nginx, MySQL and PHP
-
MongoDB is given in the notes as an important example of:
Topic: Internet Protocols, DNS, URLs & HTTP
- A relational database
- A document-based database ✓ Correct answer
- A web server software
- A scripting language
-
In a 3-tier architecture, the second tier is responsible for:
Topic: Internet Protocols, DNS, URLs & HTTP
- Content display (presentation)
- Business logic for generating dynamic content ✓ Correct answer
- Storing data and managing the database
- Routing packets between networks
-
HTML stands for:
Topic: HTML Structure & Common Tags
- Hypertext Making Language
- Hypertext Markup Language ✓ Correct answer
- High-level Text Machine Language
- Hyperlink Text Mode Language
-
The W3C tool used to identify errors in an HTML page and give recommendations as warnings is the:
Topic: HTML Structure & Common Tags
- HTML compiler
- HTML validator ✓ Correct answer
- Browser console
- DOCTYPE declaration
-
An empty element in HTML is an element that:
Topic: HTML Structure & Common Tags
- Has no closing tag in XHTML
- Does not contain any text content; it is an instruction to the browser to do something ✓ Correct answer
- Cannot have attributes
- Is not supported in HTML5
-
When nesting HTML elements, the correct closing order is:
Topic: HTML Structure & Common Tags
- The outer element must be closed first
- The nested (inner) element must be closed first ✓ Correct answer
- Closing order does not matter
- Only the last opened tag needs closing
-
The DOCTYPE declaration, written at the start of an HTML document, is used to:
Topic: HTML Structure & Common Tags
- Link an external style sheet
- Inform the web server and browser that the document is an HTML document ✓ Correct answer
- Define the title of the document
- Start the body of the document
-
In an HTML document, external files, the document title and metadata are mentioned inside the:
Topic: HTML Structure & Common Tags
- <body> tag
- <div> tag
- <head> tag ✓ Correct answer
- <footer> tag
-
HTML provides how many levels of headings?
Topic: HTML Structure & Common Tags
- Three (h1-h3)
- Four (h1-h4)
- Six (h1-h6) ✓ Correct answer
- Ten (h1-h10)
-
Which of the following is a block element (it disrupts the flow and takes its own space)?
Topic: HTML Structure & Common Tags
- <a>
- <br>
- <div> ✓ Correct answer
- <span>
-
In the <img> tag, using the 'alt' attribute is mandatory because it:
Topic: HTML Structure & Common Tags
- Sets the size of the image
- Displays text against an image, which also helps the visually impaired ✓ Correct answer
- Links the image to another page
- Compresses the image file
-
In HTML character entities, < is used to display which character?
Topic: HTML Structure & Common Tags
- >
- < ✓ Correct answer
- (c)
- A non-breaking space
-
Links in HTML are created using the anchor element; the 'a' in the <a> tag stands for:
Topic: Links, Lists & Semantic HTML
- Address
- Anchor ✓ Correct answer
- Attribute
- Article
-
HTML provides three types of lists. A collection of items in no particular order, rendered by default as a bulleted list, is an:
Topic: Links, Lists & Semantic HTML
- Ordered list
- Unordered list ✓ Correct answer
- Description list
- Nested list
-
A description list is contained in the <dl> element and contains pairs of:
Topic: Links, Lists & Semantic HTML
- <li> and <ul> elements
- <dt> (term) and <dd> (description) elements ✓ Correct answer
- <th> and <td> elements
- <p> and <div> elements
-
Semantic HTML structuring adds meaning to a web page. Which of the following tags has NO semantic value and merely specifies formatting?
Topic: Links, Lists & Semantic HTML
- <em>
- <blockquote>
- <b> ✓ Correct answer
- <code>
-
Which of the following is NOT listed in the notes as an advantage of semantic structuring?
Topic: Links, Lists & Semantic HTML
- Maintainability
- Performance
- Accessibility
- Guaranteed top search-engine ranking for paid advertisers ✓ Correct answer
-
The <header> element must NOT be placed inside which of the following?
Topic: Links, Lists & Semantic HTML
- <body>
- <article>
- <footer>, <address> or another <header> ✓ Correct answer
- <section>
-
How many <main> elements (without a hidden attribute) can a single HTML document contain?
Topic: Links, Lists & Semantic HTML
- As many as needed
- Only one ✓ Correct answer
- Exactly two
- One per section
-
The <caption> element, which defines a table's heading, must be:
Topic: Links, Lists & Semantic HTML
- The last child of the <table> element
- Placed outside the <table> element
- The first child of its parent <table> element, and only one caption can be defined per table ✓ Correct answer
- Used once for every row of the table
-
Web development tools are divided into how many categories in the notes?
Topic: Web Development Tools
- Three
- Four
- Five ✓ Correct answer
- Six
-
WYSIWYG editors give a user experience similar to a word processor; the term WYSIWYG stands for:
Topic: Web Development Tools
- What You See Is What You Get ✓ Correct answer
- Web Yield System In Web Graphics
- What You Style Is What You Gain
- Wide Yielding Screen Interface Web Graphics
-
Eclipse, NetBeans and Visual Studio are given as examples of:
Topic: Web Development Tools
- Code editors
- WYSIWYG editors
- Full IDEs ✓ Correct answer
- Code playgrounds
-
CodePen, JSFiddle and CSS Deck are popular examples of:
Topic: Web Development Tools
- Cloud-based environments
- Code playgrounds, used to experiment with and share smaller snippets of code ✓ Correct answer
- WYSIWYG editors
- Full IDEs
-
CSS is a W3C standard used to describe:
Topic: CSS Fundamentals, Syntax & Values
- The structure of HTML documents
- The appearance (presentation) of HTML elements ✓ Correct answer
- The behaviour of web pages
- The content of databases
-
Using CSS for a whole site in a centralized file improves maintainability because:
Topic: CSS Fundamentals, Syntax & Values
- Each HTML file becomes larger
- Site-wide visual modifications can be made by changing a single file ✓ Correct answer
- Browsers no longer need to download HTML
- JavaScript is no longer required
-
A CSS rule consists of a selector followed by a series of property:value pairs, where each pair is called a:
Topic: CSS Fundamentals, Syntax & Values
- Cascade
- Declaration ✓ Correct answer
- Combinator
- Pseudo-class
-
In CSS, how many standard color names are available by name in the original set (before CSS3 extended the list)?
Topic: CSS Fundamentals, Syntax & Values
- 17 ✓ Correct answer
- 140
- 256
- 16
-
In an RGBa color value such as rgba(255,0,0,0.5), the 'a' (alpha) value of 0.0 means the color is:
Topic: CSS Fundamentals, Syntax & Values
- Fully opaque
- Fully transparent ✓ Correct answer
- Half transparent
- Invalid
-
In CSS, one point (pt) is equal to:
Topic: CSS Fundamentals, Syntax & Values
- 1/6 of an inch
- 1/96 of an inch
- 1/72 of an inch ✓ Correct answer
- 1/12 of an inch
-
Style rules placed within an HTML element via the style attribute are called:
Topic: CSS Selectors, Style Locations & the Cascade
- Embedded styles
- External styles
- Inline styles ✓ Correct answer
- Inherited styles
-
Embedded (internal) style sheets are placed inside which element of an HTML document?
Topic: CSS Selectors, Style Locations & the Cascade
- The <link> element in the <body>
- The <style> element inside the <head> element ✓ Correct answer
- The <script> element
- A separate .css file
-
External style sheets, the most common location for style rules, are text files with which extension?
Topic: CSS Selectors, Style Locations & the Cascade
- .html
- .js
- .css ✓ Correct answer
- .style
-
A class selector in CSS takes the form of:
Topic: CSS Selectors, Style Locations & the Cascade
- # followed by the class name
- . (period) followed by the class name ✓ Correct answer
- * followed by the class name
- @ followed by the class name
-
The attribute selector a[href$=".pdf"] matches <a> elements whose href attribute:
Topic: CSS Selectors, Style Locations & the Cascade
- Begins with '.pdf'
- Contains the text '.pdf' anywhere
- Ends with the text '.pdf' ✓ Correct answer
- Is exactly equal to 'href'
-
The :hover selector is a pseudo-class that selects:
Topic: CSS Selectors, Style Locations & the Cascade
- Links that have not been visited
- Elements that the mouse pointer is currently above ✓ Correct answer
- The first child of a parent element
- Form elements that are currently checked
-
CSS uses three cascade principles to deal with conflicting rules. They are:
Topic: CSS Selectors, Style Locations & the Cascade
- Inheritance, specificity and location ✓ Correct answer
- Float, position and display
- Selector, property and value
- Inline, embedded and external
-
Which of the following CSS properties is inheritable (passed to descendants)?
Topic: CSS Selectors, Style Locations & the Cascade
- Border
- Background
- Font ✓ Correct answer
- Margin (spacing)
-
Under the cascade principle of location, when two rules have the same specificity:
Topic: CSS Selectors, Style Locations & the Cascade
- The first rule in the file wins
- The latest rule is given more weight ✓ Correct answer
- Both rules are ignored
- The browser asks the user
-
In the content-box sizing model:
Topic: Box Model, Text Styling, Tables & Forms
- Width/height include the border and padding
- Width/height are applied to the contents only; borders and padding are counted separately ✓ Correct answer
- Margins are included in the width
- Width/height cannot be set
-
In the border-box sizing model:
Topic: Box Model, Text Styling, Tables & Forms
- Width/height include border and padding, while margins are counted separately ✓ Correct answer
- Width/height apply to contents only
- Margins are included in the width
- Padding is counted separately from the width
-
What happens to content that does not fit inside a box's set width and height can be controlled using the:
Topic: Box Model, Text Styling, Tables & Forms
- float property
- overflow property ✓ Correct answer
- z-index property
- visibility property
-
To make a table cell cover several columns or rows, you use the:
Topic: Box Model, Text Styling, Tables & Forms
- span and rowspan attributes
- colspan or rowspan attributes ✓ Correct answer
- width and height attributes
- border and padding attributes
-
When a form is submitted, the browser packages the user's input into a query string, which is:
Topic: Box Model, Text Styling, Tables & Forms
- A series of name=value pairs separated by ampersands (&) ✓ Correct answer
- A single encrypted value
- A list of values separated by commas
- An HTML table
-
With the GET method, the form data is located in ______, while with POST it is placed in the HTTP request after the HTTP variables (hidden from the user).
Topic: Box Model, Text Styling, Tables & Forms
- The browser history
- The URL of the request ✓ Correct answer
- A cookie
- The page title
-
Which statement about the POST method is correct according to the notes?
Topic: Box Model, Text Styling, Tables & Forms
- Submitted data is stored in the browser cache and history
- Data can be bookmarked
- Data can contain binary data and is not stored in cache, history or bookmarks ✓ Correct answer
- There is a strict limit on the number of characters
-
The <datalist> element, a new addition in HTML5, allows you to define:
Topic: Box Model, Text Styling, Tables & Forms
- A list of elements that can appear in a drop-down autocomplete-style list for a text element ✓ Correct answer
- A table of data
- A list of navigation links
- A list of style rules
-
Radio buttons are most useful when you want the user to:
Topic: Box Model, Text Styling, Tables & Forms
- Select multiple items from a long list
- Select a single item from a small list of choices, with all choices visible ✓ Correct answer
- Enter free text
- Pick a date
-
A date input control in HTML uses which format?
Topic: Box Model, Text Styling, Tables & Forms
- dd-mm-yyyy
- yyyy-mm-dd ✓ Correct answer
- mm/dd/yyyy
- yyyy-dd-mm
-
JPEG is a 24-bit, true-color format that is ideal for:
Topic: Image Formats, Layout & Responsive Design
- Simple logos with few colors
- Photographic and other continuous-tone images ✓ Correct answer
- Vector illustrations
- Animated images only
-
The GIF format is an 8-bit or less format, meaning it can contain no more than:
Topic: Image Formats, Layout & Responsive Design
- 16 colors
- 256 colors ✓ Correct answer
- 1024 colors
- 16.7 million colors
-
SVG (Scalable Vector Graphics) graphics have the advantage that they:
Topic: Image Formats, Layout & Responsive Design
- Always have smaller files than JPEG for photographs
- Do not lose quality when enlarged or reduced ✓ Correct answer
- Support at most 256 colors
- Use lossless photographic compression
-
Which of the following is a block-level element in normal flow (each on its own line)?
Topic: Image Formats, Layout & Responsive Design
- <span>
- <em>
- <a>
- <div> ✓ Correct answer
-
The default value of the CSS position property, in which the element is positioned according to the normal flow, is:
Topic: Image Formats, Layout & Responsive Design
- Relative
- Absolute
- Fixed
- Static ✓ Correct answer
-
An element with position: absolute is positioned in relation to:
Topic: Image Formats, Layout & Responsive Design
- The browser window (viewport)
- Its nearest positioned ancestor ✓ Correct answer
- The point where it would have been in normal flow
- The top of the page
-
The stacking order of positioned elements is defined by the z-index property; items on top (closest to the viewer) have:
Topic: Image Formats, Layout & Responsive Design
- A smaller z-index value
- A larger z-index value ✓ Correct answer
- A z-index of zero
- No z-index
-
The difference between hiding an element with display and with visibility is that:
Topic: Image Formats, Layout & Responsive Design
- display hides the element but keeps its space; visibility removes it from the flow
- display takes the item out of the flow as if it no longer exists, while visibility hides the element but its space remains ✓ Correct answer
- Both work exactly the same way
- visibility deletes the element from the HTML document
-
In a liquid (fluid) layout, widths are specified using:
Topic: Image Formats, Layout & Responsive Design
- Pixel units
- Percentage values ✓ Correct answer
- Points and picas
- Fixed inches
-
Which of the following is NOT one of the four key components that make responsive design work?
Topic: Image Formats, Layout & Responsive Design
- Liquid layouts
- Scaling images to the viewport size
- Setting viewports via the <meta> tag
- Using only fixed pixel widths for all elements ✓ Correct answer
-
CSS media queries, a key component of responsive design, are not supported by:
Topic: Image Formats, Layout & Responsive Design
- Internet Explorer 8 and earlier ✓ Correct answer
- All mobile browsers
- Chrome and Firefox
- Safari on iPhone
-
LESS, SASS and Stylus are examples of CSS preprocessors, which:
Topic: Image Formats, Layout & Responsive Design
- Compress images for the web
- Convert code written in a preprocessed language (with variables, functions, inheritance) into normal CSS ✓ Correct answer
- Validate HTML documents
- Provide grid systems only
-
Bootstrap consists of two parts:
Topic: Bootstrap
- HTML and PHP
- CSS and JavaScript ✓ Correct answer
- CSS and MySQL
- JavaScript and XML
-
Which of the following is NOT one of the three main ways to get Bootstrap?
Topic: Bootstrap
- Content Delivery Network (CDN)
- Web server / local machine
- Package managers
- Compiling it from HTML files ✓ Correct answer
-
Bootstrap's grid system uses how many columns?
Topic: Bootstrap
- 12 columns ✓ Correct answer
- 16 columns
- 24 columns
- 960 columns
-
In Bootstrap, content must be placed within which container?
Topic: Bootstrap
- A <div class="container-fluid"> only
- The <div class="row"> row container ✓ Correct answer
- A <table> element
- A <nav> element
-
How many theme-based colors are mentioned for Bootstrap (primary, secondary, success, info, warning, danger, light, dark)?
Topic: Bootstrap
- Six
- Seven
- Eight ✓ Correct answer
- Ten
-
JavaScript was introduced by Netscape in which of its browsers?
Topic: JavaScript Fundamentals
- Internet Explorer
- Navigator ✓ Correct answer
- Chrome
- Firefox
-
The commonly used version of ECMAScript referred to in the notes is:
Topic: JavaScript Fundamentals
- The Third Edition (ES3)
- The Fifth Edition (ES5)
- The Sixth Edition (ES6) ✓ Correct answer
- The Twelfth Edition
-
JavaScript code placed within a <script> element in the HTML page is called:
Topic: JavaScript Fundamentals
- Inline JavaScript
- Embedded JavaScript ✓ Correct answer
- External JavaScript
- Compiled JavaScript
-
External JavaScript files have which file extension?
Topic: JavaScript Fundamentals
- .java
- .js ✓ Correct answer
- .script
- .ecma
-
JavaScript variables are dynamically typed, which means:
Topic: JavaScript Fundamentals
- Their type must be declared with int, char or String
- The type of a variable is decided at runtime, so variables are declared with the var keyword without a type ✓ Correct answer
- Variables cannot change value
- Variables must be declared inside functions only
-
In JavaScript primitive data types, the variable stores the exact value, while in reference data types it stores:
Topic: JavaScript Fundamentals
- The exact value as well
- The address of the object ✓ Correct answer
- A copy of the object
- The object's name only
-
Which of the following is NOT one of the three mechanisms in JavaScript to view output?
Topic: JavaScript Fundamentals
- alert()
- console.log()
- document.write()
- print() dialog of the operating system ✓ Correct answer
-
The conditional (ternary) operator in JavaScript is notable because it is:
Topic: JavaScript Fundamentals
- The only operator that works on strings
- The only JavaScript operator that takes three operands ✓ Correct answer
- Used only inside switch statements
- Replaced by the if...else statement in ES6
-
In JavaScript arrays, which method removes the last element from an array?
Topic: JavaScript Fundamentals
- push()
- pop() ✓ Correct answer
- concat()
- length
-
Array indexes in JavaScript start from:
Topic: JavaScript Fundamentals
- 1
- 0 ✓ Correct answer
- -1
- Any value chosen by the programmer
-
The do...while loop differs from the while loop because:
Topic: JavaScript Fundamentals
- It never executes its statements
- Its condition is evaluated after executing the statement, so the statement executes at least once ✓ Correct answer
- It can only be used with arrays
- It has no condition
-
An anonymous function in JavaScript:
Topic: JavaScript Functions, Scope, Errors & Built-in Objects
- Has a name but no body
- Must be assigned to a variable ✓ Correct answer
- Cannot take parameters
- Is defined with the arrow symbol only
-
In nested functions, the inner function can access the variables and parameters of the outer function, but:
Topic: JavaScript Functions, Scope, Errors & Built-in Objects
- The outer function can also access variables defined inside the inner function
- The outer function cannot access variables defined inside the inner function ✓ Correct answer
- Neither can access the other's variables
- Only global variables can be accessed
-
A callback function is:
Topic: JavaScript Functions, Scope, Errors & Built-in Objects
- A function that calls itself
- A function passed as an argument to another function ✓ Correct answer
- A function defined inside the <head> element
- A function that handles errors
-
Anything declared outside of any function body in JavaScript is in the:
Topic: JavaScript Functions, Scope, Errors & Built-in Objects
- Local scope
- Function scope
- Global scope, accessible from any location in the program ✓ Correct answer
- Block scope
-
Declaring an array with a negative size, as in new Array(-5), throws which exception?
Topic: JavaScript Functions, Scope, Errors & Built-in Objects
- TypeError
- ReferenceError
- RangeError ✓ Correct answer
- SyntaxError
-
A programmer can generate (throw) an exception deliberately using which keyword?
Topic: JavaScript Functions, Scope, Errors & Built-in Objects
- catch
- throw ✓ Correct answer
- finally
- instanceof
-
The finally block in a try/catch statement:
Topic: JavaScript Functions, Scope, Errors & Built-in Objects
- Runs only when an exception occurs
- Runs only when no exception occurs
- Must be executed regardless of whether the try block is executed or not ✓ Correct answer
- Is used to define the exception type
-
In a regular expression, the pattern /\d+/ matches:
Topic: JavaScript Functions, Scope, Errors & Built-in Objects
- One or more digits (0-9) ✓ Correct answer
- Exactly one letter
- Any whitespace character
- Zero or more digits
-
Using prototypes, a method such as randomRoll() is defined once on the constructor's prototype so that:
Topic: JavaScript Functions, Scope, Errors & Built-in Objects
- Each instance gets its own separate copy of the method
- All instances share the single method definition, saving memory ✓ Correct answer
- The method can only be called once
- Instances can no longer be created with new
-
In the Document Object Model, any HTML document is represented in the form of a:
Topic: The Document Object Model (DOM)
- Table
- Tree ✓ Correct answer
- List of arrays
- Graph of servers
-
When an HTML document is built as a DOM tree in memory, everything in it becomes a node, including:
Topic: The Document Object Model (DOM)
- Only elements
- Elements, attributes and text only
- Elements, text, spaces and even newline characters ✓ Correct answer
- Only text nodes
-
The method document.getElementById() returns:
Topic: The Document Object Model (DOM)
- A NodeList of all matching elements
- A single node object/element, because each element's ID is unique ✓ Correct answer
- The URL of the current page
- All elements with a given class name
-
The difference between querySelector() and querySelectorAll() is that:
Topic: The Document Object Model (DOM)
- querySelector() returns all matches; querySelectorAll() returns the first match
- querySelector() returns the first matching node, while querySelectorAll() returns a NodeList of all matching elements ✓ Correct answer
- They are identical in behaviour
- querySelectorAll() works only with IDs
-
innerHTML is a property, not a function, so to replace an element's content you should:
Topic: The Document Object Model (DOM)
- Call node.innerHTML('...')
- Assign a value to it, e.g. node.innerHTML = '<h1>Hello world!</h1>' ✓ Correct answer
- Use node.innerHTML.push('...')
- Delete the element and recreate the page
-
Using a node's 'family relations' properties, you can navigate to related nodes such as:
Topic: The Document Object Model (DOM)
- parentNode, previousSibling, nextSibling, firstChild and lastChild ✓ Correct answer
- document.URL and document.inputEncoding
- getElementById and querySelector
- classList and style
-
Web 1.0, the first stage of the World Wide Web, is best characterized by:
Topic: Web & Internet Fundamentals
- Static, read-only web pages with no user interaction ✓ Correct answer
- User-generated content and social networking
- Machine-understandable (semantic) content
- Real-time multimedia streaming
-
In a cable Internet connection, the CMTS installed at the ISP's end, which connects multiple cable-modem users, stands for:
Topic: Web & Internet Fundamentals
- Central Modem Transfer System
- Cable Media Transmission Service
- Cable Modem Termination System ✓ Correct answer
- Computer Modem Telecommunication System
-
Which of the following is an inline element in HTML?
Topic: HTML Structure & Common Tags
- <div>
- <span> ✓ Correct answer
- <p>
- <h1>
-
In CSS, if the parent element has a font size of 16px, then a font-size of 3em is equal to:
Topic: CSS Fundamentals, Syntax & Values
- 19px
- 32px
- 3px
- 48px ✓ Correct answer
-
In CSS, the universal selector * is used to select:
Topic: CSS Selectors, Style Locations & the Cascade
- Only the first element of the page
- All elements on the page ✓ Correct answer
- Only elements having a specific class
- Only the root <html> element
-
The Arial font belongs to which font family?
Topic: Box Model, Text Styling, Tables & Forms
- Serif
- Monospace
- Sans-serif ✓ Correct answer
- Cursive
-
Bootstrap divides screens into five breakpoint sizes (xs, sm, md, lg, xl). The md (medium) breakpoint applies to screens with a minimum width of:
Topic: Bootstrap
- 576px
- 768px ✓ Correct answer
- 992px
- 1200px
-
In a Bootstrap row, a <div class="col-md-4"> placed together with a <div class="col-md-8"> will:
Topic: Bootstrap
- Overlap, because together they exceed the row width
- Force the second div onto the next row
- Sit side by side and together fill the full row (4 + 8 = 12 columns) ✓ Correct answer
- Use only 8 of the 12 columns of the row
-
What does the JavaScript expression Math.abs(-5) return?
Topic: JavaScript Functions, Scope, Errors & Built-in Objects
- -5
- 0
- 5 ✓ Correct answer
- 25
-
jQuery, a popular JavaScript library, is mainly used to simplify:
Topic: The Document Object Model (DOM)
- DOM manipulation, such as selecting elements and changing them ✓ Correct answer
- Running SQL queries on the web server
- Compiling JavaScript into machine code
- Creating database tables