Certification Answers

HubSpot CMS for Developers II: Best Practices Certification Answers 2024

What you’ll learn:

  • Learn best practices related to web accessibility, website performance, HubSpot themes, and SEO.

  • Learn how to apply best practices in the real world from a HubSpot partner agency and two HubSpot engineers.
  • Apply your learning from the course by completing the hands-on practicum.

COURSE CURRICULUM

  • Web Accessibility
  • Website Performance
  • Themes, Sections, and Modules
  • SEO for HubSpot CMS Developers
  • Case Studies: Applying Best Practices in the Real World

HubSpot CMS for Developers II: Best Practices

FREE Certification Course : As a web developer, you’re responsible for creating websites that delight your customers and generate leads for your business. It’s not enough, however, for your website to look great — it also needs to be accessible, fast, and search-friendly. Additionally, the themes and modules you develop should be easy for content editors and developers to manage. In this course, explore how to develop websites that prioritize web accessibility, performance optimization, SEO, and HubSpot-specific best practices.
https://academy.hubspot.com/courses/cms-for-developers-best-practices

Certification Questions & Certification Answers

A ____________ status code indicates a temporary redirect.

  • 200
  • 301
  • 302
  • 404

Correct Answer :

  • 302

A skip to content link should skip to which landmark element on the page?

  1. nav
  2. main
  3. header
  4. section

Correct Answer :

  • main

Consider the line of code below. If you were to load a script in this way, what would be the result? {{ require_js(get_asset_url(“./path/to/file.js”), { async: true }) }}

  1. The script would be added to the head of the document with an async attribute.
  2. The script would be added before the closing body tag with a defer attribute.
  3. The script would be added to the head of the document with a defer attribute.
  4. The script would be added before the closing body tag with an async attribute.

Correct Answer :

  • The script would be added before the closing body tag with an async attribute.

Consider this scenario: You are loading a script (script 1) on your page which two other scripts rely on to function (scripts 2 and 3). All of these scripts can be safely executed after construction of the DOM. Which of the following approaches would work when loading these scripts? Select all that apply.

  1. Load all of the scripts asynchrously so they don’t block DOM construction while the browser fetches them, but make sure to include script 1 first in the HTML.
  2. Load script 1 normally (without an async or defer) attribute and load scripts 2 and 3 with the defer attribute.
  3. Load all 3 scripts with the defer attribute, making sure to include script 1 first in the HTML.
  4. It doesn’t matter. The scripts can be executed in any order.

Correct Answer :

  • Load all of the scripts asynchrously so they don’t block DOM construction while the browser fetches them, but make sure to include script 1 first in the HTML.
  • Load script 1 normally (without an async or defer) attribute and load scripts 2 and 3 with the defer attribute.

Creating a form that can be completed and submitted using the keyboard only adheres to which WCAG principle?

  1. Robustness
  2. Perceivability
  3. Understandability
  4. Operability

Correct Answer :

  • Operability

Creating a user interface that is consistent across pages adheres to which WCAG principle?

  1. Perceivability
  2. Operability
  3. Understandability
  4. Robustness

Correct Answer :

  • Understandability

Fill in the blank. Defer loading of non-critical CSS by adding ______ as an argument in your require_css function call.

  1. { defer: true }
  2. { position: footer }
  3. { type: defer }
  4. { async: true }

Correct Answer :

  • { async: true }

Fill in the blank. If you want a page that’s temporarily down to still appear in search results for some time, use _____________.

  1. a permanent redirect
  2. your site’s robots.txt file
  3. the noindex meta tag
  4. a temporary redirect

Correct Answer :

  • a temporary redirect

Fill in the blank. Many browsers support native image lazy-loading using the _________ attribute.

  1. defer
  2. async
  3. preload
  4. loading

Correct Answer :

  • loading

Fill in the blank. To provide a good user experience, a Largest Contentful Paint of ___________ or less is recommended.

  1. 3 seconds
  2. 5 seconds
  3. 2.5 seconds
  4. 1 second

Correct Answer :

  • 2.5 seconds

