Flask Interview Questions

Upasana | July 24, 2020 | 2 min read | 1,246 views | Flask - Python micro web framework


Here we will cover top interview questions for Python Flask Micro web framework - API development, Deployment in production, logging and monitoring and testing

flask topics
Flask Interview Question topics

API Development

  1. How will you write a simple Flask API for hello world

  2. How will you implement a singleton design pattern in Flask

  3. How will you implement caching in Flask API

  4. How to return a JSON response form a Flask API

  5. What is virtual environment in python? How does it help in Flask API development?

  6. Introduction to Flask for REST API development

  7. What is Blueprints in Flask API development? Create a blueprint based Flask API

  8. Protecting Flask API endpoint with Basic Authentication

  9. How to create environment specific configuration (dev, qa, prod)

  10. How to call external web service from a Flask API

  11. How to access gcloud data store from Flask App

Deployment

  1. Is Flask’s WSGI Werkzeug development server suitable for production deployment? Why not?

  2. How will you deploy a flask microservice to production?

  3. What is WSGI?

  4. How will you use Gunicorn server for production deployment?

  5. What is containerization? What is docker?

  6. How will you create a simple docker image using gunicorn server for a flask API?

  7. Complete end to end tutorial for Flask API deployment in production environment.

  8. Docker containerization tutorial for Flask API

Logging & Monitoring

  1. How to handle all exceptions at a common place?

  2. How to add logs to the API calls?

  3. How to measure time for API calls using generic approach

Testing

  1. How will you write a unit test for Flask REST API

  2. How to achieve load testing for Flask API

  3. How to write integration tests for Flask API?


Top articles in this category:
  1. Top 100 interview questions on Data Science & Machine Learning
  2. Google Data Scientist interview questions with answers
  3. Part 3: Dockerize Flask application and build CI/CD pipeline in Jenkins
  4. Part 2: Deploy Flask API in production using WSGI gunicorn with nginx reverse proxy
  5. Python coding challenges for interviews
  6. AWS Lambda Interview Questions for Developers
  7. Blueprints in Flask API Development

Recommended books for interview preparation:

Find more on this topic: