7 Essential Drupal Interview Questions *

Toptal提供了最好的Drupal开发人员和工程师可以回答的基本问题. Driven from our community, we encourage experts to submit questions and offer feedback.

Hire a Top Drupal Developer Now
Toptal logois an exclusive network of the top freelance software developers, designers, finance experts, product managers, and project managers in the world. Top companies hire Toptal freelancers for their most important projects.

Interview Questions

1.

Name and describe the five conceptual layers in a Drupal system.

View answer

The five layers, starting from the bottom layer, are as follows:

  1. Data (nodes, etc.). Before anything can be displayed on the site, it must be input as data.
  2. Modules. 模块是功能性插件,它们要么是Drupal核心的一部分,要么是构建在Drupal核心功能之上的贡献模块.
  3. Blocks and menus. Blocks can be used to present anything, so just about any piece of content on a Drupal site (other than main content, breadcrumbs, and primary/secondary menus) is usually a block. block是Drupal的一个可扩展核心特性,block模块提供了一个简单的API. Blocks are similar to “widgets” in content management systems, but are highly generalized. Menus are a collection of links (menu items) used to navigate a website. Menu模块提供了一个接口来控制和定制Drupal自带的菜单系统. By default, new menu items are placed inside a built-in menu labeled Navigation, but administrators can also create custom menus.
  4. User permissions. 为各种角色定义了用户权限,并将用户分配给这些角色,以便向他们授予定义的权限.
  5. Themes and templates. The top conceptual layer of the drupal architecture is the theme. This consists primarily of XHTML and CSS, with some PHP variables intermixed, so Drupal-generated content can go in the appropriate spots. 每个主题还包含一组函数,可用于覆盖模块中的标准函数,以便完全控制模块在输出时如何生成标记. A theme may contain one or more templates, depending on the complexity of the site and the way it has been designed.
2.

What is Drupal’s taxonomy system and what are some of its key features?

View answer

Drupal提供了一个内置的分类法系统,允许对站点上的节点进行分类.

The taxonomy system allows for arbitrary definition of terms, as well as arbitrary organization of those terms into vocabularies. There is no limit to the number of vocabularies that can be created, nor is there any limit to the number of terms that can be included in a vocabulary.

A vocabulary can also have free tagging which means that, instead of entering specific terms ahead of time, 用户可以在创建内容时自由输入标记,这些标记将自动成为该词汇表中的术语.

Drupal’s taxonomy system is one if its most powerful and flexible features.

3.

Describe the Field API that was introduced into core in Drupal 7.

View answer

Field API允许将自定义数据字段附加到Drupal实体并负责存储, loading, editing, and rendering field data. Any entity type (node, user, etc.)可以使用Field API使自己成为“可字段”,从而允许附加字段. 其他模块可以提供一个用户界面,用于通过web浏览器管理自定义字段,以及广泛而灵活的各种数据类型, form element, and display format capabilities.

Field API定义了两个主要的数据结构:Field和Instance,以及Bundle的概念. A Field defines a particular type of data that can be attached to entities. A Field Instance is a Field attached to a single Bundle. Bundle是一组字段,它们被Field Attach API视为一个组,并且与单个可字段实体类型相关.

例如,假设站点管理员希望文章节点具有副标题和照片. Using the Field API or Field UI module, 管理员创建类型为“text”的名为“subtitle”的字段和类型为“image”的名为“photo”的字段。. The administrator (again, via a UI) creates two Field Instances, 一个将字段' subtitle '附加到' node ' bundle ' article ',另一个将字段' photo '附加到' node ' bundle ' article '. When the node system uses the Field Attach API to load all fields for an Article node, 它将节点的实体类型(' node ')和内容类型(' article ')作为节点的bundle传递. field_attach_load() 然后加载' subtitle '和' photo '字段,因为它们都附加到' node ' bundle ' article '.

Field definitions are represented as an array of key/value pairs.

Note that the above answer has been excerpted from the Drupal API Documentation, where more information can be found.

Apply to Join Toptal's Development Network

and enjoy reliable, steady, remote Freelance Drupal Developer Jobs

Apply as a Freelancer
4.

Explain the concept of “nodes” in a Drupal system.

View answer

All content on a Drupal website is stored and treated as “nodes”. A node is any piece of individual content (e.g., a page, article, forum topic, blog entry, etc.). Note, though, that omments are not stored as nodes but are always connected to a node.

创建不同“内容类型”的能力是Drupal允许您为不同目的拥有不同类型节点的一种方式. For example, an “article” is one content type, a “book page” is another, and a “blog entry” yet another. You can also create new content types of your own.

将所有内容视为节点提供了极大的灵活性,方便并简化了创建新类型内容的过程. 它还可以很容易地将新特性或更改应用到特定类型的所有内容.

5.

Describe the features and uses of the Views module.

View answer