Fill in the blank: Add the ________ attribute to your script to tell the browser to execute it after construction of the DOM.

  1. defer
  2. preload
  3. async
  4. integrity

Correct Answer :

  • defer

Fill in the blank: Adding width and height attributes to images helps reduce _________________.

  1. First Input Delay
  2. Total Blocking Time
  3. Cumulative Layout Shift
  4. Time to Interactive

Correct Answer :

  • Cumulative Layout Shift

Fill in the blank: Google displays structured data in SERPs as _________.

  1. featured snippets
  2. a blog post schema
  3. a featured image
  4. rich results

Correct Answer :

  • rich results

Fill in the blank: Google recommends a font size of at least _______ on at least 60% of the text on your page.

  1. 14px
  2. 16px
  3. 12px
  4. 18px

Correct Answer :

  • 12px

Fill in the blank: Google recommends that tap targets should be at least ___________ apart from each other.

  1. 8px
  2. 10px
  3. 12px
  4. 16px

Correct Answer :

  • 8px

Fill in the blank: Google’s main crawler is known as __________.

  1. Google Spider
  2. Searchbot
  3. the Google Crawler
  4. Googlebot

Correct Answer :

  • Googlebot

Fill in the blank: If you want a page’s new URL to appear in search results, use _____________.

  1. a temporary redirect
  2. structured data
  3. a permanent redirect
  4. your website’s sitemap

Correct Answer :

  • a permanent redirect

Fill in the blank: Sitemaps are _______ files that provide search engines information about the structure of your site.

  1. HTML
  2. JSON-LD
  3. JavaScript
  4. XML

Correct Answer :

  • XML

Fill in the blank: The ___________ is a combination of both the DOM and CSSOM.

  1. render tree
  2. Largest Contentful Paint
  3. Cumulative Layout Shift
  4. Critical Rendering Path

Correct Answer :

  • render tree

Fill in the blank: The primary function of a robots.txt file is_______________.

  1. to prevent pages from appearing in search results
  2. to tell search engines about which of your site’s pages you’d like them to crawl
  3. to prevent your site from being overloaded with requests by crawlers
  4. to control exactly which pages appear in search results

Correct Answer :

  • to prevent your site from being overloaded with requests by crawlers

Fill in the blank: Use a _________ class to hide elements visually while keeping them accessible to screen readers.

  1. h4
  2. sr-only
  3. header
  4. form-label

Correct Answer :

  • sr-only

Fill in the blank: Use the ________ statement to use the same base template across multiple page templates.

  1. include
  2. extends
  3. set
  4. require_html

Correct Answer :

  • extends

Fill in the blank: Use the __________ tag to include multiple CSS partial files within a single CSS file.

  1. include
  2. require_css
  3. scope_css
  4. extends

Correct Answer :

  • include

Fill in the blank: When a boolean field controls a major layout change, use a _________.

  1. field group
  2. checkbox
  3. content field
  4. toggle switch

Correct Answer :

  • toggle switch

Fill in the blank: Your page must undergo_________, in order for Google to view any JavaScript-generated content.

  1. rendering
  2. indexing
  3. ranking
  4. crawling

Correct Answer :

  • rendering

Fill in the blank: _______ is the process through which all unnecessary characters are removed from a file.

  1. Minification
  2. Fetching
  3. Caching
  4. Deferring

Correct Answer :

  • Minification

Fill in the blank: _____________ refers to how long it takes the browser to take your site’s files and paint the pixels to the page.

  1. Loading performance
  2. First Input Delay
  3. Time to Interactive
  4. Rendering performance

Correct Answer :

  • Rendering performance

If your site has consistently poor Total Blocking Time scores, which approach should you take to improve this metric?

  1. Remove all videos from your site that are 1MB or larger
  2. Optimize images and use srcset and sizes attributes to provide the browser multiple image options depending on the user’s device
  3. Self-host fonts instead of fetching them from a third party
  4. Reduce the total amount of JavaScript loaded on your site while also efficiently loading the site’s JavaScript

Correct Answer :

  • Reduce the total amount of JavaScript loaded on your site while also efficiently loading the site’s JavaScript

