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

15 to 30 random questions in 15 to 30 minutes, by 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 covers 12 topics across three levels. Each attempt picks 15 to 30 questions at random, by the level you choose, so every attempt is different.

  • Data Structures
  • Testing
  • Typing
  • Error Handling
  • Basics
  • Concurrency
  • Decorators
  • Functions
  • Generators
  • Internals
  • OOP
  • Performance

Sample Python mock test questions

One question from each level, the way they appear in the test. A new set comes on the 1st of every month. Try it, then open the answer.

  1. FresherConcurrency

    What does t.join() do for a thread t that has been started?

    • Blocks the caller until thread t has finished
    • Stops thread t immediately
    • Merges thread t into the main thread
    • Starts thread t if it has not started yet
    Show the answer

    Answer: Blocks the caller until thread t has finished. join() waits for the thread to complete, optionally with a timeout. Python has no safe way to kill a thread from outside, and threads already share memory, so nothing needs merging.

  2. Intermediate (1-5 years)Typing

    UserId = NewType("UserId", int). What is UserId(5) at runtime?

    • A string "UserId(5)"
    • The plain int 5
    • An instance of a new UserId class
    • A frozen wrapper object around 5
    Show the answer

    Answer: The plain int 5. NewType creates a distinct type for the checker, so passing a plain int where UserId is expected is flagged. At runtime UserId is a cheap callable that returns its argument unchanged.

  3. Experienced (5+ years)Generators

    What does this print?

    from contextlib import contextmanager
    log = []
    @contextmanager
    def span():
        log.append("start")
        yield
        log.append("end")
    try:
        with span(): raise ValueError
    except ValueError: pass
    print(log)
    • ['start', 'end']
    • []
    • ['start']
    • ['end']
    Show the answer

    Answer: ['start']. In a @contextmanager generator, an exception from the with block is raised at the yield. Without try/finally around the yield, the code after it never runs, so cleanup is skipped. Always wrap the yield in try/finally.

Take the full Python mock test: 15 to 30 questions and 15 to 30 minutes, by level.

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 test's questions you got right (15 to 30, by level). 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?

It depends on the level: Fresher has 15 questions in 15 minutes, Intermediate has 20 questions in 20 minutes, Experienced has 30 questions in 30 minutes. They are multiple-choice questions picked at random from a larger bank of Python questions at your level, 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