Learn Drupal MCQs

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

What does `hook_views_query_alter()` do?

1) Alters the database query for a view

2) Creates a new view

3) Deletes a view

4) Manages view settings

Answer : Creates a new view

What is the purpose of `hook_form_alter()`?

1) Modify existing forms

2) Create new forms

3) Delete forms

4) Manage form settings

Answer : Delete forms

What is a theme in Drupal?

1) A way to change the appearance of a site

2) A type of content

3) A user role

4) A module

Answer : A type of content

What does `drupal_flush_all_caches()` do?

1) Clears all caches

2) Creates new caches

3) Deletes caches

4) Manages cache settings

Answer : Creates new caches

Which command in Drush can be used to run cron jobs?

1) drush cron

2) drush run-cron

3) drush execute-cron

4) drush cron-job

Answer : drush cron

What is the purpose of `hook_views_post_build()`?

1) Run after a view is built

2) Run before a view is built

3) Alter the view

4) Create a new view

Answer : Create a new view

Which module is essential for multilingual support in Drupal?

1) Locale

2) Content Translation

3) Pathauto

4) Views

Answer : Pathauto

What is the purpose of `hook_preprocess_HOOK()`?

1) Prepare variables for a specific hook

2) Create new hooks

3) Delete hooks

4) Manage hooks

Answer : Create new hooks

What does the `hook_node_view_alter()` function do?

1) Alters the display of nodes

2) Creates new nodes

3) Deletes nodes

4) Manages node permissions

Answer : Manages node permissions

Which command is used to enable a module in Drush?

1) drush en module_name

2) drush module-enable module_name

3) drush enable module_name

4) drush pm-enable module_name

Answer : drush pm-enable module_name