In the CMS Boilerplate, what is the filename of the common template used as the foundation for all page templates?

  1. layout.html
  2. index.html
  3. home.html
  4. base.html

Correct Answer :

  • base.html

Providing text alternatives for non-text content adheres to which WCAG principle?

  1. Perceivability
  2. Operability
  3. Understandability
  4. Robustness

Correct Answer :

  • Perceivability

Scenario: Your colleague has told you that they’d like a landing page to not appear in search results. You notice that this landing page URL is already disallowed in robots.txt. What should you do to guarantee the page doesn’t appear in Google’s search results?

  1. Add a noindex meta tag to the page
  2. Remove the page’s URL from the robots.txt file and add a noindex meta tag to the page
  3. Nothing. Because the page URL is already disallowed in robots.txt, it can never appear in Google’s search results
  4. Remove the meta title and description from the page so that Google can’t display it in SERPs.

Correct Answer :

  • Remove the page’s URL from the robots.txt file and add a noindex meta tag to the page

Select all that apply. How can you help content creators more easily work with modules?

  1. Use a description of the elements in the module to name it
  2. Include help text that describes the module
  3. Name a module using its purpose (e.g., “Sign up module”)
  4. Include default content for required module fields

Correct Answer :

  • Use a description of the elements in the module to name it
  • Include help text that describes the module
  • Name a module using its purpose (e.g., “Sign up module”)
  • Include default content for required module fields

Select all that apply. What are some web accessibility best practices you should account for near the beginning of a project?

  1. Creating large enough clickable areas in prototypes
  2. Designing copy and buttons with sufficient color contrast
  3. Testing all of your project’s custom modules for accessibility
  4. Being thoughtful about the tab order of your site

Correct Answer :

  • Creating large enough clickable areas in prototypes
  • Designing copy and buttons with sufficient color contrast
  • Being thoughtful about the tab order of your site

Select all that apply. What can you do to optimize images within a custom module?

  1. Set the image’s loading attribute to “lazy,” by default
  2. Add width and height attributes to the image
  3. Use the resize_image_url function to resize the image
  4. Use srcset and sizes attributes

Correct Answer :

  • Set the image’s loading attribute to “lazy,” by default
  • Add width and height attributes to the image
  • Use the resize_image_url function to resize the image
  • Use srcset and sizes attributes

Select all that apply. What can you use sitemaps for?

  1. To stop content from being crawled and indexed
  2. To tell search engines about what pages and files you think are important on your site
  3. To help search engines find and understand media content and news articles
  4. To control what pages appear in search results and the order in which they appear

Correct Answer :

  • To tell search engines about what pages and files you think are important on your site
  • To help search engines find and understand media content and news articles

Select all that apply. What is Cumulative Layout Shift?

  1. A Core Web Vital
  2. A measure of loading performance
  3. A measure of interactivity
  4. A measure of visual stability

Correct Answer :

  • A Core Web Vital
  • A measure of visual stability

Select all that apply. What is First Input Delay?

  1. A measure of interactivity
  2. Another term for Time to Interactive
  3. A measure of loading performance
  4. A Core Web Vital

Correct Answer :

  • A measure of interactivity
  • A Core Web Vital

Select all that apply. What is a canonical URL?

  1. Something that’s useful if you have a single page accessible by multiple URLs
  2. The URL to the duplicate version of a main pillar page
  3. The URL to the version of a page that should be crawled and indexed
  4. Something that’s useful if you have multiple pages with similar content

Correct Answer :

  • Something that’s useful if you have a single page accessible by multiple URLs
  • The URL to the version of a page that should be crawled and indexed
  • Something that’s useful if you have multiple pages with similar content

Select all that apply. When it comes to SEO, developers are usually responsible for:

  1. Some elements of technical SEO.
  2. Some elements of off-page SEO.
  3. Some elements of on-page SEO.
  4. Implementing structured data.

Correct Answer :

  • Some elements of technical SEO.
  • Some elements of on-page SEO.
  • Implementing structured data.

