Advance Python Programming (CY-406) - Important Questions
-
Unit 514 Marks High Priority
Write a TCP server and client in Python demonstrating concurrent handling of multiple clients. Provide the server and client code, show how the server accepts and serves multiple simultaneous connections, and include sample output for at least three concurrent clients.
Core practical frequently asked: implement concurrent network programming with multiple clients.
-
Unit 510 Marks High Priority
Explain the Global Interpreter Lock (GIL) in CPython and its implications for multi-threaded programs. Discuss which kinds of workloads are affected by the GIL and present strategies to overcome GIL-related limitations.
Fundamental conceptual question about CPython concurrency and its exam significance.
-
Unit 514 Marks Medium Priority
Compare threading and multiprocessing in Python and implement a producer-consumer pattern using queues. Provide code for both a threading-based and a multiprocessing-based solution, explain the differences in behavior and performance, and state when to prefer each approach.
Comparison plus implementation pattern commonly examined in concurrency unit.
-
Unit 510 Marks Medium Priority
Explain and demonstrate the use of generators and coroutines for cooperative multitasking with an example. Show how a generator-based coroutine can yield control, coordinate tasks, and be used to build simple event loops.
Cooperative multitasking topic with practical demonstration; appears repeatedly in analytics.
-
Unit 514 Marks Medium Priority
Implement a concurrent TCP server using asyncio and compare its performance against a multi-threaded server for handling 100 simultaneous clients. Provide the code for both servers, describe the benchmarking method you used, report observed metrics (throughput, latency, resource usage), and analyze the results.
Asynchronous programming applied to network servers; synthesized from trends in past questions.
-
Unit 510 Marks Medium Priority
Describe synchronization primitives in Python (Lock, RLock, Semaphore, Event, Condition) with code examples showing how to use each. Explain common concurrency problems such as race conditions and deadlocks, and demonstrate code patterns to avoid them.
Core topic on synchronization primitives and safe concurrency practices.
-
Unit 510 Marks Medium Priority
Demonstrate use of concurrent.futures ThreadPoolExecutor and ProcessPoolExecutor to parallelize a CPU-bound and an I/O-bound task. Provide code examples, measure relative performance, and explain which executor is appropriate for each type of workload and why.
Practical use of high-level concurrent APIs and guidance on choosing executors.
Quick Add to Notes
Save questions, your own notes and screenshots into notes filed by unit. It takes a free account.
Create free accountHave an account? Log in
Notes Panel