Python interviews

Python mock interviews

Python is easy to write and easy to be vague about. A Python round checks whether you know what your one-liners actually do — what is copied and what is shared, what is lazy and what is not — because that is where real Python bugs come from.

Rounds with Sia from ₹99 · Live interviews with a working engineer from ₹299 · Pay per session

What a Python round covers

Built-in data structures

Lists, tuples, sets and dicts: what each costs, what can be a dictionary key and why, and which one you would reach for in a given problem.

Mutability and references

Why a default list argument remembers old calls, what a shallow copy shares, and the difference between is and ==. Most Python follow-ups come back to this.

Iteration and functions

Comprehensions, generators and yield, decorators and closures — asked as "what does this do and when would you use it", not as syntax.

Concurrency and performance

The GIL, threads against processes against asyncio, and how you would find out why a script is slow before rewriting it.

Python interview questions you might be asked

Not a list to memorise. Each is the kind of opening a real round uses, with what a strong answer covers — the follow-ups depend on what you say.

  1. This function remembers items from previous calls. Why?

    The default list is created once, when the function is defined, and shared by every call. The fix is a None default — and the strong answer explains why defaults behave this way.

  2. You copied a list of lists, changed the copy, and the original changed too. What happened?

    A shallow copy duplicates the outer list but shares the inner ones. copy.deepcopy, or building new inner lists, fixes it.

  3. Read a 10 GB log file and count the errors. How do you avoid running out of memory?

    Iterate the file lazily — line by line or with a generator — instead of reading it whole. Being able to say why a generator uses constant memory is the point.

  4. Your script uses threads but is no faster on a CPU-heavy task. Why?

    The GIL lets one thread run Python bytecode at a time, so CPU-bound work needs processes. Threads still help for waiting on I/O.

  5. Checking "if x in my_list" inside a loop is slow. What would you change?

    Membership in a list is O(n); in a set or dict it is O(1) on average. Converting once, outside the loop, is the fix.

Answer questions like these in a scored round and see exactly where your answer fell short.

What the interviewer is listening for

Interviewers listen for whether you can predict what Python will do before running it. Explaining why a result surprised you is worth more than having memorised it.

Where candidates lose marks

  • Writing clever one-liners you cannot explain line by line.
  • Not knowing which operations on a list are O(n).
  • Treating "Python is slow" as an answer rather than a question about where.

Two ways to interview

A round with Sia, on your own

One question at a time with real follow-ups on what you actually said. Choose three, five or eight questions. Scored the moment you finish, with a written breakdown across technical depth, problem solving and communication.

A live interview with an engineer

Forty minutes over Zoom with someone who runs Python interviews for a living. They score five criteria and write up what to fix, and you keep a numbered certificate for the session.

Choose Python as your stack in the backend, full-stack or DSA track.

Questions about Python interviews

Which track should I pick for a Python round?

Python can be chosen as your stack in the backend, full-stack and DSA tracks. DSA if your interview is mostly problem solving, backend for APIs and data work.

Is a Python round right for a fresher?

Yes. At Beginner difficulty the round stays on the language itself — data structures, functions and mutability — before frameworks.

Will I be asked about Django or Flask?

If a framework is on your resume, expect questions on it. Otherwise the round stays on core Python and how you would use it to solve a problem.

How is a Python round scored?

On the same five criteria as every round, with a written breakdown — so you can see whether you lost marks on depth or on explaining yourself.

Other technologies

Interviews by track

Not sure which to book? The FAQ covers how sessions are scored, and candidate stories show what people did with the feedback.