Select all that apply. When might you use a redirect?

  1. When moving your site to a new domain
  2. When you’ve moved a page to a new URL
  3. When you have multiple URLs for your site
  4. When you need to prevent a page from appearing in search results

Correct Answer :

  • When moving your site to a new domain
  • When you’ve moved a page to a new URL
  • When you have multiple URLs for your site

Select all that apply. When performing manual keyboard testing on your page, what should you check for?

  1. That the appropriate elements receive focus
  2. That images have alternative text
  3. That focused elements have an outline or other visual indicator so they can be easily identified
  4. That the tab order makes intuitive sense

Correct Answer :

  • That the appropriate elements receive focus
  • That focused elements have an outline or other visual indicator so they can be easily identified
  • That the tab order makes intuitive sense

Select all that apply. When should you create a section template instead of a module?

  1. When you want to create a fixed layout page area for content editors to use
  2. When you have multiple page elements organized in a specific layout
  3. When you want to provide maximum flexibility to content editors
  4. When you want to create a full-width page area

Correct Answer :

  • When you want to create a fixed layout page area for content editors to use
  • When you have multiple page elements organized in a specific layout

Select all that apply. Where can you access a brand color that you’ve set in the account’s brand settings?

  1. Within an HTML + HubL file
  2. Within a CSS + HubL file
  3. Within a module’s fields.json file
  4. Within a theme’s fields.json file

Correct Answer :

  • Within an HTML + HubL file
  • Within a CSS + HubL file
  • Within a module’s fields.json file
  • Within a theme’s fields.json file

Select all that apply. Where can you access a brand logo that you’ve set in your account’s brand settings?

  1. Within HTML + HubL files
  2. Within CSS + HubL files
  3. Within a module’s fields.json file
  4. Within a theme’s fields.json file

Correct Answer :

  • Within HTML + HubL files
  • Within CSS + HubL files
  • Within a module’s fields.json file

Select all that apply. Which elements should receive focus as you tab through a web page?

  1. button elements
  2. anchor elements
  3. h1 elements
  4. input elements

Correct Answer :

  • button elements
  • anchor elements
  • input elements

Select all that apply. Which of the following are Core Web Vitals?

  1. Total Blocking Time
  2. First Input Delay
  3. First Contentful Paint
  4. Cumulative Layout Shift

Correct Answer :

  • Total Blocking Time
  • First Input Delay
  • Cumulative Layout Shift

Select all that apply. Which of the following are HTML semantic elements?

  1. span
  2. main
  3. header
  4. nav

Correct Answer :

  • main
  • header
  • nav

Select all that apply. Which of the following are examples of render-blocking resources?

  1. CSS files
  2. Large video files
  3. Font files
  4. JavaScript files

Correct Answer :

  • CSS files
  • JavaScript files

Select all that apply. Which of the following are good examples of descriptive link text?

  1. View our course catalog
  2. Learn more
  3. Fill out our contact form
  4. Click here

Correct Answer :

  • View our course catalog
  • Fill out our contact form

Select all that apply. Which of the following best describes modules?

  1. Good for reorganizing into custom layouts
  2. Atomic
  3. Span less than the full width of the page
  4. Full-width, fixed layout elements

Correct Answer :

  • Good for reorganizing into custom layouts
  • Atomic
  • Span less than the full width of the page

Select all that apply. Which of the following fields should you include in your theme’s fields.json file?

  1. Color and font controls for forms
  2. Global color fields
  3. Global font fields
  4. Color and font controls for buttons

Correct Answer :

  • Color and font controls for forms
  • Global color fields
  • Global font fields
  • Color and font controls for buttons

Select all that apply. Which of the following is an example of a web accessibility optimization that also benefits most of your users?

  1. Using generic link text like “click here”
  2. Using sufficient color contrast between foreground text and the background
  3. Removing the outline from focused elements
  4. Developing a well-organized user interface

Correct Answer :

  • Using sufficient color contrast between foreground text and the background
  • Developing a well-organized user interface

