← Back to Tutorials

38. Appendix

Best Practices

Interview Questions

  1. What is FastAPI and how does it differ from Flask?
  2. Explain the role of Pydantic in FastAPI.
  3. How does FastAPI handle async requests?
  4. What is dependency injection in FastAPI?
  5. How do you validate query parameters?
  6. Explain the lifespan protocol.
  7. How would you mount a Flask app inside FastAPI?
  8. What is CORS and how do you configure it?
  9. How do you handle database sessions in FastAPI?
  10. What are WebSockets and how do you implement them?

Glossary

TermDefinition
ASGIAsynchronous Server Gateway Interface — standard for async Python web apps
WSGIWeb Server Gateway Interface — synchronous standard (Flask, Django)
PydanticData validation library using Python type annotations
OpenAPIStandard API specification format (formerly Swagger)
StarletteASGI framework that FastAPI is built on
UvicornASGI server for running FastAPI