Edition 1 · PDF · 314 pages

Python Interview Pack

204 interview questions, 57 output drills, a 275-item cheatsheet and a 162-term glossary, for freshers and developers with up to three years of experience. Every snippet was run on Python 3.13.5. The output you see in the pack came from that run.

Launch price: ₹199 for the first 50 buyers

Regular price: ₹299

Apply coupon above, then buy — Razorpay opens after that

Pay, then download the PDF straight away. We also email you a copy. About 2.4 MB.

See a sample question ↓

For your own study only. Please don't share the file. Refund policy

Cover of the Schoolabe Python Interview Pack, Edition 1. The cover lists 204 interview questions, 57 output drills, 275 cheatsheet items and 162 glossary terms, and says all code was run on Python 3.13.5.
  • 314 pages
  • 204 questions
  • 23 topics
  • 38 DSA coding questions
  • 57 output drills
  • 275 cheatsheet items
  • 162 glossary terms
  • Run on Python 3.13.5

What's inside the Python pack

The questions are grouped by topic, from data types to async code, testing, and coding problems. After the questions come the drills, a cheatsheet and a glossary. You do not need to read it in one go. Treat it like a revision notebook.

TopicQuestionsCount
Basics and data typesQ1–Q1212
StringsQ13–Q219
String formattingQ22–Q254
ListsQ26–Q3611
Dicts and setsQ37–Q459
Functions and scopeQ46–Q538
Lambda and sorting keysQ54–Q585
args and *kwargsQ59–Q635
Closures and decoratorsQ64–Q729
Generators and iteratorsQ73–Q819
RecursionQ82–Q865
OOP and dunder methodsQ87–Q10317
ExceptionsQ104–Q1118
Mutability and copyQ112–Q1165
Memory and GIL basicsQ117–Q1226
Modules, packages and importsQ123–Q1286
Type hints basicsQ129–Q1335
Async basics (asyncio)Q134–Q1396
Testing basicsQ140–Q1445
Useful standard library modulesQ145–Q15410
Python gotchas explainedQ155–Q1584
Files and context managersQ159–Q1668
Coding questions (DSA style)Q167–Q20438
  • How to use this pack and a 7-day revision plan, at the front.
  • Output prediction drills (P1–P57). Short snippets, a box for your guess, and "Answer on page N" under each one. All answers, with the "why", are together at the end of that section.
  • Cheatsheet: everyday Python reference — 275 items in 14 groups, from built-in functions and string methods to json, re, pathlib and file I/O. Each row has a one-line description, a tiny example, and its real output.
  • Glossary — 162 terms, in alphabetical order, each explained in a sentence or two.

Sample pages

These are real pages from the Edition 1 PDF, shown so you can judge the layout and the writing. They are not a free chapter.

One question, as it appears in the pack

This is Q2 from Basics and data types, copied from the PDF. The rest of the pack follows the same shape: a short answer, an "In simple words" line, why it works, the real output, common mistakes, and follow-ups.

Q2 · Basics and data types

What is the difference between `is` and `==`?

== checks whether two objects have equal values. is checks whether two names point to the very same object in memory. Use == for comparing data and is only for singletons like None, True and False.

In simple words: == asks "do they look the same?"; is asks "are they the very same thing?".

Why it works

a == b calls the method a.__eq__(b). Methods with two underscores on each side, like __eq__, are called dunder methods (short for "double underscore"); Python calls them for you when you use operators. Each type decides what "equal" means. For lists, it compares items one by one. a is b does not call any method. It simply checks whether both names hold the same object identity. In CPython (the standard Python interpreter you download from python.org), identity is the memory address, and id(x) shows it as a number. That number changes every run, so this pack never prints it; we print the result of is instead.

Two lists with the same items are equal but are separate objects. Change one and the other does not change. That is why == is True and is is False below.

a = [1, 2, 3]
b = [1, 2, 3]
c = a
print(a == b, a is b)      # equal values, different objects
print(a == c, a is c)      # c is just another name for a

result = None
print(result is None)      # the right way to check for None

Output, real run on Python 3.13.5:

True False
True True
True

Now the famous trap. Sometimes is seems to work for numbers and strings. That is because of caching, which is a CPython implementation detail, not a language rule. CPython keeps one shared object for each small integer from -5 to 256, so any code that produces 100 gets the same object. Larger numbers made at runtime are usually separate objects. Short strings that look like identifiers (letters, digits, underscore) are often interned, which means the interpreter keeps a single copy and reuses it. You can ask for interning yourself with sys.intern().

import sys

x = int("100")             # built at runtime from text
y = int("100")
print("100 is 100:", x is y)        # small-int cache (CPython)

big1 = int("1000")
big2 = int("1000")
print("1000 is 1000:", big1 is big2, "| equal:", big1 == big2)

s1 = "".join(["py", "thon"])        # built at runtime
s2 = "python"
print("str is:", s1 is s2, "| equal:", s1 == s2)
print("after intern:", sys.intern(s1) is s2)

Output, real run on Python 3.13.5:

100 is 100: True
1000 is 1000: False | equal: True
str is: False | equal: True
after intern: True

We used int("1000") on purpose. If you write a = 1000; b = 1000 in one file, the compiler may store one constant and both names point to it, so is can print True. That is exactly why you must never depend on is for numbers or strings: the answer depends on how the code was compiled and run, not on the values.

Common mistakes

  • Writing if name is "admin":. Python 3.8 and later even warn about this with SyntaxWarning: "is" with a literal. Use ==.
  • Saying "is compares memory and == compares values" and stopping there. Add that == can be customised with __eq__, while is cannot be changed.
  • Presenting the -5 to 256 range as a Python rule. Always call it a CPython implementation detail.

