Learn Drupal MCQs
Prepare Drupal MCQs (Multiple choice Questions) for exam and job interviews.
What is the purpose of `hook_user_presave()`?
1) Execute actions before a user is saved
2) Execute actions after a user logs in
3) Execute actions when a user is deleted
4) Execute actions when a user is registered
Answer : Execute actions when a user is deleted
What does `hook_field_widget_form()` do?
1) Defines a form for a field widget
2) Creates a new field widget
3) Deletes a field widget
4) Manages field widget settings
Answer : Creates a new field widget
Which of the following is used to clear caches in Drupal?
1) admin/config/development/performance
2) admin/performance
3) admin/config/cache
4) admin/config/development/cache
Answer : admin/performance
What is the purpose of the `hook_block_view()` function?
1) Alter the content of a block
2) Create new blocks
3) Delete blocks
4) Manage block permissions
Answer : Create new blocks
What does `hook_field_storage_definitions()` do?
1) Defines field storage settings
2) Creates new fields
3) Deletes fields
4) Manages field permissions
Answer : Creates new fields
Which command in Drush is used to view the status of the site?
1) drush status
2) drush site-status
3) drush view-status
4) drush site-info
Answer : drush status
What is the purpose of `hook_theme_suggestions_HOOK()`?
1) Add theme suggestions for a specific hook
2) Create new themes
3) Delete themes
4) Manage theme settings
Answer : Manage theme settings
Which file defines the routing for a module?
1) MODULE_NAME.routing.yml
2) MODULE_NAME.info.yml
3) MODULE_NAME.module
4) MODULE_NAME.settings.yml
Answer : MODULE_NAME.info.yml
What does the `hook_menu_link_alter()` function do?
1) Alters menu links
2) Creates new menu links
3) Deletes menu links
4) Manages menu link settings
Answer : Creates new menu links
What is the function of `hook_entity_type_alter()`?
1) Alters entity types
2) Creates new entity types
3) Deletes entity types
4) Manages entity permissions
Answer : Manages entity permissions