OctogleHire
← Interview questions library

25 Laravel interview questions

Structure the Laravel interview loop around evidence, not framework trivia. Start with a 30-minute screen to confirm recent Laravel experience, PHP version comfort, communication, and remote working habits. Follow with a practical review: either a small take-home or a live pairing task that exercises Eloquent, validation, authorization, tests, queues, and debugging. Add a technical interview focused on trade-offs: data modeling, service boundaries, cache invalidation, observability, deployment, and production incidents. For senior candidates, include a system design session using Laravel-specific tools such as Horizon, Octane, Reverb, Pulse, queues, events, policies, and scheduled jobs. Finish with a collaboration interview covering code review, ownership, mentoring, and how they work with product and non-PHP teams.

Junior Laravel questions

Fundamentals, learning speed and how they debug.

  1. 01You inherit a Laravel endpoint that works locally but returns 500 in staging. How would you investigate before changing code?

    Listen for: A strong answer starts with reproducing the request, checking logs, environment differences, config cache, database connection, migrations, permissions, queue workers, and third-party credentials. They should know to use Laravel logs, exception traces, Telescope if available, and safe read-only checks before guessing or editing production-like configuration.

    Red flag: They immediately suggest changing code or clearing every cache without first identifying the failing layer.

  2. 02How would you decide whether logic belongs in a controller, Form Request, model, action class, or job?

    Listen for: Look for separation of concerns rather than rigid rules. Good candidates put request validation and authorization in Form Requests or policies, keep controllers thin, avoid bloated models, use action or service classes for reusable workflows, and move slow or retryable work into jobs while keeping transaction boundaries clear.

    Red flag: They say all business logic should always go in controllers or always go in models.

  3. 03A feature requires users to update only their own profile. How would you implement and test that in Laravel?

    Listen for: They should mention policies or gates, route model binding, authenticated feature tests, positive and negative cases, and avoiding trust in request user_id fields. Strong junior candidates include validation, proper HTTP statuses, database assertions, and checking that another user cannot update or even infer unauthorized resources.

    Red flag: They rely only on hiding buttons in Blade or the frontend to enforce access control.

  4. 04What do you check when an Eloquent query becomes slow after adding a relationship to an API response?

    Listen for: A good answer identifies N+1 queries, eager loading with constraints, selecting only needed columns, pagination, indexes, query logging, and using database explain plans. They should understand that API Resources can accidentally trigger lazy loading and that fixing performance should be verified with tests or measured query counts.

    Red flag: They suggest caching the whole response before checking the query pattern or database indexes.

  5. 05How do you write useful tests for a Laravel feature without making the test suite brittle?

    Listen for: Listen for feature tests around behavior, factories and seeders for setup, database refresh or transactions, assertions on outcomes rather than implementation details, faking mail, notifications, queues, and events where appropriate. They should test authorization and validation paths while avoiding over-mocking Laravel internals.

    Red flag: They only test happy paths or assert exact HTML and private method behavior for every feature.

  6. 06A queued job sends an email and updates a status field. What failure cases would you consider?

    Listen for: They should discuss retries, idempotency, duplicate sends, job timeouts, failed_jobs, partial updates, transactions, external provider errors, and logging. A good junior answer notes that queue workers must be running with the right environment and that mail can be faked in tests.

    Red flag: They assume a queued job either always completes once or simply disappears if it fails.

Mid-level Laravel questions

