7个基本的Drupal面试问题 *

Toptal sourced essential questions that the best Drupal developers and engineers can answer. 在我们社区的推动下,我们鼓励专家提交问题并提供反馈.

Hire a Top Drupal Developer Now
Toptal logo是顶级自由软件开发人员的专属网络吗, designers, finance experts, product managers, and project managers in the world. 顶级公司雇佣Toptal自由职业者来完成他们最重要的项目.

Interview Questions

1.

命名并描述Drupal系统中的五个概念层.

View answer

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

  1. Data (nodes, etc.). 在任何东西可以在网站上显示之前,它必须作为数据输入.
  2. Modules. Modules are functional plugins that are either part of the Drupal core or are contributed modules that build on Drupal’s core functionality.
  3. Blocks and menus. Blocks can be used to present anything, 所以Drupal站点上的任何内容(除了主要内容), breadcrumbs, (主/次菜单)通常是一个块. Blocks are an extensible core feature of Drupal with a simple API provided by the block module. 块类似于内容管理系统中的“小部件”,但是是高度一般化的. Menus 链接(菜单项)的集合是用来浏览网站的吗. The Menu module provides an interface to control and customize the menu system that comes with Drupal. By default, 新的菜单项被放置在一个名为Navigation的内置菜单中, 但是管理员也可以创建自定义菜单.
  4. User permissions. User permissions are defined for various roles and users are assigned to these roles in order to grant them the defined permissions.
  5. Themes and templates. drupal体系结构的顶层概念层是主题. 这主要由XHTML和CSS组成, with some PHP variables intermixed, 这样drupal生成的内容就可以放在合适的位置. Also included with each theme is a set of functions that can be used to override standard functions in the modules in order to provide complete control over how the modules generate their markup at output time. 主题可以包含一个或多个模板, 取决于网站的复杂性和它的设计方式.
2.

Drupal的分类系统是什么?它的一些关键特性是什么?

View answer

Drupal comes with a built in taxonomy system that allows for categorization of the nodes on a site.

分类法系统允许对术语进行任意定义, 以及将这些术语任意组织成词汇表. 可以创建的词汇表的数量没有限制, 词汇表中可以包含的术语数量也没有任何限制.

词汇表也可以有自由标记,这意味着, 而不是提前输入具体条款, users may enter tags freely at the time the content is created and those tags automatically become terms in that vocabulary.

Drupal的分类法系统是其最强大、最灵活的特性之一.

3.

请描述一下Drupal 7核心中引入的Field API.

View answer

The Field API allows custom data fields to be attached to Drupal entities and takes care of storing, loading, editing, and rendering field data. Any entity type (node, user, etc.) can use the Field API to make itself “fieldable” and thus allow fields to be attached to it. Other modules can provide a user interface for managing custom fields via a web browser as well as a wide and flexible variety of data type, form element, and display format capabilities.

The Field API defines two primary data structures, Field and Instance, and the concept of a Bundle. 字段定义了可以附加到实体的特定类型的数据. 字段实例是附加到单个Bundle的字段. A Bundle is a set of fields that are treated as a group by the Field Attach API and is related to a single fieldable entity type.

For example, suppose a site administrator wants Article nodes to have a subtitle and photo. 使用字段API或字段UI模块, the administrator creates a field named ‘subtitle’ of type ‘text’ and a field named ‘photo’ of type ‘image’. The administrator (again, via a UI) creates two Field Instances, one attaching the field ‘subtitle’ to the ‘node’ bundle ‘article’ and one attaching the field ‘photo’ to the ‘node’ bundle ‘article’. 当节点系统使用Field Attach API来加载Article节点的所有字段时, it passes the node’s entity type (which is ‘node’) and content type (which is ‘article’) as the node’s bundle. field_attach_load() then loads the ‘subtitle’ and ‘photo’ fields because they are both attached to the ‘node’ bundle ‘article’.

字段定义表示为键/值对数组.

注意,以上答案摘自 Drupal API Documentation, where more information can be found.

申请加入Toptal的发展网络

and enjoy reliable, steady, remote Freelance Drupal Developer Jobs

Apply as a Freelancer
4.

解释Drupal系统中“节点”的概念.

View answer

Drupal网站上的所有内容都作为“节点”存储和处理。. A node is any piece of individual content (e.g.、网页、文章、论坛主题、博客条目等.). Note, though, that omments are not stored as nodes but are always connected to a node.

The ability to create different “content types” is a way Drupal allows you to have different kinds of nodes for different purposes. For example, an “article” is one content type, a “book page” is another, and a “blog entry” yet another. 您还可以创建自己的新内容类型.

