Interview practice

Python Backend Developer

2–5 years · Mid — Python · Django / Flask / FastAPI · REST APIs · SQL · Celery · Testing

0–2 years 2–5 years 5–8 years 8+ years
technical Database access patterns 1 of 6
A database query intended to retrieve user information is consistently running slower than expected. The query is designed to return up to 1000 records. What strategies do you apply to improve performance?
What a strong answer covers

Analyses the execution plan for expensive operations; checks for missing indexes on frequently queried fields; evaluates if the selected columns are necessary or if projections can reduce the load; considers pagination to limit returned records; reviews the database schema for normalization issues.

The follow-up you would get

What impact does denormalisation have on query performance?

Could you have answered that?
scenario Error handling 2 of 6
A third-party service you rely on for user authentication is temporarily unavailable, causing login failures for users. What immediate actions do you take?
What a strong answer covers

Implements a fallback mechanism for local authentication; logs the failure rate for analysis; notifies users of the issue through a status page; escalates to appropriate teams for third-party resolution; assesses impact on user experience.

The follow-up you would get

What long-term strategies would you implement to mitigate the impact of similar outages in the future?

Could you have answered that?
technical API design 3 of 6
You need to design an API endpoint to handle file uploads, but must ensure it can scale with different file sizes. What aspects do you consider in your design?
What a strong answer covers

Defines acceptable file size limits and response handling for large files; considers asynchronous processing for uploads; implements chunked uploads to manage large files; uses validation for file types and integrity checks; discusses rate limiting to prevent abuse.

The follow-up you would get

How would you handle the storage of uploaded files?

Could you have answered that?
technical Testing 4 of 6
A new feature has been developed but only unit tests exist, and they are insufficient due to complex interactions. How do you approach testing in this case?
What a strong answer covers

Identifies integration and end-to-end tests required for complex interactions; uses mocking to isolate components during tests; implements test cases that cover edge cases and user scenarios; evaluates test coverage tools to identify gaps; incorporates Continuous Integration to run tests automatically.

The follow-up you would get

What role does test-driven development play in this process?

Could you have answered that?
scenario Deployment 5 of 6
During a rollout of a new version of your application, you notice a higher than normal error rate in production. How do you handle this situation?
What a strong answer covers

Rolls back the deployment to the previous stable version; investigates error logs to pinpoint the cause; conducts a post-mortem to analyse deployment processes; enhances monitoring for early detection; prepares a plan for safe re-deployment.

The follow-up you would get

What changes would you make to your deployment strategy to prevent this from happening again?

Could you have answered that?
technical Concurrency 6 of 6
You have a Python application using threads for concurrent tasks, but you notice performance bottlenecks. What factors would lead you to consider using async instead?
What a strong answer covers

Identifies I/O-bound tasks as the source of bottlenecks; evaluates the Global Interpreter Lock (GIL) impact on CPU-bound tasks; considers the overhead of thread management; assesses whether using async would simplify control flow; mentions potential libraries like asyncio or aiohttp for handling async tasks.

The follow-up you would get

What specific scenarios still benefit from threads over async?

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.