Learn Drupal MCQs
Prepare Drupal MCQs (Multiple choice Questions) for exam and job interviews.
What is the default caching method in Drupal?
1) Database
2) File system
3) Memory
4) None of the above
Answer : Database
Which of the following is a valid way to add a breadcrumb in Drupal?
1) Using the `drupal_set_breadcrumb()` function
2) Using the `hook_breadcrumb_alter()` function
3) Using the UI
4) All of the above
Answer : All of the above
What does `hook_preprocess_page()` do?
1) Alters page variables before rendering
2) Creates a new page
3) Deletes a page
4) Displays a page
Answer : Alters page variables before rendering
What is the purpose of the `hook_form_FORM_ID_alter()` function?
1) To modify a specific form
2) To create a new form
3) To delete a form
4) To render a form
Answer : To modify a specific form
What is the command used to run database updates in Drupal using Drush?
1) drush updatedb
2) drush db-update
3) drush run-updates
4) drush db-updates
Answer : drush updatedb
What is the function used to fetch configuration values in Drupal?
1) config()
2) drupal_get_config()
3) get_config()
4) fetch_config()
Answer : drupal_get_config()
Which command is used to enable a module in Drush?
1) drush en module_name
2) drush activate module_name
3) drush module-enable
4) drush mod-enable
Answer : drush en module_name
What is the purpose of `hook_user_presave()` in Drupal?
1) To perform actions before a user is saved
2) To delete a user
3) To create a new user
4) To modify user roles
Answer : To perform actions before a user is saved
Which command is used to disable a module in Drush?
1) drush pm-disable module_name
2) drush disable module_name
3) drush deactivate module_name
4) drush mod-disable module_name
Answer : drush pm-disable module_name
What does `hook_entity_update()` do in Drupal?
1) Runs after an entity is updated
2) Runs before an entity is updated
3) Creates a new entity
4) None of the above
Answer : Runs after an entity is updated