Acquia Certified Developer D8 Practice Exam, Exams of Technology

The practice exam for the Acquia Certified Developer D8 certification evaluates the skills necessary for developing and maintaining Drupal 8 applications. The focus is on PHP, custom module development, and working with the Drupal 8 API, including hooks, entities, and services.

Typology: Exams

2025/2026

Available from 12/25/2025

shilpi-jain-1
shilpi-jain-1 🇮🇳

4.2

(5)

29K documents

1 / 81

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Acquia Certified Developer D8 Practice Exam
Question 1. Which HTML5 element is used to define navigation links in a semantic way?
A) <footer>
B) <nav>
C) <header>
D) <aside>
Answer: B
Explanation: The <nav> element semantically denotes navigation links in HTML5, improving accessibility
and SEO.
Question 2. Which CSS property controls the space between the content and the border of an element?
A) margin
B) padding
C) border-spacing
D) outline
Answer: B
Explanation: Padding creates space between an element's content and its border.
Question 3. What does the CSS selector .main-content select?
A) All elements with class main-content
B) All elements with id main-content
C) All <main> elements
D) All content elements
Answer: A
Explanation: The dot (.) denotes a class selector in CSS.
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44
pf45
pf46
pf47
pf48
pf49
pf4a
pf4b
pf4c
pf4d
pf4e
pf4f
pf50
pf51

Partial preview of the text

Download Acquia Certified Developer D8 Practice Exam and more Exams Technology in PDF only on Docsity!

Question 1. Which HTML5 element is used to define navigation links in a semantic way? A) B) C) D) Answer: B Explanation: The element semantically denotes navigation links in HTML5, improving accessibility and SEO. Question 2. Which CSS property controls the space between the content and the border of an element? A) margin B) padding C) border-spacing D) outline Answer: B Explanation: Padding creates space between an element's content and its border. Question 3. What does the CSS selector .main-content select? A) All elements with class main-content B) All elements with id main-content C) All elements D) All content elements Answer: A Explanation: The dot (.) denotes a class selector in CSS.

Question 4. Which HTML tag is used for the main content of a webpage in HTML5? A) B) C) D) Answer: A Explanation: The tag is reserved for the dominant content of the . Question 5. Which CSS property sets the stacking order of positioned elements? A) float B) position C) z-index D) display Answer: C Explanation: z-index determines the stack level of positioned elements. Question 6. What is the default value of the CSS box-sizing property? A) content-box B) border-box C) inherit D) initial Answer: A Explanation: By default, box-sizing is set to content-box, meaning padding and border are not included in width/height.

A) float B) position C) display D) visibility Answer: B Explanation: The position property (static, relative, absolute, fixed) sets how an element is positioned. Question 11. Which JavaScript keyword declares a variable with block scope? A) var B) let C) function D) const Answer: B Explanation: let declares block-scoped variables, unlike var which is function-scoped. Question 12. What does $(‘.header’).hide(); do in jQuery? A) Shows all elements with class header B) Hides all elements with class header C) Removes all elements with class header D) Adds a header element Answer: B Explanation: .hide() in jQuery hides selected elements. Question 13. Which JavaScript statement is used to exit a loop prematurely? A) exit

B) break C) stop D) return Answer: B Explanation: break exits loops early. Question 14. In Drupal.behaviors, which function is always required to attach behaviors? A) init() B) attach() C) execute() D) run() Answer: B Explanation: The attach function is mandatory in Drupal.behaviors for attaching behaviors. Question 15. Which jQuery method is used to retrieve the HTML contents of an element? A) .val() B) .html() C) .text() D) .attr() Answer: B Explanation: .html() gets or sets the HTML content of selected elements. Question 16. What does the “Mobile First” approach in responsive design advocate? A) Designing for desktop before mobile B) Creating mobile layouts before desktop layouts

D) Both A and B Answer: D Explanation: Both include and require can include files; require throws a fatal error if the file is missing. Question 20. What is the correct syntax for an associative array in PHP? A) $arr = array(‘key’ => ‘value’); B) $arr = [‘key’ : ‘value’]; C) $arr = {‘key’ = ‘value’}; D) $arr = (‘key’, ‘value’); Answer: A Explanation: Associative arrays use the ‘key’ => ‘value’ format. Question 21. Which file is required for defining a custom Drupal theme? A) theme.info B) theme.info.yml C) theme.ini D) theme.config Answer: B Explanation: The .info.yml file is essential for a custom Drupal theme definition. Question 22. What key in the .info.yml file defines the theme’s base theme? A) base_theme B) parent_theme C) extends D) inherit

Answer: A Explanation: base_theme specifies the parent theme for inheritance. Question 23. In a custom theme, how do you define a new region? A) Add to regions in .info.yml B) Create a regions.php file C) Add to settings.php D) Use a custom module Answer: A Explanation: Regions are defined in the regions section of the .info.yml file. Question 24. To override a template for an article node, what should the file be named? A) node--article.html.twig B) article-node.html.twig C) node-article.html.twig D) node.html.twig Answer: A Explanation: node--article.html.twig is the correct naming convention for overriding article node templates. Question 25. Which folder typically contains custom templates in a Drupal theme? A) /templates B) /css C) /js D) /includes