Follow-ups

  • Why is x is None preferred over x == None? There is only one None object, so is is exact and fast. A class could define __eq__ to return True when compared with None, which would fool ==.
  • Can two objects have the same id()? Yes, if their lifetimes do not overlap. After one object is freed, its address can be reused by a new object.
  • Can a == a ever be False? Yes, for float('nan'). NaN is not equal to anything, including itself.

Who this pack is for

This pack is for freshers and developers with up to three years of experience who already write some Python and want to revise for interviews.

It will help if you are preparing for a first job, an internship, or a switch where the interviewer will ask about lists and dicts, functions, OOP, and a few coding problems.

It is not a first Python tutorial. If you are still learning the language, start with the free Python course on Schoolabe, then come back to this pack when you are practising interview answers.

How to use the pack

  • You do not need to read 314 pages in one sitting. A useful session is a handful of questions, said out loud, not an afternoon of scrolling.
  • Read the question and cover the rest of the page with your hand.
  • Say your answer out loud, as if someone is sitting in front of you. Speaking is a different skill from knowing.
  • Before you look at the output of a code block, write down what you think it will print. Then check. The gap between your guess and the real output is what you need to revise.
  • Type the code into your own editor and change one thing. Five minutes of this beats an hour of reading.
  • Mark the questions you got wrong in the contents. On Day 7 of the plan, come back to every marked question.
  • In the real interview, start with the short answer. Stop. Let the interviewer decide whether to go deeper. A good answer has three parts: what it is, why it behaves that way, and when you would use it in real code. For coding questions, say the simple idea first, then improve it, and state the time and space cost.

A 7-day revision plan

The pack assumes about three hours a day: two for the topic questions, one for coding and output drills. If you have less time, do the must-know questions first. Every day ends with a few coding questions, so you practise problem solving all week instead of cramming it on the last day.

DayTopicsCodingDrillsMust-know first
1Basics and data types (Q1–Q12), Strings (Q13–Q21), String formatting (Q22–Q25)Q167–Q171P1–P8Q1, Q2, Q3, Q13, Q22
2Lists (Q26–Q36), Dicts and sets (Q37–Q45), Mutability and copy (Q112–Q116)Q172–Q176P9–P16Q26, Q28, Q37, Q30, Q112
3Functions and scope (Q46–Q53), Lambda and sorting keys (Q54–Q58), args and *kwargs (Q59–Q63), Closures and decorators (Q64–Q72)Q177–Q181P17–P24Q46, Q47, Q59, Q55, Q66
4Generators and iterators (Q73–Q81), Recursion (Q82–Q86), Exceptions (Q104–Q111)Q182–Q186P25–P32Q74, Q75, Q82, Q104, Q107
5OOP and dunder methods (Q87–Q103), Memory and GIL (Q117–Q122), Modules and imports (Q123–Q128)Q187–Q193P33–P40Q88, Q90, Q97, Q118, Q125
6Type hints (Q129–Q133), Async basics (Q134–Q139), Testing (Q140–Q144), Standard library (Q145–Q154)Q194–Q197P41–P48Q129, Q134, Q140, Q143, Q153
7Python gotchas (Q155–Q158), Files and context managers (Q159–Q166), then every question you markedQ198–Q204P49–P57, then the drills you got wrongQ159, Q162, Q202, Q203

On Day 7, the pack suggests finishing with a 30-minute mock interview with a friend: they pick random question numbers, you answer out loud, then you solve one coding question while explaining your thinking.

Each day also has cheatsheet groups to skim: read the example, guess the output, then check the output column. Day 7 is a slow pass over every group, the evening before your interview.

Licence and refunds

The PDF is licensed to you, the person who bought it, for your own personal study only. You may read it on your own devices, print one copy for yourself, and copy the code examples into your own practice files and projects.

You may not share the file, or any part of it, with other people, for free or for money; resell it or include it in another product; upload it to a website, drive, group, channel or file-sharing service; or remove the Schoolabe name and copyright lines.

If a friend would find this pack useful, please send them to schoolabe.com instead of sending them the file.

Refunds follow Schoolabe's refund policy. That page says digital products that have been fully accessed or downloaded are generally non-refundable. Please read the policy before you buy.

Python is a trademark of the Python Software Foundation. This pack is not made or endorsed by the Python Software Foundation.

Questions about the Python pack

How many questions are in the Python Interview Pack?

204 interview questions across 23 topics, including 38 DSA-style coding questions. There are also 57 output-prediction drills, a 275-item cheatsheet and a 162-term glossary. The PDF is 314 pages.

Was the code in the pack actually run?

Yes. Every snippet was run on Python 3.13.5, and the output in the pack was copied from that run by a script, not typed by hand. A few behaviours are CPython implementation details, such as the small-integer cache. The pack labels those clearly.

Does this replace the free Python interview questions on Schoolabe?

No. The free questions at /python-interview-questions and /interview-prep stay free. This pack is a paid PDF for deeper revision, with run output, drills, a cheatsheet and a glossary.

I am new to Python. Should I buy this?

Only if you already write some Python and are preparing for interviews. If you are starting from scratch, use the free Python course first.

What Python version should I practise on?

The pack was run on Python 3.13.5. The text names the version when a feature is recent (3.11 to 3.13). You can revise on 3.11 or later for almost all of it; where a newer feature matters, the pack says so.

How do I get the file, and can I print it?

After you pay, you download the PDF straight away, and we email you a copy. The licence allows one printed copy for your own use.

Can I share it with my classmates?

No. The licence is for the person who bought it. Please point classmates to schoolabe.com.

What is the refund policy?

See Schoolabe's refund policy. Digital products that have been fully accessed or downloaded are generally non-refundable under that policy.

Free practice stays at /interview-prep and /python-interview-questions.