Front End Development

Which image matches the flex layout defined in this style rule?

css .container { display: flex; } .container div:last-child { margin-left: auto; } ![B](images/Q1-B.jpg)

1.

![A](images/Q1-A.jpg)

2.

undefined

3.

![C](images/Q1-C.jpg)

4.

![D](images/Q1-D.jpg)

Q 1 / 61

Front End Development

Variables declared with the let keyword have what type of scope?

1.

function scope

2.

block scope

3.

inline scope

4.

global scope

Q 2 / 61

Front End Development

Why would you surround a piece of text with `<h1></h1>` tags?

1.

to indicate that this text is the main heading on the page

2.

to make the text bold

3.

to ensure that search engines treat the keywords as being important for this page

4.

to demonstrate to screen readers that this text is important

Q 3 / 61

Front End Development

When might an empty alt attribute be the correct value?

1.

when you cannot think of useful alt text

2.

when you don't think it would be interesting to someone who cannot see it

3.

when the image has come from a CMS

4.

when the image is purely decorative

Q 4 / 61

Front End Development

Which attribute must have a unique value each time it is used in an HTML document?

1.

title

2.

class

3.

style

4.

id

Q 5 / 61

Front End Development

Which CSS property will not trigger layout recalculation?

1.

top

2.

opacity

3.

width

4.

height

Q 6 / 61

Front End Development

What will be the value of selected?

javascript let pocket = ['turnip', 'stone', 'log', 'apple']; let selected = pocket[1];

1.

log

2.

apple

3.

stone

4.

turnip

Q 7 / 61

Front End Development

What does the `===` comparison operator do?

1.

It sets one variable equal to another in both value and type

2.

It tests for equality of type only

3.

It tests for equality of value only

4.

It tests for equality of value and type

Q 8 / 61

Front End Development

In the following code, the variable `fruit` has been assigned a value of apple. How would you change the value to plum?

javascript let fruit = 'apple';

1.

`let fruit = 'plum'`

2.

`var fruit = 'plum'`

3.

`const fruit = 'plum'`

4.

`fruit = 'plum'`

Q 9 / 61

Front End Development

What is the `<label>` element used for?

1.

to identify the difference parts of a figure

2.

to explain what needs to be entered into a form field

3.

as a caption for images

4.

as a heading for tables

Q 10 / 61

Front End Development

The browser finds some CSS that it does not understand. What is likely happen?

1.

The page will not display

2.

An error message will be displayed

3.

The browser will not load the stylesheet

4.

The browser will ignore the unknown CSS

Q 11 / 61

Front End Development

In this code, what is the term for the h1?

css h1 { color: red; font-size: 5em; }

1.

selector

2.

combinator

3.

declarator

4.

markup

Q 12 / 61

Front End Development

Which HTML will result in text being highlighted in yellow?

css .highlight { background-color: yellow; }

1.

`<span class="highlight">#BLM</span>`

2.

`<span style="highlight">#BLM</span>`

3.

`<highlight">#BLM</span>`

4.

`<div id="highlight">#BLM</span>`

Q 13 / 61

Front End Development

Which choice is not a value of the type attribute of the `<input>` element?

1.

range

2.

address

3.

date

4.

password

Q 14 / 61

Front End Development

You have used `display: none` in your stylesheet. Which users will be able to see or hear this content?

1.

all users

2.

users who can see the content on screen

3.

no users

4.

screen reader users

Q 15 / 61

Front End Development

Which choice is not part of CSS box model

1.

margin

2.

border

3.

padding

4.

paragraph

Q 16 / 61

Front End Development

Which part of the URL `https://app.uniswap.org/pool` specifies the domain name

1.

https

2.

org

3.

uniswap.org

4.

app.uniswap

Q 17 / 61

Front End Development

Which HTML element is not considered a landmark element?

1.

`<form>`

2.

`<ul>`

3.

`<main>`

4.

`<nav>`

Q 18 / 61

Front End Development

Which statement is true when an HTML tag has been deprecated?

1.

It employs code that can be viewed only on a desktop computer

2.

It is obsolete and is not recommended for use in marking web content

3.

It employs code that will require users to update their browsers

4.

It employs incorrect syntax that will cause the browser to crash

Q 19 / 61

Front End Development

How does the rem unit represent a font size?

1.

Font sizes are expressed relative to the font size of the containing div element

2.

Font sizes are expressed relative to the font size of the parent elements

3.

Font sizes are relative to the base font size of the operating system.

4.

