Python developer interview questions for remote roles
Python interviews for remote roles test the language itself more than many candidates expect: mutability, generators, decorators, concurrency and the GIL. Then come framework questions on Django or FastAPI, SQL, testing, and a practical task.
These are questions we see often in interviews for remote Python roles open to Nigerian developers.
Updated October 2026 by the WorkRemote careers team
On this page
About the role and your experience
Openers that check you understand the job and have done the work.
Tell me about a Python project you are proud of.
Why they ask
They want depth and ownership.
How to answer
Pick one project, explain the problem, your design, a hard bug and the result in numbers. Be ready to open the code.
Technical questions
What you know and how you'd do the work, often with a live task or test.
What is wrong with def add_item(item, items=[]):?
Why they ask
The classic Python gotcha. It shows whether you understand mutability and when defaults are evaluated.
How to answer
Default values are evaluated once, when the function is defined, so every call that does not pass items shares the same list and it keeps growing. Use items=None and create a new list inside the function when it is None.
What is the difference between a list and a tuple?
Why they ask
A basic check that leads to hashing and immutability.
How to answer
Lists are mutable; tuples are immutable. Tuples of hashable items can be dictionary keys or set members; lists cannot. Use tuples for fixed records and lists for collections that change. Mention named tuples or dataclasses for readable records.
What is a generator, and when would you use one?
Why they ask
Generators matter for memory use with large data.
How to answer
A generator produces values lazily using yield, keeping its state between calls, so it does not build the whole sequence in memory. Use it to stream a large file line by line or process database rows in batches. Generator expressions use parentheses instead of square brackets.
Write a decorator that times how long a function takes.
Why they ask
Decorators appear throughout Django, FastAPI and testing code.
How to answer
A decorator takes a function and returns a wrapper. Use functools.wraps to keep the original name and docstring, and time.perf_counter for timing.
Show a sample answerHide the sample answer
```python
import functools
import timedef timed(func):
@functools.wraps(func)
def wrapper(args, *kwargs):
start = time.perf_counter()
try:
return func(args, *kwargs)
finally:
elapsed = time.perf_counter() - start
print(f"{func.name} took {elapsed:.3f}s")
return wrapper
```
I used something like this to find which step of a nightly report job was slow before moving it to Celery.What is the GIL, and how do you handle CPU-bound work?
Why they ask
Shows you understand Python's performance limits.
How to answer
In the standard CPython build, the Global Interpreter Lock lets only one thread run Python bytecode at a time, so threads do not speed up CPU-bound Python code, though they help with I/O-bound work. For CPU-bound work use multiprocessing or a process pool, push the heavy work into libraries written in C such as NumPy, or offload to a worker. CPython also has an optional free-threaded build without the GIL, but most production code still runs on the standard build.
When would you use asyncio instead of threads?
Why they ask
FastAPI and many modern services are async.
How to answer
asyncio suits many concurrent I/O operations, such as calling several APIs or handling many slow connections, with less overhead than threads. Everything in the call path must be async-aware; one blocking call (like requests or time.sleep) stalls the event loop. Use httpx or aiohttp for HTTP and run blocking code in a thread executor.
What is the N+1 problem in Django and how do you fix it?
Why they ask
The most common Django performance bug.
How to answer
Looping over a queryset and accessing a related object triggers one extra query per row. Use select_related for foreign keys and one-to-one relations (a SQL join) and prefetch_related for many-to-many and reverse relations (a second query). Find it with Django Debug Toolbar or by asserting query counts in tests with assertNumQueries.
Show a sample answerHide the sample answer
An orders admin page at my last job took 6 seconds. Debug Toolbar showed over 300 queries because each row loaded its customer and its items. Adding select_related('customer') and prefetch_related('items') brought it to 3 queries and under half a second.
How does dependency injection work in FastAPI?
Why they ask
A core FastAPI feature used for auth, database sessions and settings.
How to answer
You declare a parameter with Depends(some_function), and FastAPI calls that function per request and passes the result in. Dependencies can depend on others, can use yield for setup and teardown (such as opening and closing a database session), and can be overridden in tests with app.dependency_overrides.
How do you write tests that call an external API?
Why they ask
Tests that hit real services are slow and flaky.
How to answer
Isolate the API call behind a function or client class, then mock it in unit tests with unittest.mock or pytest-mock, or use respx or responses to fake HTTP. Keep a small number of integration tests against a sandbox. Use pytest fixtures to set up shared data.
What is the difference between is and ==?
Why they ask
A quick check for understanding identity versus equality.
How to answer
== compares values by calling eq; is checks whether two names point to the same object. Use is for None, True and False checks, and == for values. Small integer and string caching can make is look like it works for values, which is why it is a trap.
Behavioural questions
Past situations. Answer with a real example: what happened, what you did, what changed.
How do you keep code quality high on a team?
Why they ask
Python's flexibility can produce messy codebases.
How to answer
Ruff for linting and formatting, type hints with mypy or Pyright in CI, pytest with sensible coverage, small pull requests and clear review comments. Give an example of introducing one of these.
Describe a time you automated something that saved your team time.
Why they ask
Automation is one of Python's biggest selling points.
How to answer
Explain the manual process, what you built, and the time or errors saved.
Show a sample answerHide the sample answer
Our finance team in Lagos spent two days each month matching bank statement exports to invoices in Excel. I wrote a Python script with pandas that matched by amount, date and reference, and flagged the leftovers for review. It cut the work to about two hours, and the flagged list caught a duplicate payment in the first month.
Situational questions
Hypotheticals about problems you'd meet in the job.
How would you process a 5GB CSV file on a laptop with 8GB of RAM?
Why they ask
A practical data question that tests memory awareness.
How to answer
Do not load it all at once. Stream it with the csv module, or read it in chunks with pandas (chunksize), or use Polars' lazy scanning or DuckDB, which can query the file directly. Aggregate as you go and write results incrementally.
A Celery task sometimes runs twice and sends duplicate emails. What do you do?
Why they ask
Distributed task queues usually deliver at least once.
How to answer
Make the task idempotent: record that the email was sent (with a unique key) in the database and check before sending. Review retry and acknowledgement settings, such as acks_late and visibility timeouts, which can cause re-delivery when tasks run longer than expected.
Remote work questions
How you'll work from Nigeria with a team elsewhere: hours, power, internet, communication.
How do you handle tasks when nobody on your team is online to answer questions?
Why they ask
Async work across time zones is normal.
How to answer
Write a clear question with context and options, make a reasonable assumption and note it in the pull request, and keep a second task ready.
Have you used AI coding assistants, and how do you check their output?
Why they ask
Teams want developers who use AI tools carefully, especially in Python, where wrong code often still runs.
How to answer
Say how you use them (boilerplate, tests, unfamiliar libraries) and how you verify: run tests, read every line, check library versions and never paste secrets or private code into tools the company has not approved.
Remote interview tips
Python interviews often include live coding in a shared editor such as CoderPad. Practise writing code without autocomplete, and say out loud what you are checking as you go.
Keep a project with tests ready to share on screen. Being able to run pytest live and show it pass is a strong moment in an interview.
If the call drops, rejoin from your hotspot and keep going. Have the interviewer's email to hand so you can message them straight away.
Questions people ask
What Python topics come up most in interviews?
Mutability and default arguments, generators, decorators, comprehensions, exceptions, the GIL and concurrency, plus framework questions on Django or FastAPI and SQL.
What is a typical Python take-home test?
A small API with tests, or a script that processes a data file and produces a report. Expect three to five hours. Reviewers look at structure, tests, type hints and the README.
Should I use type hints in a Python interview?
Yes, in take-homes at least. Most teams use them, and they make your code easier to review.
Updated October 2026 by the WorkRemote careers team
Interview questions for roles close to python developer
- Backend Developer
A backend developer builds the servers, APIs, databases and background jobs that apps run on, typically in Node.js, Python, Go, Java or C#. Nigerian backend developers are hired remotely by foreign companies, especially those with fintech or payments experience, though most remote roles want two or more years of production work.
- Data Engineer
A data engineer builds and runs the pipelines that move data from apps, payment systems and third-party tools into a warehouse where analysts and data scientists can use it. It is one of the stronger remote options for Nigerian engineers, because the work is cloud-based, skills are in short supply and most people move into it from backend development or analytics.
- Data Scientist
A data scientist uses statistics, machine learning and code (mostly Python and SQL) to predict outcomes and test what works, such as which loan applicants will default or whether a new feature lifts sales. You can do it remotely from Nigeria, but remote entry-level data science jobs are rare, so most people get in through a data analyst role, a strong portfolio or a master's degree.
- Machine Learning Engineer
A machine learning engineer takes models, including large language models, out of notebooks and into products: building the data pipelines, APIs, monitoring and infrastructure that let them run reliably for real users. It can be done fully remotely from Nigeria, but it is mostly a mid-level and senior job that people reach from software engineering or data science.