Using the Views module, you can fetch content from the database of your site and present it to the user as lists, posts, galleries, tables, maps, graphs, menu items, blocks, reports, forum posts etc. Different content types including nodes, users, and other bundles can be displayed.

Views UI, a submodule within Views, 提供了一个图形界面,下面是一个强大的SQL查询构建器,可以访问数据库中的几乎任何信息,并以任何格式显示它.

不同的显示方式可以将查询结果显示为站点上带有固定url的页面(或接受参数的url)。, blocks, feeds, or panel panes.

You can also use Views to present related content or implement contextual filters. For example, 您可以显示用户列表以及指向他们创建的内容的链接,或者您可以根据用户ID向用户显示定制的内容.

More information is available in the Views documentation on the Drupal site.

6.

相对于Ruby on Rails这样的低级框架,Drupal有哪些合适的用例?

View answer

Rails is a general purpose web application framework for Ruby. It’s designed to help programmers be more productive in building web sites of all types, not just CMSs. And note that it’s for “programmers”. Unless you intend to write server-side code, you can’t hope to get much done with just Rails alone (but if you do intend to write code, both Ruby and Rails are known to be very productive).

Drupal is a Content Management System, of which there are hundreds. It happens to be written in PHP, 但是它的模块化设计和大量可用模块和主题的集合使得设计和实现各种各样的网站成为可能,而不需要编写一行代码. Most importantly, though, it is fundamntally a CMS. The further your site’s needs are from the CMS sweet-spot, the less likely it is that Drupal will be your best choice.

7.

Explain the “hook” system in Drupal. How and why would you use it?

View answer

Drupal的钩子系统本质上是一种实现自定义特性的机制,无需对Drupal核心进行任何修改. Drupal核心可以在特定的地方调用模块中定义的自定义函数来增强核心的功能. These places are referred to as “hooks” and have a well-defined interface.

例如,Hooks使模块可以在站点内定义新的url和页面(hook_menu), to add content to pages (hook_block, hook_footer, etc.), set up custom database tables (hook_schema), and so on.

Let’s say you want to change the core “Contact” form. To do so, you can implement hook_form_alter 在自定义模块中,并提供您希望在该函数中使用的任何自定义功能. Drupal will check all form_alter hooks in all modules, 这样你的钩子就会被选中,你的自定义代码就会应用到“联系人表单”上。.

So overall, Drupal钩子只是根据Drupal标准定义的函数,允许您扩展Drupal并更改或扩展核心功能,而无需修改任何核心代码.

There is more to interviewing than tricky technical questions, so these are intended merely as a guide. Not every “A” candidate worth hiring will be able to answer them all, nor does answering them all guarantee an “A” candidate. At the end of the day, hiring remains an art, a science — and a lot of work.

Why Toptal

Tired of interviewing candidates? Not sure what to ask to get you a top hire?

Let Toptal find the best people for you.

Hire a Top Drupal Developer Now

Our Exclusive Network of Drupal Developers

Looking to land a job as a Drupal Developer?

Let Toptal find the right job for you.

Apply as a Drupal Developer

Job Opportunities From Our Network

Submit an interview question

Submitted questions and answers are subject to review and editing, and may or may not be selected for posting, at the sole discretion of Toptal, LLC.

* All fields are required

Looking for Drupal Developers?

Looking for Drupal Developers? Check out Toptal’s Drupal developers.

Rafael Silva

Freelance Drupal Developer
BrazilExpert Drupal Developer at Toptal Since August 27, 2019

拉斐尔是一位经验丰富的web开发人员,在为MIT和无国界医生等著名组织开发Drupal CMS项目方面拥有超过7年的专业知识. He specializes in developing back-end and front-end code with automated tests, integrating systems through APIs, and building container-based infrastructures. Rafael always strives for ​​quality in both work and communication.

Show More

Stephen Villee

Freelance Drupal Developer
United StatesExpert Drupal Developer at Toptal Since January 8, 2016

Stephen has been a software engineer for over 30 years. 从20世纪80年代为Unix平台开发软件到用PHP开发企业级金融和电子商务软件, JS, and the C language family, he prides himself on being meticulous and developing high quality software. He is a dedicated, efficient individual and a great communicator, and looks forward to contributing valuable skills to your project!

Show More

Richard Dam

Freelance Drupal Developer
VietnamExpert Drupal Developer at Toptal Since July 10, 2019

Richard是一位经验丰富的产品工程师,在AI/ML领域拥有超过十年的创新产品开发经验, payment, and eCommerce fields. He's an experienced team leader, 为一家初创公司的人工智能聊天机器人推动了10倍的增长,并成功领导了GO VIET的工程团队. As the CTO of a fintech company he co-founded, 理查德对产品工程和驱动结果的热情使他成为任何技术团队的宝贵资产.

Show More

Toptal Connects the Top 3% of Freelance Talent All Over The World.

Join the Toptal community.

Learn more