PHP — Interview questions
PHP Coding
Core PHP coding and the standard library — the array and string functions, closures and arrow functions, named arguments and first-class callables, JSON versus serialization, multibyte text, dependency injection, and streaming large files.
27 questions
Composer & Autoloading
Dependency management with Composer — the lock file and semver constraints, PSR-4 autoloading and namespaces, require versus require-dev, the PHP-FIG interop standards, and optimizing the autoloader for production.
13 questions
Databases & PDO
Talking to a database from PHP — PDO versus mysqli, prepared statements and transactions, optimistic and pessimistic locking, indexing and hunting the missing index, and connection management under the shared-nothing FPM model.
14 questions
Deployment & Operations
Running PHP in production — environment configuration through .env, logging and error monitoring, feature flags for risky rollouts, zero-downtime deploy strategies, and scheduled tasks across a fleet of app servers.
10 questions
Framework Core
What Laravel and Symfony actually do for you — MVC, the service container and autowiring, middleware and events, routing and controllers, Blade and Twig templating, validation, authorization policies and voters, and API authentication.
23 questions
PHP Language Basics
Core PHP semantics — loose versus strict comparison and type juggling, include and require, null handling with isset/empty and the null-coalescing operators, string literals and heredoc, variable scope and references, and the match expression.
16 questions
PHP OOP
Object-oriented PHP — interfaces versus abstract classes, traits and conflict resolution, magic methods, visibility and late static binding, promoted and readonly properties, enums, static members, and the patterns interviewers ask you to write.
22 questions
ORM & Persistence
Persistence with Eloquent and Doctrine — Active Record versus Data Mapper, migrations, the N+1 problem and how to detect it in production, lazy versus eager loading, mass assignment, seeders and factories, and whether a repository layer earns its keep.
10 questions
Performance & Caching
Making PHP fast — application caching in Redis or Memcached, cache invalidation, queues and asynchronous jobs, profiling with Xdebug and Blackfire, scaling the FPM pool, offloading static assets to a CDN, and HTTP caching headers.
13 questions
PHP Runtime & Internals
How PHP runs — the shared-nothing request model, daemons, php-fpm with nginx, OPcache and its production tuning, generators and iterators, PHP 8 language features, worker-mode runtimes (FrankenPHP, RoadRunner, Octane), and engine internals (JIT, refcounting and the cycle collector, copy-on-write zvals).
17 questions
PHP Security
Web security in PHP — SQL injection and prepared statements, XSS and output escaping, CSRF tokens, password hashing, session security and fixation, input validation versus output encoding, secrets management, and rate limiting.
12 questions
PHP Testing
Testing PHP code — coding standards (PSR), the PHPUnit/Pest toolchain, and mocking external dependencies through injected seams.
16 questions
Types & Error Handling
The PHP type and error model — errors versus exceptions, the Throwable hierarchy, try/finally semantics, union and intersection type declarations, strict_types coercion, attributes read through Reflection, and custom error handlers.
17 questions