Drupal Technology & Digital Applications 2 — Questions and Answers
Question 1: Which Drupal module allows you to create REST API endpoints without writing custom code?
- RESTful Web Services (core)
- JSON:API (core) (Correct answer)
- GraphQL
- Services
Correct answer: JSON:API (core)
The JSON:API module, included in Drupal core since version 8.7, automatically exposes all content entities as REST API endpoints following the JSON:API specification.
Question 2: In Drupal, what is the purpose of the 'Migrate' module suite?
- To move files between servers
- To import content from external sources into Drupal (Correct answer)
- To transfer themes between sites
- To synchronize configuration between environments
Correct answer: To import content from external sources into Drupal
The Migrate module suite provides a framework for importing data from external sources (like legacy CMS databases, CSV files, or APIs) into a Drupal site.
Question 3: What does the Drupal concept of 'decoupled' or 'headless' architecture mean?
- Drupal runs without a database
- The front-end presentation layer is separated from the Drupal backend (Correct answer)
- Drupal operates without user authentication
- Content types are removed from the admin interface
Correct answer: The front-end presentation layer is separated from the Drupal backend
In a decoupled or headless architecture, Drupal serves as a content repository and API backend while a separate front-end framework (like React or Vue) handles rendering.
Question 4: Which technology does Drupal's BigPipe module leverage to improve perceived page load time?
- WebSockets
- Server-Sent Events
- HTTP/2 server push
- Streaming HTML responses (Correct answer)
Correct answer: Streaming HTML responses
BigPipe uses streaming HTML responses to send placeholder content first and then stream in personalized or uncached blocks, reducing perceived page load time.
Question 5: In Drupal, what is a 'Plugin' in the object-oriented architecture sense?
- A third-party JavaScript library
- A reusable, swappable component defined via annotations or YAML (Correct answer)
- A database stored procedure
- A Twig template extension
Correct answer: A reusable, swappable component defined via annotations or YAML
Drupal plugins are reusable, swappable components (like blocks, field types, or image effects) discovered via annotations, YAML, or other mechanisms, enabling extensibility without modifying core.
Question 6: What is the role of Drupal's 'State API'?
- Managing user session data
- Storing site-specific runtime information that should not be exported (Correct answer)
- Tracking content revision history
- Caching rendered HTML output
Correct answer: Storing site-specific runtime information that should not be exported
The State API stores site-specific, environment-specific runtime data (like cron last run time) that should remain on the server and not be exported with configuration.
Question 7: Which Drupal core service handles dependency injection throughout the application?
- The Hook system
- The Symfony DependencyInjection Container (Correct answer)
- The Plugin Manager
- The Event Dispatcher
Correct answer: The Symfony DependencyInjection Container
Drupal uses Symfony's DependencyInjection Container to manage and inject services throughout the application, promoting loose coupling and testability.
Which Drupal module allows you to create REST API endpoints without writing custom code?