Learn Drupal MCQs

Prepare Drupal MCQs (Multiple choice Questions) for exam and job interviews.

What is the purpose of the `hook_taxonomy_term_view()` function?

1) Alters the display of taxonomy terms

2) Creates new taxonomy terms

3) Deletes taxonomy terms

4) Manages taxonomy settings

Answer : Alters the display of taxonomy terms

Which command is used to run database updates in Drush?

1) drush updatedb

2) drush db-update

3) drush run-updates

4) drush update-database

Answer : drush updatedb

What does `hook_entity_type_build()` allow you to do?

1) Alter entity types during build

2) Create new entity types

3) Delete entity types

4) Manage entity permissions

Answer : Alter entity types during build

Which file is used to define routing for a custom module?

1) module.routing.yml

2) routes.yml

3) module.routes.yml

4) routing.yml

Answer : module.routing.yml

What does the `hook_form_FORM_ID_alter()` function do?

1) Alters a specific form

2) Creates new forms

3) Deletes forms

4) Manages form submissions

Answer : Alters a specific form

What is the purpose of `hook_views_pre_execute()`?

1) Runs before a view is executed

2) Runs after a view is executed

3) Alters the view

4) Creates a new view

Answer : Runs before a view is executed

Which command in Drush can be used to list all configuration settings?

1) drush config-list

2) drush config-status

3) drush config-show

4) drush config-export

Answer : drush config-list

What does `hook_field_formatter_info_alter()` allow you to do?

1) Alter field formatters

2) Create new fields

3) Delete field formatters

4) Manage field settings

Answer : Alter field formatters

Which function is used to create a new user in Drupal?

1) user_save()

2) drupal_user_create()

3) create_user()

4) new_user()

Answer : user_save()

What is the purpose of `hook_form_submit()`?

1) Handle form submissions

2) Create new forms

3) Delete forms

4) Manage form settings

Answer : Handle form submissions