Recall & Review
beginner
What is a health check endpoint in a Flask application?
A health check endpoint is a simple URL route that returns a status indicating if the Flask app is running properly. It helps monitoring tools know if the app is healthy.
Click to reveal answer
beginner
How do you create a basic health check endpoint in Flask?
You define a route like
@app.route('/health') and return a simple response like {'status': 'ok'} with HTTP status 200.Click to reveal answer
intermediate
Why should health check endpoints be lightweight and fast?
Because they are called frequently by monitoring systems to quickly verify app status without adding load or delays to the app.
Click to reveal answer
beginner
What HTTP status code is commonly returned by a healthy Flask health check endpoint?
HTTP status code 200 means the app is healthy and responding correctly.
Click to reveal answer
intermediate
How can you extend a health check endpoint to check database connectivity in Flask?
Inside the health check route, add a quick query or ping to the database. If it succeeds, return healthy; if it fails, return an error status.
Click to reveal answer
What is the main purpose of a health check endpoint in Flask?
✗ Incorrect
Health check endpoints are designed to confirm the app is up and running.
Which HTTP status code usually indicates a healthy Flask app in a health check?
✗ Incorrect
Status code 200 means OK, indicating the app is healthy.
What should a health check endpoint avoid doing?
✗ Incorrect
Health checks should be lightweight and fast, avoiding heavy tasks.
How can you test database connectivity in a Flask health check?
✗ Incorrect
A quick query or ping confirms the database is reachable.
Where do you define a health check endpoint in Flask?
✗ Incorrect
Flask endpoints are defined with @app.route decorators.
Explain how to create a simple health check endpoint in Flask and why it is useful.
Think about a URL that tells if your app is alive.
You got /4 concepts.
Describe how you would enhance a Flask health check endpoint to verify database connectivity.
Check if the app can talk to its database quickly.
You got /4 concepts.