Skip to content
Tutorials Center
My learning

Topics

Lesson 29 of 30 ยท Practice and Review

Shopware Interview Questions

Prepare for a Shopware 6 developer interview: concise answers on architecture, the DAL, events, plugins versus apps, caching, security and deployment, with two runnable stand-ins.

A Shopware interview usually mixes concept questions ("what is the difference between a plugin and an app?") with judgment questions ("how would you add a field to products without breaking upgrades?"). Interviewers care less about trivia than about whether you know why the platform is built the way it is and which tool fits which job. They also like candidates who say "it depends, and here is on what".

This lesson collects common questions with short model answers, grouped by topic and linked to the lessons that explain each idea in depth. Details can change between 6.x versions, so where an answer depends on the exact release it says so; in an interview, saying "I would check the current docs for the exact name" is better than guessing. Shopware cannot run on this site, so real code is read-only, and the two runnable examples at the end are plain-PHP stand-ins (a tagged cache and a plugin versus app failure comparison), not Shopware code. The best way to use the page is to cover the answers, say yours out loud, and then compare.

flowchart TD
    Q["Interview topics"] --> A["Architecture<br/>stack, container, lifecycle"]
    Q --> B["Data<br/>DAL, migrations, extensions"]
    Q --> C["Extending<br/>events, flows, apps"]
    Q --> D["Quality<br/>caching, security, performance"]
    Q --> E["Operations<br/>deployment, updates"]

The five areas that cover most Shopware interviews.

Architecture

What is Shopware 6 built on?

Symfony (kernel, container, routing, console, messenger), a MySQL or MariaDB database accessed through Doctrine DBAL and its own Data Abstraction Layer, Twig for the storefront, and a Vue-based single-page administration. It is API-first: the storefront itself uses the Store API. See What Is Shopware 6?.

What are the ways to extend Shopware?