Independent delivery, trade-offs and code quality.

  1. 07Describe how you would design a Laravel feature that imports a large CSV file from an admin panel.

    Listen for: Strong answers split upload, validation, storage, parsing, and processing. They use queues or batches, chunking, progress tracking, row-level error reporting, idempotency, and authorization. They avoid loading the whole file into memory and think about rollback strategy, duplicate detection, timeouts, and user feedback.

    Red flag: They process the entire CSV synchronously inside the controller request.

  2. 08An API endpoint sometimes returns stale data even after a user updates a record. How would you debug and fix it?

    Listen for: Look for a systematic path: confirm write success, transaction timing, read replica lag, cache keys and tags, model events, resource transformation, HTTP caching, and queued projections. Strong candidates discuss cache invalidation over blanket clearing and add tests around update-read behavior where possible.

    Red flag: They clear all application cache on every update without considering scope or concurrency.

  3. 09How do you choose between Laravel events/listeners, queued jobs, observers, and direct service calls?

    Listen for: A strong answer weighs coupling, observability, transaction boundaries, ordering, retries, and failure handling. They use direct calls for required synchronous work, events for decoupled domain reactions, observers carefully for persistence side effects, and queued jobs for slow or retryable work, with clear naming and monitoring.

    Red flag: They use events for everything because it feels cleaner, even when the caller must know the result.

  4. 10How would you handle multi-step validation where rules depend on database state and the authenticated user?

    Listen for: They should combine Form Requests, policies, custom validation rules, after hooks, and service-level invariants. Good answers avoid duplicating rules across controller and frontend, guard against race conditions with database constraints or transactions, and produce clear validation messages without exposing sensitive data.

    Red flag: They put all checks in JavaScript or assume validation alone can enforce business invariants under concurrency.

  5. 11You see intermittent deadlocks around order creation. What Laravel and database-level changes might you consider?

    Listen for: Listen for transaction review, consistent lock ordering, smaller transaction scopes, proper indexes, retrying deadlocks safely, avoiding external calls inside transactions, and using database constraints. Strong candidates understand Eloquent can hide multiple queries and will inspect SQL logs or database monitoring, not only PHP code.

    Red flag: They increase the PHP timeout or queue timeout without addressing locking behavior.

  6. 12How would you prepare a Laravel 10 or 11 application for an upgrade to Laravel 12 or 13?

    Listen for: Good answers include reading upgrade guides, checking PHP and Composer constraints, updating first-party packages, running tests, static analysis, deprecation fixes, config comparison, CI updates, and staged deployment. They mention Rector or Laravel Shift as aids, not substitutes, and plan rollback for production.

    Red flag: They update composer.json directly on main and rely on manual clicking through the app afterward.

  7. 13A product manager asks for real-time notifications in a Laravel app. How would you scope the implementation?

    Listen for: They should clarify latency needs, clients, auth, fan-out, persistence, and fallback behavior. Strong answers compare database notifications, broadcasting with Reverb or Pusher-compatible services, queues, private channels, and email or push fallbacks. They consider local development, testing, monitoring, and operational cost in complexity terms.

    Red flag: They immediately choose WebSockets for every notification without asking whether real time is actually required.

Senior Laravel questions

Judgement, architecture and raising the team's bar.

  1. 14How would you set technical direction for a Laravel codebase that has grown into large controllers, duplicated queries, and slow tests?

    Listen for: A senior answer prioritizes incremental refactoring with safety. They identify seams, introduce feature tests, extract workflows into actions or services, standardize query objects or scopes where useful, improve factories, and reduce test suite drag. They balance cleanup with delivery and avoid imposing architecture for its own sake.

    Red flag: They propose a rewrite or a new framework before mapping risks and business priorities.

  2. 15Tell me how you would design authorization for a Laravel SaaS product with teams, roles, and per-resource permissions.

    Listen for: Look for policies, gates, scoped route model binding, tenant-aware queries, role-permission packages only where justified, auditability, and deny-by-default behavior. Strong candidates separate authentication from authorization, test cross-tenant access thoroughly, and consider admin impersonation, invitations, ownership transfer, and background job permissions.

    Red flag: They trust tenant_id or role values submitted by the client.

  3. 16A Laravel queue system processes payments, emails, and analytics. How would you make it reliable and observable?

    Listen for: Strong answers separate queues by priority and risk, tune workers with Horizon or supervisor, define retries and backoff, use idempotency keys, monitor failed jobs and lag, and avoid mixing critical payment jobs with low-value analytics. They discuss poison messages, alerting, deployments, and graceful worker restarts.

    Red flag: They treat queues as fire-and-forget and do not plan for duplicate or delayed execution.

  4. 17How do you decide whether a Laravel monolith should stay modular or split into services?

    Listen for: A good answer starts with team boundaries, deployment pain, data ownership, scaling bottlenecks, and operational maturity. They should favor a well-structured modular monolith until independent lifecycle needs justify services. They discuss APIs, events, contracts, shared authentication, failure modes, and the cost of distributed transactions.

    Red flag: They say microservices are automatically more scalable or that a monolith is always simpler.

  5. 18How would you improve performance for a high-traffic Laravel API without guessing?

    Listen for: Listen for measurement first: APM traces, Pulse, database metrics, slow query logs, cache hit rates, queue lag, and load tests. Strong candidates consider eager loading, indexes, response shape, pagination, Redis caching, Octane suitability, PHP opcache, Horizon tuning, and database connection limits before changing architecture.

    Red flag: They jump straight to Octane or more servers without identifying the bottleneck.

  6. 19What is your approach to secrets, configuration, and environment drift across local, staging, and production Laravel deployments?

    Listen for: They should cover twelve-factor configuration, encrypted secrets or a secrets manager, config caching, clear environment parity, CI validation, least privilege credentials, safe rotation, and avoiding secrets in logs. Good answers include documenting required variables and detecting missing or stale config during deployment.

    Red flag: They commit .env files or rely on copying production credentials into developer machines.

  7. 20How do you review Laravel pull requests from mid-level engineers?

    Listen for: Strong answers focus on behavior, maintainability, security, data integrity, and operability, not style nits already handled by Pint or static analysis. They ask about tests, authorization, migrations, queues, and failure modes. They also explain trade-offs, mentor respectfully, and distinguish blocking issues from preferences.

    Red flag: They mainly enforce personal style and rewrite other engineers’ code without explanation.