Treating all content as nodes provides a great deal of flexibility that facilitates and simplifies creating new types of content. It also makes it easy to apply new features or changes to all content of a particular type.

5.

描述Views模块的特性和用法.

View answer

Using the Views module, 您可以从站点的数据库中获取内容,并将其作为列表呈现给用户, posts, galleries, tables, maps, graphs, menu items, blocks, reports, forum posts etc. 可以显示不同的内容类型,包括节点、用户和其他包.

Views UI, a submodule within Views, provides a graphical interface underneath which lies a powerful SQL query builder that can access virtually any information in your database and display it in any format.

Different displays can present the query results as pages with fixed URLs on your site (or URLs accepting arguments), blocks, feeds, or panel panes.

您还可以使用视图来显示相关内容或实现上下文过滤器. For example, you can display a list of users along with links to the content they have created and/or you can display customized content to a user according to their user ID.

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

6.

What are appropriate use cases for Drupal as opposed to a lower-level framework like Ruby on Rails?

View answer

Rails是Ruby的通用web应用程序框架. 它旨在帮助程序员在构建各种类型的网站时更有效率, not just CMSs. And note that it’s for “programmers”. 除非您打算编写服务器端代码, 你不能指望仅仅使用Rails就能完成很多事情(但是如果你真的打算写代码的话), Ruby和Rails都是非常高效的).

Drupal是一个内容管理系统,有数百个这样的系统. It happens to be written in PHP, but it’s modular design and large collection of available modules and themes make it possible to design and implement a large variety of web sites without writing a line of code. 但最重要的是,它本质上是一个CMS. 您的站点的需求离CMS的最佳点越远, Drupal成为您最佳选择的可能性就越小.

7.

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

View answer

Drupal’s hook system is essentially a mechanism for implementing custom features without needing to make any modifications to the Drupal core. There are specific places where the Drupal core can invoke custom functions defined in modules to enhance the functionality of core. 这些地方被称为“钩子”,并且具有定义良好的接口.

Hooks make it possible, for example, for a module to define new URLs and pages within a site (hook_menu), to add content to pages (hook_block, hook_footer, etc.), set up custom database tables (hook_schema), and so on.

假设您想要更改核心“Contact”表单. To do so, you can implement hook_form_alter in your custom module and provide any cuistom functionality that you’d like in that function. Drupal will check all form_alter hooks in all modules, so your hook will be picked up and your custom code will be applied to the “Contact Form”.

So overall, Drupal hooks are just functions defined per the Drupal standards that allow you to extend Drupal and alter or extend core functionality without modificing any core code.

面试不仅仅是棘手的技术问题, 所以这些只是作为一个指南. 并不是每一个值得雇佣的“A”候选人都能回答所有的问题, 回答所有问题也不能保证成为A级考生. At the end of the day, 招聘仍然是一门艺术,一门科学,需要大量的工作.

Why Toptal

Tired of interviewing candidates? 不知道该问什么才能让你得到一份好工作?

让Toptal为你找到最合适的人.

Hire a Top Drupal Developer Now

我们的Drupal开发者独家网络

希望找到一份Drupal开发人员的工作?

Let Toptal find the right job for you.

Apply as a Drupal Developer

Job Opportunities From Our Network

Submit an interview question

提交的问题和答案将被审查和编辑, 并可能会或可能不会选择张贴, 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

Rafael is an experienced web developer with over seven years of expertise in working on Drupal CMS projects for notable organizations like MIT and Doctors Without Borders. 他擅长使用自动化测试开发后端和前端代码, integrating systems through APIs, 建立基于集装箱的基础设施. 无论是工作还是沟通,拉斐尔都力求品质.

Show More

Stephen Villee

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

Stephen已经做了30多年的软件工程师. From developing software for the Unix platform in the 1980's to producing enterprise-level financial and eCommerce software on PHP, JS, and the C language family, 他以一丝不苟和开发高质量的软件而自豪. He is a dedicated, 工作效率高,善于沟通, 并期待为您的项目贡献有价值的技能!

Show More

Richard Dam

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

Richard is a seasoned product engineer with over a decade of experience building innovative products in the AI/ML, payment, and eCommerce fields. He's an experienced team leader, driving 10x growth for a startup's AI Chatbot and successfully heading the engineering team of GO VIET. 他是一家金融科技公司的首席技术官, Richard's passion for product engineering and driving results make him an invaluable asset to any tech team.

Show More

Toptal Connects the Top 3% 世界各地的自由职业人才.

Join the Toptal community.

Learn more