Skip to main content
PBCP • MODULE 6 OF 24 33 Timed Sets • 165 Verified MCQs

Module 6: Python Memory Management, Concurrency and Asynchronous Programming — Python Mock Tests

Understand CPython under the hood and choose the right concurrency model every time: interpreter execution, CPython internals, bytecode, memory allocation, reference counting, cyclic GC, mutable references, copying, the Global Interpreter Lock (GIL), threading, Lock/RLock, race conditions, deadlocks, ThreadPoolExecutor, multiprocessing, ProcessPoolExecutor, IPC Queue/Pipe, async/await, event loop, asyncio, create_task, gather, async with, async iterators/generators, httpx, and concurrency model selection.

⚡ START MODULE 6 PRACTICE

Python Execution Model

Start your baseline timed assessment for this module

Module 6 Assessment Rules & Format Every Attempt Helps You Improve • Track Your Progress, One Topic at a Time.
Question Bank 165 MCQs
Timed Sets 33 (33 Topics)
Duration 20 min / set
Pass Benchmark 70%
Negative Marking Up to -0.25 / wrong
Daily Access ∞ Unlimited Free

Integrity & Navigation: Questions can be revisited, changed, or flagged for review before final submission; answers auto-save across browser refreshes, and answer keys stay locked server-side until submitted.

Your Module 6 Progress

Completion Status & Revision Focus

Practice Today. Perform Better Tomorrow. No completed attempts recorded in Module 6 yet — start any topic below to generate your topic scorecard and unlock personalized revision suggestions.

Python Backend Development • Module 6

Topic-Wise Timed Mock Tests (33 Topics)

Instant scorecard + detailed explanations
Topic 6.1 1 Set

Python Execution Model

5 Qs • 20 min • Pass 70%

Topic 6.2 1 Set

CPython Runtime Architecture

5 Qs • 20 min • Pass 70%

Topic 6.3 1 Set

Python Bytecode Compilation (dis)

5 Qs • 20 min • Pass 70%

Topic 6.4 1 Set

Memory Allocation in Python

5 Qs • 20 min • Pass 70%

Topic 6.5 1 Set

Reference Counting

5 Qs • 20 min • Pass 70%

Topic 6.6 1 Set

Cyclic Garbage Collection (gc)

5 Qs • 20 min • Pass 70%

Topic 6.7 1 Set

Mutable Object References in Memory

5 Qs • 20 min • Pass 70%

Topic 6.8 1 Set

Shallow vs Deep Copying in Memory

5 Qs • 20 min • Pass 70%

Topic 6.9 1 Set

Global Interpreter Lock (GIL)

5 Qs • 20 min • Pass 70%

Topic 6.10 1 Set

Threading Fundamentals

5 Qs • 20 min • Pass 70%

Topic 6.11 1 Set

Creating and Managing Threads

5 Qs • 20 min • Pass 70%

Topic 6.12 1 Set

Thread Synchronization (Lock and RLock)

5 Qs • 20 min • Pass 70%

Topic 6.13 1 Set

Race Conditions

5 Qs • 20 min • Pass 70%

Topic 6.14 1 Set

Deadlocks and Prevention

5 Qs • 20 min • Pass 70%

Topic 6.15 1 Set

Thread Pools (ThreadPoolExecutor)

5 Qs • 20 min • Pass 70%

Topic 6.16 1 Set

Multiprocessing (Process-Based Parallelism)

5 Qs • 20 min • Pass 70%

Topic 6.17 1 Set

Process Pools (ProcessPoolExecutor)

5 Qs • 20 min • Pass 70%

Topic 6.18 1 Set

Inter-Process Communication (Queue and Pipe)

5 Qs • 20 min • Pass 70%

Topic 6.19 1 Set

Threading vs Multiprocessing Comparison

5 Qs • 20 min • Pass 70%

Topic 6.20 1 Set

Asynchronous Programming Model

5 Qs • 20 min • Pass 70%

Topic 6.21 1 Set

Coroutines with async and await

5 Qs • 20 min • Pass 70%

Topic 6.22 1 Set

Asyncio Event Loop

5 Qs • 20 min • Pass 70%

Topic 6.23 1 Set

asyncio Core Module

5 Qs • 20 min • Pass 70%

Topic 6.24 1 Set

Concurrent Tasks (asyncio.create_task)

5 Qs • 20 min • Pass 70%

Topic 6.25 1 Set

Parallel Awaitables (asyncio.gather)

5 Qs • 20 min • Pass 70%

Topic 6.26 1 Set

Async Context Managers (async with)

5 Qs • 20 min • Pass 70%

Topic 6.27 1 Set

Async Iterators (__aiter__ and async for)

5 Qs • 20 min • Pass 70%

Topic 6.28 1 Set

Async Generators

5 Qs • 20 min • Pass 70%

Topic 6.29 1 Set

Async HTTP Requests (httpx)

5 Qs • 20 min • Pass 70%

Topic 6.30 1 Set

Choosing the Right Concurrency Model

5 Qs • 20 min • Pass 70%

Topic 6.31 1 Set

CPython Performance Profiling & Memory Leak Forensics (cProfile, py-spy Flamegraphs, tracemalloc & weakref)

5 Qs • 20 min • Pass 70%

Topic 6.32 1 Set

Structured Concurrency with asyncio.TaskGroup, Semaphores, Backpressure & Event-Loop Blocking Detection

5 Qs • 20 min • Pass 70%

