Backend

Flask

A Python microframework: a minimal core with routing and templates, the rest through extensions.

What it is

Flask is built on Werkzeug (WSGI tools) and the Jinja2 template engine. The core handles routing, requests, responses and templates, while ORM, forms and auth come from extensions.

You decide how to structure the project and which database or ORM to use. That gives freedom and demands discipline.

Flask suits small APIs, prototypes and learning. For large products teams often pick Django or FastAPI.

Use it when

  • Small APIs and services with minimal dependencies.
  • Prototypes and tools for learning the web.
  • You want full control over the library set.

Avoid it when

  • A large app that needs admin, ORM and auth out of the box: Django.
  • You need async and auto-generated OpenAPI: FastAPI.

Key concepts

Blueprint
A way to split an app into modules with their own routes.
Application context
The context giving access to current_app, g and request.
Jinja2
The HTML template engine.
WSGI
The sync interface run by Gunicorn or uWSGI.

Example

A route with a query parameter.

Interview questions

  1. 1. Why is Flask called a microframework?

    Its core is minimal and does not impose an ORM, forms or project structure. Everything is added by extensions as needed.

  2. 2. What is a Blueprint?

    A set of routes and resources registered in the app with a prefix. It helps split code into modules.

  3. 3. How do you run Flask in production?

    Through a WSGI server such as Gunicorn, often behind Nginx. The built-in dev server is not meant for production.

Logos belong to their owners and are used for identification only. Icons: Simple Icons (CC0), Devicon (MIT).