Technical Senior Level

How do you implement background job processing in PHP? Discuss queue systems, worker processes, and failure handling.

Quick Tip

Show production readiness: "I dispatch jobs to a Redis-backed queue. Workers run under supervisord with automatic restart. Failed jobs go to a failure transport for inspection. Every job is idempotent because at-least-once delivery means it might run twice."

What good answers include

PHP is request-bound by default — background processing requires a queue system. Options: Symfony Messenger, Laravel Queues, or standalone libraries with Redis, RabbitMQ, or database backends. Workers are long-running PHP processes (php bin/console messenger:consume) managed by supervisord or systemd. Key considerations: job serialisation, retry strategies with exponential backoff, dead letter queues for failed jobs, idempotency (jobs may be delivered more than once), and memory management (workers should restart periodically to avoid leaks). Strong candidates discuss: choosing between sync and async transports, monitoring queue depth and processing time, graceful shutdown on deploy, and the specific failure modes of each transport (Redis vs AMQP vs database).

What interviewers are looking for

Senior question. Candidates who do heavy work synchronously in HTTP requests build slow, unreliable applications. Those who understand queues, workers, retry strategies, and idempotency design robust async workflows.

← All PHP questions