Topic 6.33 1 Set

Python 3.12+ Free-Threaded Mode (PEP 703 No-GIL), Subinterpreters & C-Extension / multiprocessing Trade-offs

5 Qs • 20 min • Pass 70%

Sample Module 6 Practice Preview

Sample Python Memory Management, Concurrency and Asynchronous Programming MCQ Questions & Answers

Click “Reveal Answer & Explanation” to check yourself
Q1 • Python Execution Model Module 6 Sample

In Python Internals & Async, what is the primary production engineering use case of 'Python Execution Model'?

  • A. Understanding import-time execution vs call-time execution in Django models and FastAPI route registration.
  • B. Disabling runtime exception handling and bypassing input validation.
  • C. Hardcoding database credentials directly inside Python source constants.
  • D. Concatenating raw untrusted strings directly into SQL statements.
✓ Reveal Answer & Explanation

Correct Answer: Option A

'Python Execution Model' is used in production Python Internals & Async specifically for: Understanding import-time execution vs call-time execution in Django models and FastAPI route registration.

Q2 • Python Execution Model Module 6 Sample

Which critical pitfall MUST a Python backend developer avoid when working with 'Python Execution Model'?

  • A. Writing focused pytest unit and integration tests covering boundary inputs.
  • B. Executing slow network/DB queries at module import time, slowing worker boot and breaking unit tests.
  • C. Following PEP 8 naming, Python 3.12 type hints, and structured logging.
  • D. Validating external payloads via Pydantic/DRF serializers at API boundaries.
✓ Reveal Answer & Explanation

Correct Answer: Option B

A frequent real-world bug with 'Python Execution Model' is: Executing slow network/DB queries at module import time, slowing worker boot and breaking unit tests.

Q3 • Python Execution Model Module 6 Sample

Which technical scope accurately describes the core mechanics of 'Python Execution Model'?

  • A. Browser-only CSS stylesheet animation keyframes.
  • B. Disabling Python reference counting and PostgreSQL WAL durability.
  • C. Source parsing -> AST -> code objects -> bytecode evaluation loop on the Python Virtual Machine stack frame
  • D. Storing plain-text user passwords in committed repository files.
✓ Reveal Answer & Explanation

Correct Answer: Option C

Core technical coverage of 'Python Execution Model' comprises: Source parsing -> AST -> code objects -> bytecode evaluation loop on the Python Virtual Machine stack frame.

Q4 • Python Execution Model Module 6 Sample

When completing the hands-on verification lab for 'Python Execution Model', what is the expected engineering deliverable?

  • A. Skipping edge-case checks and pushing untested files directly to main.
  • B. Swallowing runtime exceptions with bare except: pass blocks.
  • C. Hardcoding Windows-only paths and committing .venv to Git.
  • D. Inspect AST nodes with ast.dump() and code object constants (fn.__code__.co_consts).
✓ Reveal Answer & Explanation

Correct Answer: Option D

Practical mastery of 'Python Execution Model' is verified through: Inspect AST nodes with ast.dump() and code object constants (fn.__code__.co_consts).

Q5 • Python Execution Model Module 6 Sample

During a Python Backend technical interview on 'Python Execution Model', what demonstrates job-ready production competency?

  • A. Explaining how 'Source parsing -> AST -> code objects -> bytecode evaluation loop on the Python Virtual Machine stack frame' works internally, guarding against 'Executing slow network/DB queries at module import time, slowing worker boot an...
  • B. Reciting only a one-line definition without knowing failure modes or complexity trade-offs.
  • C. Using untyped globals and ignoring GIL/async behavior, N+1 queries, or SQL execution plans.
  • D. Skipping validation, structured logging, and pytest tests in production code.
✓ Reveal Answer & Explanation

Correct Answer: Option A

Interviewers evaluate internal understanding (Source parsing -> AST -> code objects -> bytecode evaluation loop on the Python Virtual Machine stack frame), pitfall awareness, and clean Python implementation.

Need structured guidance on Python Memory Management, Concurrency and Asynchronous Programming? Review the full PBCP syllabus or practise speaking through Python concepts in an AI technical interview.

Backend Development & Distributed Systems

Continue Learning & Explore Related Resources

FAQs — Module 6: Python Memory Management, Concurrency and Asynchronous Programming (Python) Mock Tests

1. How many MCQ Mock Tests are included in Module 6: Python Memory Management, Concurrency and Asynchronous Programming (Python)?

Module 6 of Python Backend Development Training Course includes 33 active timed MCQ mock test sets (165 verified questions across 33 topics), with server-side scoring, instant scorecards, and detailed explanations after submission.

2. What are the attempt rules and answer-key policies for Python Memory Management, Concurrency and Asynchronous Programming mock tests?

You can preview sample questions on this page and launch up to 2 free timed attempts per topic per day without signup (enrolled cohort learners receive unlimited attempts). During a live test, answers auto-save across refreshes and answer keys remain protected on the server until submission.

3. Does scoring high on this Python module test guarantee interview selection?

No — module mock scores measure topic-level conceptual accuracy and highlight specific concepts to revise. Pair topic mocks with PBCP Spoken AI Interviews and hands-on coding practice to build well-rounded interview readiness; hiring decisions rest independently with employers.

Learn. Practise. Prove. Get Career-Ready.

Ready to Build Your IT Career?

Explore industry-led programmes and develop practical skills through training, assessments and interview preparation.