Plugins (PHP code that runs inside the shop), apps (external services that talk to the shop through the API and webhooks, declared by a manifest), themes (a special kind of plugin or app for the storefront's look) and plain configuration. Which one you pick depends on where the code must run and who hosts the shop.

How is a plugin structured and activated?

A Composer package whose composer.json names a plugin class extending Shopware\Core\Framework\Plugin. The class has lifecycle methods (install, activate, update, deactivate, uninstall). You register it with plugin:refresh and enable it with plugin:install --activate. See Plugin Structure and Lifecycle.

What should uninstall do with the plugin's data?

Respect UninstallContext::keepUserData(). If the merchant wants to keep data, leave tables and custom fields alone; if not, remove them. Never drop data silently.

How does dependency injection work?

Services are defined in services.xml (or PHP configuration), autowired by constructor types, and can carry tags that other services consume. A plugin can decorate a core service to wrap its behavior. See Services and the Dependency Injection Container.

Why constructor injection and not a static helper or service locator?

Dependencies are explicit, testable and replaceable. A hidden lookup in the middle of a method makes code hard to test and hides coupling.

The Data Abstraction Layer

What is the DAL and why not plain Doctrine ORM?

A Shopware layer that describes entities with EntityDefinition classes and derives repositories, Admin and Store API endpoints, validation, translations, versioning and inheritance from them. Every entity, core or custom, behaves the same way through the same criteria syntax. Doctrine DBAL is still used for raw SQL. See Custom Entities and Definitions.

Does the DAL create my tables?

No. You write a migration. Keeping the definition and the table in step is your job, and a mismatch is the most common reason a new entity fails on its first write. See Database Migrations.

What is the difference between update and destructive in a migration?

update() makes changes that are safe while the old code still runs (create a table, add a nullable column). updateDestructive() runs later and removes things the previous version needed (drop a column), so a rolling deployment never has old code reading a missing column.

search or searchIds?

search hydrates entities with their associations; searchIds returns only ids and is much cheaper. Use ids when you need existence checks, counts or a list to feed another query. See Reading and Writing with Repositories.

create, update, upsert: how do you choose?

create fails if the id exists, update fails (or does nothing, depending on the case) if it does not, upsert does either. For sync jobs where the data may or may not exist, upsert with a deterministic id is idempotent. For stock changes on existing products, update avoids creating products by accident.

How do you avoid N+1 queries?

Add the associations you read to the criteria, so the DAL loads them in bulk, and do not add the ones you do not read. Inside loops, never call a repository per item. See Security and Performance.

Entity extension or custom field?

A custom field lives in a JSON column of the entity, is configurable in the admin and needs no new table; it is good for simple, merchant-owned data. An entity extension adds typed fields or associations in code, can be indexed and queried properly, and suits structured, plugin-owned data. See Entity Extensions and Custom Fields.

Events, flows and background work

What is an event subscriber?

A class that implements EventSubscriberInterface, returns the events it listens to from getSubscribedEvents(), and is tagged kernel.event_subscriber. Typical events are entity written or loaded events and page loaded events. See Subscribers and Core Events.

What are the risks of subscribers?

They run on every dispatch, so slow work or extra queries multiply (a product.loaded listener runs for lists of hundreds of products). They can also cause side effects inside loops. Keep them cheap, check early whether they apply, and push heavy work to the queue.

Subscriber or decoration?

A subscriber reacts to an event the author chose to dispatch; it cannot replace the service. Decoration wraps any service and can change its result, but the core service must be decoratable and stacked decorators depend on order. Prefer events for "react to this", decoration for "change how this works".

What is the Flow Builder?

A rule-based automation in the administration: a trigger (an event such as an order being placed), conditions, and actions (send mail, set a tag, call a webhook). You can ship custom actions as plugin classes. See Flow Builder: Triggers and Custom Actions.

How do scheduled tasks and the message queue work?

A scheduled task is a message dispatched on an interval; a handler processes it. Messages go through the Symfony Messenger transport, and a worker (messenger:consume or the admin worker) must run for anything to happen. Jobs must be idempotent, because messages can be retried. See Scheduled Tasks and the Message Queue.

Plugins versus apps

When would you choose an app over a plugin?

When the extension must run on Shopware's cloud offering (where you cannot install PHP plugins), when you want it to run on your own infrastructure and scale separately, when you serve many shops, or when failures must not take down the shop. Apps get permissions through the manifest and talk to the shop through the API and signed webhooks. See Apps, Webhooks and Signatures.

When do you still need a plugin?

When you must hook deep into the PHP code: custom DAL entities used internally, decorating core services, new storefront controllers, or heavy synchronous logic in the request. Plugins have full access, which is both their power and their risk.

How do apps prove who they are?

During registration the shop and app exchange secrets, and webhook requests carry an HMAC signature of the body that the app must verify (with a constant-time comparison) before trusting the payload. See the TryIt in Practice Exercises with Solutions.

Caching, performance and security

Which caches exist in a Shopware shop?

The HTTP cache for storefront pages (served by the built-in cache or a reverse proxy such as Varnish or a CDN), application caches for objects and configuration (Symfony cache pools), and the Store API route caches. Caches are invalidated by tags, for example when a product changes. See Security and Performance.

Why must personal pages not be publicly cached?

A cached page is served to everyone. Anything customer-specific (cart, account, wishlist) must come from uncached routes or be loaded separately, otherwise one customer can see another's data.

What does an indexer do?

Derived data (search keywords, product variants' inherited values, category assignments) is precomputed after writes by indexers, often through the queue. Writing lots of entities can queue much indexing work, which is why bulk jobs think about indexing behavior.

What are the main security duties of a plugin author?

Bind SQL parameters (or use the DAL), let Twig escape output, use _loginRequired and ACL privileges on routes, validate input with DataValidator, avoid trusting customer-supplied ids, and never put secrets in logs or in config exposed to the storefront. The DAL's ApiAware flag decides which fields the Store API exposes; do not mark private fields.

What is ACL in the administration?

Roles with privileges such as product:read or order:update. Admin API routes can require privileges, and admin modules declare which they need, so a user without the privilege cannot call or see them.

Deployment and updates

How are Shopware shops deployed?

Usually as a Composer project: composer install --no-dev in a build step, assets built in CI, and on release bin/console system:update:finish (migrations), plugin:update for changed plugins, cache clear and warm-up. Use maintenance mode or a rolling strategy when migrations are destructive. See Packaging, Deployment and Updates.

How do you keep a plugin compatible with several Shopware versions?

Declare a Shopware version constraint in composer.json, avoid internal classes (those marked @internal), follow the platform's deprecation notices, and run your tests against the oldest and newest versions you support.

What do you check before releasing a plugin?

Install, update from the previous version, deactivate and uninstall on a clean shop; migrations are repeatable; snippets exist for every language; the plugin passes static analysis and its tests; the changelog and version are correct.

Two stand-ins to play with

These examples are not Shopware code. They make two answers above concrete.

Tagged cache invalidation

An answer like "caches are invalidated by tags" is easier to remember once you have built a tiny one. Entries carry tags; invalidating a tag removes every entry that has it, and nothing else.

PHP A cache that invalidates by tag

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with fgets(STDIN)), it gets the next line from this box.

Only the two entries tagged product-1 were rebuilt; detail:2 stayed cached. That precision is what tag-based invalidation buys over clearing everything. What is stand-in: the in-memory arrays. What is real: the idea that a write names the tags it affects.

Plugin or app: who pays for a failure?

The blast radius differs. A plugin runs in the shop's own process, so an uncaught exception in it fails the customer's request. An app is called over HTTP with a timeout, so the shop can catch the failure and carry on with a default.

PHP Blast radius of a plugin versus an app

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with fgets(STDIN)), it gets the next line from this box.

In this simplified model the app failure is handled by the shop and the customer still gets a price, while the plugin bug becomes a failed request. In real life you can also wrap plugin calls in your own try/catch, and apps can be slow or wrong in other ways, so the trade-off is about default blast radius, not a guarantee.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. What does the DAL generate from an EntityDefinition?

    The definition feeds the repository and the APIs. The table comes from a migration you write.
  2. 2. Why is updateDestructive separate from update in a migration?

    Destructive changes run later, once the old code is no longer in use.
  3. 3. Which statement about message queue jobs is correct?

    Messages can be retried, so handlers must be idempotent, and a worker process has to consume the queue.
  4. 4. Why should customer-specific pages not be publicly cached?

    Public caches key on the URL, not the person. Personal data has to come from uncached routes.

Summary

  • Know the stack (Symfony, DAL, Twig, Vue) and the four ways to extend: plugin, app, theme, configuration.
  • The DAL derives repository, API and validation from a definition; the table and its migrations are yours.
  • Prefer events to react, decoration to change behavior, and keep subscribers cheap.
  • Queue jobs need a worker and must be idempotent; caches invalidate by tag.
  • Plugins have full power and full blast radius; apps trade depth for isolation.
  • Deploy with Composer, run update commands and destructive migrations at the right time.

Finish the track with the quick reference in Shopware Plugin Cheat Sheet.