# Interview Questions & Tips — Fastify

Source: https://www.geekswithgeeks.com/en/fastify/ff-interview-questions

> Common Fastify questions asked in interviews.

**Quiz:** Why is Fastify faster than Express?

- [ ] It uses a different programming language
- [x] It has lower overhead through object pooling, efficient routing, and built-in validation
- [ ] It doesn't support middleware

*Answer:* It has lower overhead through object pooling, efficient routing, and built-in validation. Fastify reuses request/reply objects, optimizes routing with a trie-based router, and validates input with JSON Schema—all designed for performance.

**Quiz:** What is the purpose of Fastify plugins?

- [ ] To add CSS styling to routes
- [x] To encapsulate and reuse functionality (auth, DB, logging) across routes
- [ ] To replace Express middleware

*Answer:* To encapsulate and reuse functionality (auth, DB, logging) across routes. Plugins enable modular, maintainable code by separating concerns and allowing reusable components to be registered across the app.

**Quiz:** How does Fastify handle async/await in route handlers?

- [ ] It wraps them in try/catch automatically
- [x] It catches rejected promises and passes errors to the error handler
- [ ] Async handlers are not supported

*Answer:* It catches rejected promises and passes errors to the error handler. Fastify is built on async/await and automatically catches rejected promises, routing them to the setErrorHandler.
