Learn Drupal MCQs

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

Which command is used to install Drupal using Drush?

1) drush site-install

2) drush install

3) drush setup

4) drush start

Answer : drush site-install

In Drupal, what is a "node"?

1) A page of content

2) A type of module

3) A database entry

4) A user role

Answer : A page of content

What does the `hook_node_view()` function do in Drupal?

1) Alters the display of a node

2) Creates a new node

3) Deletes a node

4) None of the above

Answer : Alters the display of a node

Which of the following is a common way to add custom JavaScript in Drupal?

1) Using `drupal_add_js()`

2) Using `libraries.yml`

3) Using `hook_page_attachments()`

4) All of the above

Answer : All of the above

What is the default permission for newly created roles in Drupal?

1) No permissions

2) Full access

3) Limited access

4) Custom permissions

Answer : No permissions

What type of file is `settings.php` in Drupal?

1) Configuration file

2) Theme file

3) Module file

4) Database file

Answer : Configuration file

Which of the following is true about custom modules in Drupal?

1) They can be enabled and disabled

2) They can contain hooks

3) They can define routes

4) All of the above

Answer : All of the above

Which function is used to redirect users in Drupal?

1) drupal_redirect()

2) drupal_goto()

3) drupal_back()

4) drupal_exit()

Answer : drupal_goto()

What is the output of `drupal_version()` in Drupal?

1) The current version of Drupal

2) The PHP version

3) The database version

4) None of the above

Answer : The current version of Drupal

What file format is used for configuration in Drupal 8?

1) YAML

2) JSON

3) XML

4) PHP

Answer : YAML