Select all that apply. Which of the following make page navigation more efficient for those using assistive technology?

  1. A skip to content link
  2. A valid heading hierarchy
  3. Landmarks
  4. Including labels for form controls

Correct Answer :

  • A skip to content link
  • A valid heading hierarchy
  • Landmarks

Select all that apply. Which of the following module elements would be a good candidate for a style field?

  1. Text color
  2. An image with alternative text
  3. A button link
  4. A background image

Correct Answer :

  • Text color
  • A background image

Select all that apply. Which of the following will prevent a page from appearing in Google’s search results?

  1. Adding a noindex meta tag to the page
  2. Disallowing crawling of the page in robots.txt
  3. Password-protecting the page
  4. Omitting the page’s meta title and description

Correct Answer :

  • Adding a noindex meta tag to the page
  • Disallowing crawling of the page in robots.txt
  • Password-protecting the page
  • Omitting the page’s meta title and description

Select all that apply. Which style fields have a generated .css property?

  1. Border
  2. Gradient
  3. Width
  4. Background image

Correct Answer :

  • Border
  • Gradient
  • Width
  • Background image

Select all that apply: In order to account for mobile-first indexing, you should:

  1. Create a mobile-friendly website.
  2. Use the same content on your mobile site as your desktop site.
  3. Maintain separate and different versions of your mobile and desktop sites.
  4. Use the same meta tags on both the desktop and mobile versions of your site.

Correct Answer :

  • Create a mobile-friendly website.
  • Use the same content on your mobile site as your desktop site.
  • Use the same meta tags on both the desktop and mobile versions of your site.

The WCAG are broadly divided into four principles. Which of the following is NOT one of those principles?

  1. Operable
  2. Perceivable
  3. Comprehensible
  4. Understandable

Correct Answer :

  • Comprehensible

The ____________ is the browser’s representation of the page’s styles.

  1. First Contentful Paint
  2. DOM
  3. render tree
  4. CSSOM

Correct Answer :

  • CSSOM

To make it easier for individuals using assistive technology to navigate your page, use _________ to organize the page’s content.

  1. sufficient color contrast
  2. non-semantic elements
  3. landmarks
  4. alternative text

Correct Answer :

  • landmarks

True or false: Using structured data guarantees that Google will make a rich snippet for your page.

  1. True
  2. False

Correct Answer :

  • False

True or false? All themes must contain at least 10 section templates.

  1. True
  2. False

Correct Answer :

  • False

True or false? Automated testing is sufficient to test for appropriate use of alternative text.

  1. True
  2. False

Correct Answer :

  • False

True or false? Comprehensive knowledge of the WCAG is necessary before beginning to implement web accessibility best practices.

  1. True
  2. False

Correct Answer :

  • False

True or false? Every element should have alternative text.

  1. True
  2. False

Correct Answer :

  • False

True or false? If your website doesn’t have automatically detectable accessibility issues, it might still have accessibility barriers.

  1. True
  2. False

Correct Answer :

  • True

True or false? Part of making a form input accessible is including include a label for the input.

  1. True
  2. False

Correct Answer :

  • True

True or false? Sections provide a built-in way to set a background image.

  1. True
  2. False

Correct Answer :

  • True

True or false? You can add a brand setting token to a theme’s fields.json file to allow content editors to edit its value.

  1. True
  2. False

Correct Answer :

  • True

What effect will this line in robots.txt have on Google’s crawling behavior? # Disallow: /

  1. It will disallow crawling of every page and resource on the site
  2. It will disallow crawling of the home page only
  3. It will allow crawling of the home page only
  4. It will not have any effect on crawling

Correct Answer :

  • It will not have any effect on crawling

What is Largest Contentful Paint?

  1. A measure of how long it takes the browser to load and render the largest element visible in the viewport
  2. A measure of how long it takes the browser to render the first piece of DOM content after a user navigates to your page
  3. A measure of visual stability
  4. Both A & C

Correct Answer :

  • A measure of how long it takes the browser to load and render the largest element visible in the viewport

What is the final step of the Critical Rendering Path?

  1. Layout
  2. Paint
  3. Interactivity
  4. Construction of the render tree

