Learn Drupal MCQs

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

What does the `hook_views_query_alter()` function do?

1) Modifies the Views query

2) Creates a new view

3) Deletes a view

4) None of the above

Answer : Modifies the Views query

Which of the following is a valid field type in Drupal?

1) Text

2) Boolean

3) File

4) All of the above

Answer : All of the above

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

1) To modify any form

2) To create a new form

3) To delete a form

4) To display a form

Answer : To modify any form

In Drupal, what is a "render array"?

1) An array that defines how content should be displayed

2) An array of users

3) An array of settings

4) An array of nodes

Answer : An array that defines how content should be displayed

Which command is used to enable the maintenance mode in Drupal?

1) drush sset system.maintenance_mode 1

2) drush maintenance on

3) drush enable maintenance

4) drush enable-maintenance

Answer : drush sset system.maintenance_mode 1

What does the `hook_theme_suggestions_HOOK()` function do?

1) Provides theme suggestions

2) Creates new themes

3) Deletes themes

4) Alters existing themes

Answer : Provides theme suggestions

Which of the following is NOT a core module in Drupal?

1) Views

2) Block

3) Path

4) User

Answer : Views

What is the command to list all enabled modules in Drupal using Drush?

1) drush pm-list

2) drush module-list

3) drush status

4) drush mod-list

Answer : drush pm-list

In Drupal, what is a "custom entity"?

1) A user-defined data type

2) A taxonomy term

3) A view

4) A node type

Answer : A user-defined data type

What is the default database system used by Drupal?

1) MySQL

2) PostgreSQL

3) SQLite

4) MongoDB

Answer : MySQL