Drupal Architect Interview Questions
Drupal Architect Interview Questions
Q: What is the difference between a custom module and a contributed module in Drupal?
A: Contributed Module: Developed and shared by the Drupal community, hosted on drupal.org.
Custom Module: Tailored to specific project needs, created by developers for a particular site.
A: Plugins are small pieces of functionality that are swappable and follow the Plugin API.
They use annotations (@Plugin) and are discovered using plugin managers.
A: Through YAML files in the config/sync directory. Used with commands like drush config-export and drush
config-import.
A: Share core codebase, separate sites/site1.com/settings.php, symbolic links or composer for shared modules/themes.
Interface: Only method declarations. Multiple interfaces can be implemented, only one abstract class can be extended.
A: Passing dependencies via constructor or method. Promotes loose coupling and easier testing.
A: Uses static:: instead of self:: to refer to the class that called the method, not the class it is defined in.
Example:
trait Logger {
Q: What is the difference between JOIN, LEFT JOIN, and INNER JOIN?
LEFT JOIN: All rows from the left and matched rows from the right.
A: An index that contains all columns needed by a query, reducing table lookups.