Font sizes are relative to the root em unit used in the HTML element.

Q 20 / 61

Front End Development

Which HTML element represents either a scalar value within a known range a fractional value?

1.

`<meter>`

2.

`<range>`

3.

`<datalist>`

4.

`<optgroup>`

Q 21 / 61

Front End Development

What is Webpack primarily used for?

1.

sharing JavaScript code with other people

2.

making JavaScript-reliant sites accessible to users who do not have JavaScript turned on

3.

bundling individual JavaScript files for use in your website

4.

source control

Q 22 / 61

Front End Development

How many columns will there be, given this code?

css .container { width: 600px; column-width: 200px; column-gap: 50px; }

1.

one

2.

three

3.

four

4.

two

Q 23 / 61

Front End Development

Which style will change the color of the text?

![A](images/Q24.png) html <cite>Noam Chomsky</cite> css cite { text-color: cyan; } css cite { font-color: cyan; } css cite { color: cyan; } css cite { text: cyan; }

1.

A

2.

B

3.

C

4.

D

Q 24 / 61

Front End Development

You find this code in a stylesheet. What is it being used for?

css .cf::after { content: ''; display: block; clear: both; }

1.

inserting content that cannot be seen by screen readers

2.

fixing an Internet Explorer 11 bug

3.

clearing floats in float-based layouts

4.

creating a new block formatting context

Q 25 / 61

Front End Development

What is the correct way to initialize an array of galaxies in JavaScript?

1.

