CoreHRx Jobs

Apply in one click, save jobs and take free mock tests.

Register free Log in
Hiring? Post jobs with CoreHRx
My account
user

View & update profile

Python mock test: free online practice

30 random questions, 30 minutes, at the level you choose: data structures, oop, generators, typing and concurrency. After you submit you get your score, your strong and weak topics, and the right answer with an explanation for every question.

Want to revise first? Read the Python interview questions and answers.

Choose your experience

Free with a CoreHRx Jobs account: you will be asked to sign in or create one first.

What does the Python mock test cover?

The test draws on 300 Python questions in 12 topics, across three levels. Each attempt picks 30 of them at random for the level you choose.

  • Data Structures27 Qs
  • Testing27 Qs
  • Typing27 Qs
  • Error Handling26 Qs
  • Basics25 Qs
  • Concurrency24 Qs
  • Decorators24 Qs
  • Functions24 Qs
  • Generators24 Qs
  • Internals24 Qs
  • OOP24 Qs
  • Performance24 Qs

Sample Python mock test questions

One question from each level, the way they appear in the test. Try it, then open the answer.

  1. FresherBasics

    What does this print?

    print(7 // 2, -7 // 2)
    • 3.5 -3.5
    • 3 -3
    • 4 -4
    • 3 -4
    Show the answer

    Answer: 3 -4. Floor division rounds towards negative infinity, not towards zero. 7 // 2 is 3, but -7 // 2 is -4 because -3.5 floors to -4. Candidates coming from C or Java often expect -3.

  2. Intermediate (1-5 years)Data Structures

    What does this print?

    from collections import deque
    
    d = deque(maxlen=3)
    for i in range(5):
        d.append(i)
    print(list(d))
    • [0, 1, 2, 3, 4]
    • [0, 1, 2]
    • IndexError
    • [2, 3, 4]
    Show the answer

    Answer: [2, 3, 4]. A deque created with maxlen keeps only that many items. Appending to a full deque silently drops an item from the opposite end, which makes it a handy fixed-size buffer for the last N events.

  3. Experienced (5+ years)Functions

    fetch(timeout=None) must treat None as "no timeout", yet still detect when the caller did not pass timeout at all. What is the usual solution?

    • A private sentinel: _MISSING = object(), used as the default
    • Use timeout=0 as the default and treat 0 as missing
    • Check len(locals()) at the start of the function
    • Use timeout=False and compare it with == None
    Show the answer

    Answer: A private sentinel: _MISSING = object(), used as the default. A unique object() cannot be passed by accident, so `timeout is _MISSING` reliably means the argument was omitted, while None stays a valid value. Using 0 or False as a marker clashes with legitimate values.

Take the full Python mock test: 30 questions, 30 minutes.

How is the Python mock test scored?

A question counts as right only when you pick exactly the right option, or all the right options where it says so; a question left blank counts as wrong. Your score is the share of the 30 questions you got right. The result also scores every topic, so you know what to revise before the interview.

  • 75% or more in a topica strength
  • 50% to 74%worth a revision
  • Under 50%a topic to work on

Python mock test: questions people ask

Is the Python mock test free?

Yes. The Python mock test is free. You need a free CoreHRx Jobs account to start it, so your score and the topics to work on are saved.

How many questions are in the Python mock test?

Each test has 30 multiple-choice questions to answer in 30 minutes, picked at random from 300 Python questions across three levels, so every attempt is different.

Which Python topics does the test cover?

The questions cover Data Structures, Testing, Typing, Error Handling, Basics, Concurrency, Decorators, Functions, Generators, Internals, OOP, Performance. Your result shows how you did in each topic.

Which level should I choose?

Fresher if you are a student or have less than a year of experience, Intermediate for 1 to 5 years at work, and Experienced for 5 years or more.

Can employers see my Python score?

Only your best Python score, and only when it is 60% or more. It shows on the job applications you send on CoreHRx. Lower scores stay private.

Can I take the Python mock test again?

Yes, up to 10 tests a day. Each attempt picks questions you have not seen recently first.

All mock tests