Interview practice

Python Backend Developer

5–8 years · Senior — Python · Django / Flask / FastAPI · REST APIs · SQL · Celery · Testing

0–2 years 2–5 years 5–8 years 8+ years
technical Testing 1 of 6
You have a suite of automated tests, but the execution time has doubled to over 30 minutes. What actions do you take to diagnose and resolve this issue?
What a strong answer covers

Identifies slow tests by profiling test execution; considers parallelising test execution with pytest-xdist; checks for unnecessary I/O operations during tests; removes redundant tests or merges similar ones; evaluates the use of mocking to reduce dependencies on external services.

The follow-up you would get

How do you determine which tests should be run in parallel versus sequentially?

Could you have answered that?
technical Database Management 2 of 6
Your application is experiencing increased latency when accessing a PostgreSQL database, which has grown to 1 million rows. What steps do you take to investigate and improve performance?
What a strong answer covers

Analyses slow query logs for problematic queries; examines the execution plans for those queries; checks for missing indexes and considers adding them; looks at table bloat and vacuuming; evaluates the database connection pool settings.

The follow-up you would get

What is table bloat and how can it affect performance?

Could you have answered that?
ownership A migration you led 3 of 6
Can you describe a significant migration you led, such as moving to a new database or framework? What challenges did you face?
What a strong answer covers

Names the specific migration and its context; describes the planning and execution phases, including testing strategies; identifies key challenges encountered during the migration; explains how those challenges were overcome; mentions any impact on users or services during the migration.

The follow-up you would get

What would you change about your approach if you did it again?

Could you have answered that?
scenario Failure Recovery 4 of 6
A critical background job using Celery has failed, but you only receive a notification hours after the failure. How do you respond in the first fifteen minutes?
What a strong answer covers

Identifies the specific task that failed and checks Celery logs for tracebacks; verifies whether the task has been retried or if it requires manual intervention; assesses the impact of the failure on downstream services; starts an immediate investigation into the root cause; escalates to relevant team members if necessary.

The follow-up you would get

The error was due to a transient issue that has now resolved. How do you prevent this type of failure from recurring?

Could you have answered that?
ownership An incident you handled 5 of 6
Describe an incident where a production issue arose in your service. What was your approach to resolving it?
What a strong answer covers

Identifies the specific incident and its impact; outlines the immediate steps taken to diagnose the issue; details the resolution process and communication with stakeholders; mentions any long-term changes implemented to prevent recurrence; reflects on lessons learned from the incident.

The follow-up you would get

What would you do differently next time?

Could you have answered that?
technical API Design 6 of 6
You need to implement a REST API endpoint that processes 1,000 requests per second, but currently, it handles only 100 requests per second. How do you identify the bottleneck and what optimisations do you consider first?
What a strong answer covers

Profiles the endpoint to identify slow parts; checks database query performance and optimises SQL queries; evaluates the use of caching for frequent data; considers load testing with tools like Locust to simulate traffic; discusses horizontal scaling options if necessary.

The follow-up you would get

What specific caching strategies would you consider for this scenario?

Could you have answered that?
That is this set.

Load six more — you will get questions you have not seen first.

Give me six more →

Say your answer out loud before revealing. Reading the answer first feels like learning and is not.