`String[

2.

`let galaxies = {Milky Way, Whirlpool, Andromeda};`

3.

`galaxies = ["Milky Way", "Whirlpool", "Andromeda"];`

4.

`var galaxies = {"Milky Way", "Whirlpool", "Andromeda"};`

Q 26 / 61

Front End Development

Which description correctly describes the initial values of flex items if the only thing you have done is apply `display: flex` to their parent?

1.

Items display in a row, lined up at the start, and do not stretch to fill the container

2.

Items display in a column, lined up at the start, and do not stretch to fill the container

3.

Items stay in a column until you add some flex properties.

4.

Items display in a row, lined up at the start, and stretch to fill the container

Q 27 / 61

Front End Development

Which line of code, if applied to all flex items in a flex container, would cause each flex item to take up an equal share of the total width of the container? For example, if there are four items, they would get 25% of each/

1.

`flex: 1 0 0;`

2.

`flex: initial;`

3.

`flex: 1 1 auto;`

4.

`flex: 1 0 auto;`

Q 28 / 61

Front End Development

A video on your webpage does not display and the console shows an error about mixed content. What is happening?

1.

The webapge is using a DOCTYPE, which renders it incapable of displayed video in addition to other web content.

2.

Your browser does not support HTML5 video.

3.

The video is from a source that cannot be displayed in your location for legal reasons.

4.

The page is loaded via HTTPS, but the video is being served insecurely as HTTP and the browser is blocking it.

Q 29 / 61

Front End Development

What will this loop print?

let max = 3; for (i = 0; i > max; i++) { document.write("skrt "); }

1.

skrt skrt skrt

2.

skrt skrt

3.

skrt skrt skrt skrt

4.

nothing

Q 30 / 61

Front End Development

You have placed an image in a directory named images and want to reference it from a page located in the root of your site. Which choice would correctly display the image on the page?

1.

< img src="image.jpg">

2.

< a href="images/image.jpg"></a>

3.

< img src="images/image.jpg">

4.

< img href="image.jpg">

Q 31 / 61

Front End Development

Which choice is a correct use of the parseInt() function in Javascript that parses a string and return an integer?

1.

parseInt("six");

2.

parse_int('6');

3.

parseInt("6");

4.

parseint("6");

Q 32 / 61

Front End Development

How can you rewrite this function using arrow function syntax?

1.

let product => (x,y) { <br /> x * y; <br />}

2.

let product = (x,y) => x*y;

3.

let product => x*y;

4.

let product = (x,y) -> x*y;

Q 33 / 61

Front End Development

Lighthouse is a tool for auditing your website. Which choice is not a category of report offered by Lighthouse?

1.

performance

2.

UX design

3.

accessibility

4.

SEO

Q 34 / 61

Front End Development

In the context of this code, how would you describe user?

const user = { given_name: 'Joe', family_name: 'Bloggs', age: 40, }

1.

function

2.

array

3.

variable

4.

object

Q 35 / 61

Front End Development

A webpage has `rel="preconnect"` added to a link resource. What will this do?

<link rel="preconnect" href="https://example.com">

1.

It will tell the browser that this link is a site belonging to the current domain.

2.

It will do nothing a because this is a deprecated attribute that browsers do not support.

3.

It will tell the browser that a connection will be made to another origin and to start getting ready as soon as possible.

4.

It will tell the browser that a resource is needed, and that it should start getting fetched as soon as possible.

Q 36 / 61

Front End Development

Which choice is _not_ a render blocking resource?

1.

images

2.

HTML

3.

CSS

4.

JavaScript

Q 37 / 61

Front End Development

Which choice does _not_ provide information on browser support for a particular CSS property?

1.

the "Can I Use" website

2.

the Web Platform Tests Suite

3.

the CSS specification

4.

MDN property pages

Q 38 / 61

Front End Development

You have a set of images that are slightly different sizes and aspect ratios. You don't mind if you crop off some of the image, but you want each image to completely fill a square box without being distorted. Which property and value would achieve this?

1.

object-fit: contain

2.

object-fit: stretch

3.

object-fit: all

4.

object-fit: cover

Q 39 / 61

Front End Development

what does the CSS selector a[href$="org"] select?

1.

all <a> tags whose href attribute begins with "org"

2.

all <a> tags whose href attribute equals "org"

3.

all <a> tags whose href attribute ends with "org"

4.

all <a> tags whose href attribute contains "org"

Q 40 / 61

Front End Development

Which choice <em>is not</em> of invoking strict mode in JavaScript?

1.

it eliminates some JavaScript silent errors by changing them to throw errors.

2.

it prohibits some syntax likely to be defined in future versions of ECMAScript.

3.

it forces the writing of valid HTML and CSS.

4.

it fixes mistakes that make it difficult for JavaScript engines to perform optimizations.

Q 41 / 61

Front End Development

In normal flow, some elements display as block elements default and others inline. which choice contains only block-level by default elements?**

1.

ul, li, a

2.

p, b, h3

3.

div, p, em

4.

div, main, h1

Q 42 / 61

Front End Development

Which line would you add to this code to add "Cosmos" to the list of currencies using JavaScript?

javascript var currencies = ['Bitcoin', 'Ethereum']; /* Missing line */ console.log(currencies);

1.

`currencies.push("Cosmos");`

2.

`Array.append("Cosmos", currencies);`

3.

`currencies.add("Cosmos");`

4.

`currencies(2) = "Cosmos";`

Q 43 / 61

Front End Development

How would you change this code to make Vanilla selected by default?

javascript <input type="radio" value="strawberry">Strawberry <input type="radio" value="vanilla">Vanilla <input type="radio" value="chocolate">Chocolate

1.

`<input type="radio" value="vanilla" checked>`

2.

`<input type="radio" value="vanilla" check>`

3.

`<input type="radio" value="vanilla" selected>`

4.

`<input type="radio" value="vanilla" on>`

Q 44 / 61

Front End Development

**_** moves an element completely out of the page's normal layout flow, like it is sitting on its own separate layer. From there, you can fix it in a position relative to the edges of the page's `<html>` element (or its nearest positioned ancestor element)?

**position: absolute;** `An element with position: absolute; is positioned relative to the nearest positioned ancestor (instead of positioned relative to the viewport, like fixed). However; if an absolute positioned element has no positioned ancestors, it uses the document body, and moves along with page scrolling.`

1.

Sticky positioning

2.

Absolute positioning

3.

Relative positioning

4.

Fixed positioning

Q 45 / 61

Front End Development

You have created a box that has a height set with CSS. Which line of CSS would add scroll bars if the content is taller than the box, but leave no visible scroll bars if the content fits into the box?

1.

.box { overflow: scroll; }

2.

.box { overflow: scroll-x; }

3.

.box { overflow: auto; }

4.

.box { overflow: none; }

Q 46 / 61

Front End Development

Which array method should you apply to run a function for every item within an array, returning an array of all items for which the function is true?

1.

every()

2.

map()

3.

forEach()

4.

filter()

Q 47 / 61

Front End Development

The image below has float: left applied. Text wraps the float on the right and bottom. How would you force the second paragraph to start underneath the float, leaving a gap after the preceding paragraph?

![CSS clear](images/Q48.png?raw=true) **clear: left;** `When we use the float property, and we want the next element below (not on right or left), we will have to use the clear property. When clearing floats, you should match the clear to the float: If an element is floated to the left, then you should clear to the left. Your floated element will continue to float, but the cleared element will appear below it on the web page.`

1.

Apply `float: left` to the second paragraph.

2.

Apply `clear: right` to the floated item.

3.

Apply `clear: left` to the second paragraph.

4.

Apply `clear: left` to the floated item.

Q 48 / 61

Front End Development

You want to create striped table rows using CSS without adding a class to any element. Which CSS would correctly apply the background color to every odd row in your table?

1.

`tr:nth-child(2) { background-color: #ccc; }`

2.

`tr:nth-child(2n+1) { background-color: #ccc; }`

3.

`tr:nth-child(2+1) { background-color: #ccc; }`

4.

`tr:nth-child(2n) { background-color: #ccc; }`

Q 49 / 61

Front End Development

You are designing a site and creating a navigation bar linking to the main sections. Which HTML element should you use to indicate that this is the main navigation?

1.

`<nav>`

2.

`<navigation>`

3.

`<main>`

4.

`<ul>`

Q 50 / 61

Front End Development

You discover that CSS is being loaded on a website using the following code. Why might a web developer have done this?

`<link rel="preload" href="styles.css" as="style" onload="this.onload=null;this.rel='stylesheet'"><noscript><link rel="stylesheet" href="style.css"></noscript>`

1.

The CSS is being loaded asynchronously in order to prevent render blocking.

2.

This will stop the CSS being loaded for old browsers that do not support the techniques in use.

3.

This is part of a stylesheet-switching script to load different themes for the site.

4.

This will stop the CCS being loaded on slow data connections.

Q 51 / 61

Front End Development

The flex property is often applied to flex items with a value of 1. Using flex: 1 is a shorthand - what does it unpack to?

1.

flex: 0 0 100;

2.

flex: 1 0 0;

3.

flex: 0 0 auto;

4.

flex: 1 1 auto;

Q 52 / 61

Front End Development

What does the term "tree shaking" mean with regard to JavaScript performance?

1.

only using code that is supported by the newest browsers, and serving the site without JavaScript to old browsers

2.

removing unused code from the JavaScript files

3.

splitting code into various bundles so that decisions can be made on loading priority

4.

allowing the browser to ignore code it believes will perform badly

Q 53 / 61

Front End Development

What is WebP?

1.

a method of auditing performance that gives your site a score, which is then used for Google ranking

2.

a next-generation image format offering a smaller file size than equivalent PNG or JPEG images

3.

a new font format that allows a single font to display at different styles and weights

4.

a next-generation PDF format that offers a smaller file size and better accessibility than standard PDF documents

Q 54 / 61

Front End Development

Your website uses CSS Grid Layout extensively, and a visitor who navigates using the keyboard tells you that they seem to jump erratically all over the screen when navigating. What is the most likely problem?

1.

The visitor's browser does not have full support for CSS Grid Layout.

2.

Items have been positioned in such a way that they are in a different order to the source.

3.

The browser has a keyboard navigation bug.

4.

You need to add the tabindex attribute to elements.

Q 55 / 61

Front End Development

What is the definition of the phrase “Time to Interactive”?

1.

when the browser displays the first bit of content from the DOM

2.

when the user can consistently interact with all of the page elements

3.

when HTML has loaded, but not necessarily JavaScript, CSS, or images

4.

when the user can see the webpage on the screen

Q 56 / 61

Front End Development

What is yarn?

1.

a JavaScript framework that is leaner than React

2.

a JavaScript bundler

3.

a testing framework

4.

a JavaScript package manager

Q 57 / 61

Front End Development

What is the name of the event that occurs when the mouse pointer hovers over an element?

1.

load

2.

mouseover

3.

hover

4.

focus

Q 58 / 61

Front End Development

What is meant by the term "polyfill" when used in web development?

1.

It is a piece of code that provides modern functionality in browsers that do not support it.

2.

It is a piece of code that hides broken content from old browsers.

3.

It is a term for languages such as Saas that compliles to CSS.

4.

It is a script that runs to add vendor prefixes to modern CSS.

Q 59 / 61

Front End Development

Which choice is _not_ a JavaScript framework?

1.

Angular

2.

Laravel

3.

Vue

4.

React

Q 60 / 61

Front End Development

What does setting `aria-live=polite` on a live region achieve?

1.

The screen reader will not notify the user of changes to live regions.

2.

The screen reader will wait until there is a pause to announce changes.

3.

The screen reader will announce all changes immediately.

4.

The screen reader will use a polite voice when announcing changes.

Q 61 / 61