Explanation: The attach_library Twig function attaches libraries to templates. Question 29. Which module is used to define responsive breakpoints in Drupal 8? A) Responsive Images B) Breakpoints C) Media D) Views Answer: B Explanation: The Breakpoints module defines device-specific breakpoints. Question 30. What is the main benefit of Responsive Image styles in Drupal? A) Faster page loads on all devices B) Higher image quality C) Automatic cropping D) Adds image captions Answer: A Explanation: Responsive Image styles optimize image loading for different devices, improving performance. Question 31. What is the basic Twig syntax to print a variable? A) {{ variable }} B) {% variable %} C) {# variable #} D) $variable Answer: A

Explanation: {{ variable }} prints a variable’s value in Twig. Question 32. Which Twig structure is used for logic and control flow? A) {{ ... }} B) {% ... %} C) {# ... #} D) [ ... ] Answer: B Explanation: {% ... %} is used for logic and control statements in Twig. Question 33. How do you add a class to an element using the attributes object in Twig? A) attributes.addClass('my-class') B) attributes.class('my-class') C) addClass('my-class') D) attributes.add('my-class') Answer: A Explanation: attributes.addClass('my-class') adds a class to an element in Twig templates. Question 34. Which Twig filter makes strings translatable in Drupal? A) |raw B) |t C) |escape D) |e Answer: B Explanation: The |t filter marks strings for translation in Drupal Twig templates.

Question 38. What is the primary use of hook_theme_suggestions_alter()? A) Add or alter template suggestions B) Add new regions C) Create new blocks D) Define libraries Answer: A Explanation: hook_theme_suggestions_alter() lets you add or modify template suggestions for fine- grained control. Question 39. Which hook is commonly used to alter form structure in Drupal? A) hook_form_alter() B) hook_page_alter() C) hook_theme_alter() D) hook_preprocess_form() Answer: A Explanation: hook_form_alter() enables modifications to form elements before rendering. Question 40. What is the relationship between blocks and regions in Drupal? A) Blocks are placed in regions B) Regions are placed in blocks C) Blocks define regions D) Regions define blocks Answer: A Explanation: Blocks are content containers placed within defined regions of a theme.

Question 41. Which tool is used to create custom content lists in Drupal? A) Views B) Panels C) Blocks D) Menus Answer: A Explanation: Views module lets you create custom content lists, feeds, and blocks. Question 42. How do you override the output of a specific View? A) Create a views-view.html.twig template B) Use hook_form_alter() C) Change the .info.yml file D) Use JavaScript Answer: A Explanation: Overriding is done by creating a custom views-view.html.twig template. Question 43. Which Drupal module allows visual layout editing for nodes and blocks? A) Layout Builder B) Breakpoints C) Responsive Images D) Devel Answer: A Explanation: Layout Builder enables drag-and-drop layout editing for content.

A) Loading all images at once B) Loading images as they enter the viewport C) Preloading images in the header D) Disabling image loading Answer: B Explanation: Lazy loading loads images only when they are visible, improving performance. Question 48. How does Twig prevent Cross-Site Scripting (XSS) by default? A) Auto-escaping output B) Requiring validation C) Using tags D) Hashing content Answer: A Explanation: Twig auto-escapes output to prevent XSS vulnerabilities. Question 49. When is it safe to use the |raw filter in Twig? A) When output is sanitized and trusted B) Always C) On untrusted user input D) Never Answer: A Explanation: |raw should only be used on sanitized, trusted output due to XSS risks. Question 50. Which Twig filter is used to sanitize class names? A) |clean_class

B) |sanitize C) |safe_class D) |class Answer: A Explanation: |clean_class ensures class names are safe for HTML output. Question 51. Which attribute in HTML5 is used to provide alternative text for images? A) title B) alt C) src D) description Answer: B Explanation: The alt attribute provides descriptive alternative text for images. Question 52. What does the CSS property display: flex; do? A) Creates a block element B) Enables flexible box layout C) Hides the element D) Makes an element inline Answer: B Explanation: display: flex enables the Flexbox layout model for child elements. Question 53. Which JavaScript method is used to select an element by its ID? A) getElementByClassName B) getElementById

D) Answer: C Explanation: semantically groups related content in HTML5. Question 57. What is the purpose of the settings section in a theme’s .info.yml file? A) Define custom theme settings B) Add CSS files C) Include JavaScript D) Set breakpoints Answer: A Explanation: The settings section defines configurable theme options. Question 58. How do you add a new theme color option for users in Drupal? A) Define in settings section of .info.yml B) Add in .libraries.yml C) Use a custom region D) Edit the page.html.twig Answer: A Explanation: Theme color options are defined in the settings section of .info.yml. Question 59. Which file defines the regions available in a Drupal theme? A) theme.info.yml B) theme.libraries.yml C) theme.settings.yml D) theme.regions.yml

Answer: A Explanation: Regions are defined in the .info.yml file of the theme. Question 60. How do you inherit templates from a base theme in a sub-theme? A) Place templates in sub-theme’s templates folder B) Copy templates to /css C) Rename templates in base theme D) Edit regions in .info.yml Answer: A Explanation: Sub-themes inherit templates by placing overrides in their own /templates folder. Question 61. Which method is used to attach a library to a render array in Drupal? A) #attached B) #library C) #assets D) #theme Answer: B Explanation: #library attaches a defined library to a render array. Question 62. What is the purpose of CSS/JS aggregation exclusion? A) Prevents aggregation for specific files B) Deletes files C) Combines all files D) Renames files Answer: A