Correct Answer :

  • Paint

What is the first step of the Critical Rendering Path?

  1. Construction of the CSSOM
  2. Parsing of the HTML and construction of the DOM
  3. Calculating the position and styles of each element
  4. Sending a GET request to the server for the page’s HTML

Correct Answer :

  • Parsing of the HTML and construction of the DOM

What is the recommended format for adding structured data to pages?

  1. JSON
  2. Microdata
  3. JSON-LD
  4. RDFa

Correct Answer :

  • JSON-LD

What would you use to access the tertiary brand color in a theme’s fields.json file?

  1. brandSettings.colors[2]
  2. brandSettings.TertiaryColor
  3. brandSettings.colors[3]
  4. brandSettings.tertiaryColor

Correct Answer :

  • brandSettings.colors[2]

Which HubL function can you use to control the size of the images that appear on your website?

  1. require_js
  2. resize_image_url
  3. require_css
  4. get_asset_url

Correct Answer :

  • resize_image_url

Which file does the CMS Boilerplate use to apply the styles set in the theme’s settings?

  1. main.css
  2. fields.css
  3. theme-overrides.css
  4. _layout.css

Correct Answer :

  • theme-overrides.css

Which of the following is NOT a common accessibility error found on web pages?

  1. Missing h4 elements
  2. Missing form input labels
  3. Missing alternative text for images
  4. Low contrast text

Correct Answer :

  • Missing h4 elements

Which of the following is NOT a component of how a web page ends up in search results?

  1. Rendering
  2. Navigating
  3. Indexing
  4. Crawling

Correct Answer :

  • Navigating

Which of the following is NOT a step in the Critical Rendering Path?

  1. Paint
  2. Layout
  3. Creation of the render tree
  4. First Input Delay

Correct Answer :

  • First Input Delay

Which of the following is NOT a valid brand logo attribute?

  1. brandSettings.primaryLogo.alt
  2. brandSettings.primaryLogo.url
  3. brandSettings.primaryLogo.width
  4. brandSettings.primaryLogo.src

Correct Answer :

  • brandSettings.primaryLogo.url

Which of the following is NOT a web accessibility best practice?

  1. Including a skip to content link
  2. Removing the outline from focused elements using CSS
  3. Using landmark elements
  4. Including labels for form inputs

Correct Answer :

  • Removing the outline from focused elements using CSS

Which of the following is NOT an element of manual accessibility testing?

  1. Using a browser extension to audit your page
  2. Keyboard testing
  3. Zooming in on your page using the browser’s native zooming feature
  4. Screen reader testing

Correct Answer :

  • Using a browser extension to audit your page

Which of the following is most likely to block page interactivity?

  1. Inline CSS
  2. Large video files
  3. Unoptimized images
  4. Heavy JavaScript execution

Correct Answer :

  • Heavy JavaScript execution

Which of the following section template annotations will help a content editor easily visualize a section in the page editor?

  1. label
  2. description
  3. templateType
  4. screenshotPath

Correct Answer :

  • screenshotPath

Which of the following would be NOT be an appropriate class name to use in a theme called “Blue Horizons”?

  1. bh-button
  2. blue-horizons-header
  3. button
  4. bh-header

Correct Answer :

  • button

Within a module, where should you place instance-specific styles?

  1. Within the module.css portion of the module
  2. Within the module.html portion of the module
  3. Within the module.js portion of the module
  4. Within the module’s meta.json file

Correct Answer :

  • Within the module.html portion of the module

Writing valid HTML adheres to which WCAG principle?

  1. Perceivability
  2. Operability
  3. Understandability
  4. Robustness

Correct Answer :

  • Robustness

Which of the following is NOT a system template?

  1. Email subscription preferences page
  2. Search results page
  3. Blog preferences page
  4. Error page

Correct Answer:

  • Blog preferences page

This page was last edited on 3rd February, 2024 at 4:37 PM (UTC).

I hope this helps! Let me know if you have any other questions.

  • © 2024 Certification Answers - Text is available under the Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0).
    Additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy.