← All Drupal Flashcard Decks

Drupal Module Development & API Flashcards

6 cards from real Drupal practice questions. Tap to flip, then mark Knew It or Still Learning — missed cards come back until you master them.

Read the first 6 Drupal Module Development & API flashcards as text
  1. Which Drupal hook allows a module to alter an existing form before it is rendered?

    Answer: hook_form_alter()

    hook_form_alter() receives the form array by reference and lets any module modify fields, validators, submit handlers, or structure of any form.

  2. In Drupal, what is the purpose of the #cache property in a render array?

    Answer: Define cache tags, contexts, and max-age for granular caching

    The #cache property with tags, contexts, and max-age keys lets Drupal cache render array output at the right granularity and invalidate it precisely.

  3. What Drupal API is used to execute a database query that loads multiple nodes matching specific field values?

    Answer: EntityQuery via \Drupal::entityQuery()

    EntityQuery (via \Drupal::entityQuery() or injected entity type manager) provides a safe, entity-aware query builder that respects access control.

  4. What is a Drupal 'Event Subscriber' and which Symfony component does it leverage?

    Answer: A class that listens to dispatched events using Symfony EventDispatcher

    Event Subscribers implement EventSubscriberInterface from Symfony's EventDispatcher component and react to events like KernelEvents::REQUEST without using hooks.

  5. In Drupal's Plugin API, what is the role of the @annotation on a plugin class?

    Answer: Registers the plugin with Drupal's plugin manager at discovery time

    Drupal uses Doctrine annotations (like @Block, @Field, @ViewsField) in class docblocks to auto-discover and register plugins without manual registry files.

  6. Which Drush command regenerates Drupal's autoloader and clears all caches after adding a new module?

    Answer: Both drush cr and drush cache:rebuild (they are aliases)

    'drush cr' and 'drush cache:rebuild' are aliases for the same command that rebuilds all Drupal caches including the service container and autoloader.

How this page was made: written with AI tools and published by Nathan Beja, founder of Practice Test Geeks, who is responsible for its content. Exam facts are checked against the official sources listed below. Not reviewed by a subject-matter expert. Editorial policy

Sources & references

Exam facts on this page (fees, format, dates, passing scores) are checked against these official sources; the date is our last check. Editorial policy

  1. docs.acquia.com — Retake fee, retake policy, score release, exam format, passing score, time limit, score validity, test delivery, eligibility, registration deadline · verified Oct 2026
  2. acquia.com — Fees, exam format, passing score, time limit · verified Oct 2026