This is an old revision of the document!
Table of Contents
Senior PHP (Laravel/Symfony) & Golang Backend Interview Questions
PHP Fundamentals
1. What are PSR standards and why do they matter?
2. What new features in PHP 8.x have you used?
3. How does Composer autoloading work?
4. What is the difference between interface, abstract class, and trait?
5. What are PHP attributes and when would you use them?
6. How does PHP-FPM work?
7. How does OPCache improve performance?
8. Explain the lifecycle of an HTTP request in PHP.
9. How does memory management work in PHP?
10. Can PHP handle concurrency? What approaches can be used?
11. How would you implement concurrent API calls in PHP?
12. What are Fibers in PHP?
13. What is Swoole/RoadRunner and how do they differ from PHP-FPM?
14. What do the three numbers in Semantic Versioning (MAJOR.MINOR.PATCH) mean?
Laravel & Symfony
1. How does Laravel's service container work?
2. What are Laravel service providers?
3. Explain Dependency Injection in Laravel.
4. How do Laravel middleware work?
5. How do Laravel events and listeners work?
6. How do Laravel queues work?
7. How do you handle long-running tasks in Laravel?
8. How does Eloquent ORM work internally?
9. What are the advantages and disadvantages of Eloquent vs Query Builder?
10. Explain Symfony Dependency Injection.
11. Explain Symfony Event Dispatcher.
12. Explain Symfony Messenger.
13. Which Laravel and Symfony versions are you currently using?
Golang
1. Explain the lifecycle of an HTTP request in Go.
2. What is a goroutine?
3. Goroutine vs Thread?
4. What is a channel?
5. Buffered vs Unbuffered channels?
6. What is a select statement?
7. What are common goroutine leaks and how do you prevent them?
8. What is context.Context and why is it important?
9. How does cancellation propagate through contexts?
10. What is an interface in Go?
11. What is interface segregation in Go?
12. What are type assertions and type switches?
13. How does dependency injection work in Go?
14. How does Go's scheduler work?
15. Explain GOMAXPROCS.
16. How does garbage collection work in Go?
17. How do you gracefully shut down a Go service?
18. How do you handle SIGTERM and SIGINT?
19. During server shutdown, how do you finish remaining requests safely?
20. What are worker pools and when would you use them?
Authentication & Authorization
1. Session vs JWT vs OAuth2?
2. How does Session Authentication work internally?
3. How does JWT Authentication work internally? Explain the roles of Secret Keys, Public Keys, and Private Keys?
4. What are the three parts of a JWT?
5. Access Token vs Refresh Token?
6. How does OAuth2 work?
7. Explain Authorization Code Flow.
8. Explain Client Credentials Flow.
9. Explain PKCE.
10. What is OpenID Connect (OIDC)?
11. What is RBAC?
12. What is ABAC?
13. How would you implement authorization in Laravel?
14. How would you implement authorization in Go?
15. When should you choose Session over JWT?
16. When should you choose OAuth2 over JWT?
Security
1. What is CORS and why do browsers need it?
2. Simple Request vs Preflight Request?
3. Important CORS headers?
4. Why can't wildcard origins be used with credentials?
5. How do cookies work?
6. What is HttpOnly?
7. What is Secure Cookie?
8. What is SameSite?
9. SameSite=Strict vs Lax vs None?
10. What is CSRF?
11. How does Laravel protect against CSRF?
12. What is XSS?
13. Stored vs Reflected vs DOM XSS?
14. What is SQL Injection?
15. What is SSRF?
16. What is Clickjacking?
17. What is Rate Limiting?
18. What are OWASP Top 10 risks?
19. How do you secure REST APIs?
20. How do you secure file uploads?
Database
Fundamentals
1. What are indexes and their trade-offs?
2. Clustered vs Non-Clustered Index?
3. Covering Index?
4. B-Tree vs Hash Index?
5. PostgreSQL vs MySQL?
6. When would you choose PostgreSQL?
7. What is JSONB?
8. Normalization vs Denormalization?
Query Optimization
9. How do you optimize a slow query?
10. How do you use EXPLAIN?
11. What is the N+1 problem?
12. How do you optimize queries on tables with billions of rows?
13. What database metrics do you monitor?
Transactions
14. What are ACID properties?
15. Explain Isolation Levels.
16. Read Committed vs Repeatable Read vs Serializable?
17. Optimistic vs Pessimistic Locking?
18. What are deadlocks?
Large Scale Databases
19. How would you add a new column to a table with billions of rows?
20. What migration risks should be considered?
21. How would you backfill data safely?
22. How do online schema migrations work?
23. How do you avoid downtime during migrations?
24. How would you design monthly/yearly statistics tables?
25. How would you generate reports with billions of rows?
26. Realtime reporting vs batch reporting?
27. When should you use materialized views?
28. How would you implement pre-aggregation?
29. How would you partition very large tables?
30. Sharding vs Partitioning?
REST API
1. HTTP methods and their meanings?
2. What makes an API RESTful?
3. HTTP 401 vs 403?
4. Important HTTP status codes?
5. Idempotent APIs?
6. API versioning strategies?
7. Pagination strategies?
8. Cursor vs Offset Pagination?
9. Rate limiting strategies?
10. API gateway responsibilities?
Architecture & Scalability
1. Explain the SOLID principles.
2. Explain Dependency Inversion with examples.
3. What design patterns do you use most?
4. Factory Pattern?
5. Strategy Pattern?
6. Repository Pattern?
7. Observer Pattern?
8. Event-Driven Architecture?
9. CQRS?
10. Domain-Driven Design?
11. Clean Architecture?
12. Hexagonal Architecture?
13. Monolith vs Microservices?
14. How would you break a monolith into services?
15. Eventual Consistency?
16. Distributed Transactions?
17. Saga Pattern?
18. How would you design a scalable REST API?
19. How would you design a booking system?
20. How would you design a POS system?
Queue, Messaging & Streaming
1. Why use queues?
2. How do Laravel queues work?
3. SQS vs RabbitMQ vs Kafka?
4. Message Queue vs Event Stream?
5. At-least-once vs Exactly-once delivery?
6. Dead Letter Queues?
7. Retry strategies?
8. Idempotent consumers?
9. Event sourcing?
10. How would you process millions of jobs per day?
Testing
1. Unit vs Integration vs Functional Tests?
2. Mock vs Stub vs Fake?
3. Testing external APIs?
4. Contract Testing?
5. What should be mocked?
6. Testing asynchronous jobs?
7. Testing event-driven systems?
8. Code coverage targets?
DevOps & Cloud
1. Ideal CI/CD pipeline?
2. Blue-Green vs Canary Deployment?
3. Secrets management?
4. Docker vs Kubernetes?
5. ECS vs EKS?
6. How would you deploy a PHP application?
7. How would you deploy a Go service?
8. AWS services commonly used in backend systems?
9. CloudFront?
10. SQS?
11. EventBridge?
12. RDS Proxy?
13. Auto Scaling?
14. Observability strategies?
Leadership
1. Effective code reviews?
2. Enforcing coding standards?
3. Mentoring junior developers?
4. Handling repeated mistakes?
5. Communicating with non-technical stakeholders?
6. Handling technical disagreements?
7. Leading architecture discussions?
8. Managing production incidents?
Bonus
1. GraphQL vs REST?
2. gRPC vs REST?
3. OpenTelemetry?
4. Distributed Tracing?
5. CAP Theorem?
6. Consistent Hashing?
7. What backend technology trends are you currently following?
