Python Programming Mastery (Expert Level)

  • 31m
  • 31 questions
The Python Programming Mastery (Expert Level) benchmark evaluates your ability to recognize how code can be made more robust and maintainable by applying various design patterns. You will be evaluated on your skills in recognizing concurrency, creating and managing threads, using the asyncio library for asynchronous task executions, and using thread pools, process pools, and futures instances. A learner who scores high on this benchmark demonstrates that they have the skills to implement design patterns and concurrency in Python.

Topics covered

  • compare the performance of process pools and thread pools for tasks that are network-bound
  • create a condition instance that will have multiple threads waiting for data to be generated
  • create semaphores in Python and recognize the effect of calling their acquire and release methods
  • define tasks in such a manner that deadlocks will not occur
  • describe the Liskov's Substitution, Interface Segregation, and Dependency Inversion principles of good design
  • describe the three types of design patterns and when to use each
  • design and implement the Flyweight pattern to efficiently use lightweight resources
  • design and implement the Liskov's Substitution principle
  • design and implement the Proxy pattern to control access to an object
  • design and implement the Strategy pattern and recognize how it is used in Python built-in functions
  • design an Iterator using special methods in Python
  • distinguish between multiprocessing and multithreading in the context of sharing data in memory
  • enumerate the built-in data structures available in Python for concurrent programming
  • execute two threads concurrently to save time relative to a sequential execution
  • identify the specific use cases for multithreading
  • identify what a race condition is and when this may occur with multithreading
  • implement a simple design for the Builder pattern
  • implement the Observer pattern for a more complex use case
  • implement the Singleton pattern using a more Pythonic style
  • iteratively improve the design of code using refactoring
  • recall how the Factory and Abstract Factory patterns work and when they can be used
  • recall the basic principles of good design in code
  • recognize the importance of the Decorator pattern for adding responsibilities dynamically
  • recognize what a race condition is and when it can occur with concurrent programming
  • share complex Python data between processes using the Manager class
  • summarize how semaphores can restrict the number of concurrent tasks accessing a shared resource
  • use queues and pipes to enable communication between concurrent processes
  • use the map function of a multithreading.Pool instance to submit multiple tasks to a process pool
  • use the run, create_task, and gather functions in the asyncio modules to execute tasks
  • write code for the Adapter pattern to offer a consistent interface to clients
  • write code to implement the Chain of Responsibility pattern