System design Laravel questions

Designing real systems end to end.

  1. 21Design a Laravel-based subscription billing workflow that handles checkout, webhooks, invoice status, failed payments, and account access.

    Listen for: Expect clear boundaries between synchronous checkout and asynchronous webhook processing. Strong answers include signed webhook verification, idempotency, event logs, queued processing, state machines or explicit statuses, retries, audit trails, and access decisions based on local trusted state. They avoid relying on redirect success alone.

    Red flag: They grant subscription access immediately after the browser returns from checkout without verifying provider events.

  2. 22Design a multi-tenant Laravel application for agencies managing separate client workspaces.

    Listen for: Good answers compare single database with tenant_id, separate schemas, and separate databases based on isolation, reporting, cost, and operations. They cover tenant resolution, scoped queries, policies, migrations, queues, cache keys, file storage paths, testing cross-tenant leakage, and admin support workflows.

    Red flag: They add tenant_id columns but do not enforce scoping consistently across queries, jobs, and authorization.

  3. 23Design an audit log system for sensitive changes in a Laravel application.

    Listen for: Strong candidates define what events matter, who performed them, before and after values, request metadata, retention, privacy, and tamper resistance. They discuss model events versus explicit domain events, queued writes, transaction timing, searchable storage, redaction, and how audits are tested and reviewed.

    Red flag: They rely only on generic application logs for audit requirements.

  4. 24Design a Laravel notification platform that supports email, in-app, and real-time updates for thousands of users.

    Listen for: Look for Laravel notifications, database channels, queues, broadcast channels, Reverb or managed WebSocket options, user preferences, digesting, rate limits, retries, and unsubscribe rules. Strong answers plan channel-specific templates, delivery status, backpressure, and graceful degradation when real-time delivery is unavailable.

    Red flag: They send every notification synchronously during the user request.

  5. 25Design a reporting dashboard in Laravel that aggregates large order and customer datasets without slowing the main app.

    Listen for: Strong answers consider read models, scheduled aggregation, queued jobs, materialized tables, cache invalidation, database indexes, and separating OLTP from analytical queries where needed. They define freshness requirements, drill-down behavior, authorization, export handling, and monitoring for long-running jobs or lock-heavy queries.

    Red flag: They run complex aggregate queries directly against production tables on every dashboard page load.

Practical task · 2–3 hours

Build and Review a Laravel Order Approval Flow

Create a small Laravel 12 or 13 application feature for approving purchase orders. Provide migrations, models, factories, routes, controllers or actions, Form Requests, policies, and tests. Users can create orders in draft status, submit them for approval, and managers can approve or reject with a required comment. Approval should send a queued notification and write an audit record. Include sensible validation, authorization, and error handling. You may use Blade or JSON responses; the focus is backend design. Keep the solution small enough to explain in a follow-up review and document any trade-offs or unfinished work.

How to evaluate it

  • Clear modeling of order status transitions and prevention of invalid state changes
  • Correct authorization using policies or gates, including negative tests
  • Useful feature tests with factories and faked queues or notifications
  • Readable structure with thin controllers and explicit business workflow code
  • Attention to operational details such as idempotency, audit records, and failed queued work

Rather skip the interview loop?

Every Octogle Laravel engineer has already passed a technical assessment, system design and a live interview with an engineer who has shipped Laravel. Send a brief and get 3–5 scored profiles in 48 hours.