Python developer interview questions

A Python developer interview usually checks core language knowledge (data structures, generators), performance and profiling, SQL, API design and testing. Interviewers value clear, readable code and a method for finding slow parts before optimising. Be ready to explain a real script or service you wrote, what made it slow and how you measured the improvement.

· 11 questions · Questions from the MiraiHire question bank; tips written by the MiraiHire team.

Technical questions

  1. What is the difference between a list and a tuple in Python?

    Foundational

    What the interviewer is looking for: Lists are mutable and tuples are immutable; mention when a tuple is the better choice, such as fixed records or dictionary keys.

  2. How do Python generators work, and when would you use one?

    Applied

    What the interviewer is looking for: Explain yield and lazy evaluation, then give a use case such as reading a large file line by line without loading it all.

  3. How would you profile and speed up a slow Python data-processing job?

    Advanced

    What the interviewer is looking for: Measure first (cProfile or a line profiler), find the hot spot, then vectorise, batch I/O, cache, or parallelise, and measure again.

  4. What is the difference between INNER JOIN and LEFT JOIN?

    Foundational

    What the interviewer is looking for: INNER JOIN keeps only matching rows; LEFT JOIN keeps every row from the left table. A two-table example makes it clear.

  5. How do indexes speed up queries, and when can they slow things down?

    Applied

    What the interviewer is looking for: Explain lookups without a full scan, then the trade-offs: slower writes, extra storage and indexes the planner never uses.

  6. How do you design an API so that a retried request does not create duplicates?

    Advanced

    What the interviewer is looking for: Explain idempotency keys stored with the result, safe HTTP methods, and database unique constraints as a last line of defence.

  7. What makes a good unit test?

    Foundational

    What the interviewer is looking for: Fast, independent, one clear behaviour per test, readable names, and it fails for the right reason.

  8. How do you decide what to cover with unit, integration and end-to-end tests?

    Applied

    What the interviewer is looking for: Explain the test pyramid: many fast unit tests, fewer integration tests at boundaries, and a few end-to-end tests for key user journeys.

Behavioural questions

  1. Tell me about a time you had to make a decision with incomplete information.

    Advanced

    What the interviewer is looking for: Explain how you judged the risk, what you checked quickly, how you kept the decision reversible, and what happened.

  2. Tell me about a time you improved a process or saved your team time.

    Applied

    What the interviewer is looking for: Quantify the before and after (hours saved, errors reduced) and explain how you got others to adopt the change.

  3. Tell me about the most complex problem you have solved. How did you break it down?

    Advanced

    What the interviewer is looking for: Show structured thinking: how you split the problem, tested ideas, used data, and the measurable result.

Answering behavioural questions

Use STAR: the Situation, your Task, the Actions you took and the Result, ideally with a number. Paste your answer into the free STAR checker to see which part is missing.

Check my answer with STAR →

Practise these questions

MiraiHire gives you interview practice sets from this question bank, by text or voice, with feedback. Free to start.

Start practising free