educative.io

Python Concurrency for Senior Engineering Interviews (C. H. Afzal)


Multiprocessing - Sharing State This lesson discusses the facilities available in the multiprocessing module to share state amongst processes. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/5668546535227392/6678093659897856). The Basics - Mutex vs Semaphore The concept of and the difference between a mutex and a semaphore will draw befuddled expressions on most developers' faces. In this lesson, we discuss the differences between the two most fundamental concurrency constructs offered by almost all language frameworks. Difference between a mutex and a semaphore makes a pet interview question for senior engineering positions! View the lesson [here](https://www.educative.io/collection/page/5307417243942912/5668546535227392/4810492780478464). Multiprocessing - Quiz 3 Test what you have learnt so far. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/5668546535227392/5629245453762560). Global Interpreter Lock - Asynchronous This lesson demonstrates how we can convert our threaded design to an asynchronous one. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/5668546535227392/5316955995111424). The End - Epilogue Acknowledgements and credits. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/5668546535227392/4706917944393728). The Basics - Moore's Law Discusses impact of Moore's law on concurrency. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/5668546535227392/5482932065009664). Async.io - Event Loop This lesson introduces the concept of the event loop and the central role it plays in asynchronous programming models. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/5668546535227392/5375369848815616). Interview Practise Problems - Uber Ride Problem This lesson solves the constraints of an imaginary Uber ride problem where Republicans and Democrats can't be seated as a minority in a four passenger car. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/5668546535227392/6500298174496768). Multiprocessing - Queues & Pipes This lesson discusses constructs that can be used for inter-process communication. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/5668546535227392/6700674718892032). The Basics - Global Interpreter Lock This lesson discusses the global interpreter lock also known as GIL and its effects. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/5668546535227392/5874741220999168). The Basics - Semaphore vs Monitor This lesson discusses the differences between a monitor and a semaphore. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/5668546535227392/4809594394116096). The Basics - Amdahl's Law Blindly adding threads to speed up program execution may not always be a good idea. Find out what Amdahl's Law says about parallelizing a program. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/5668546535227392/5918285105201152). Async.io - Iterables This lesson explains iterables in Python. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/5668546535227392/4566872588550144). Async.io - Yield This lesson discusses the yield keyword and its uses. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/5668546535227392/6198860672139264). Async.io - Chat Server Example This lesson walks the reader through the design and implementation of a toy chat-server. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/5668546535227392/4801549316390912). Interview Practise Problems - Barber Shop This lesson visits the synchronization issues when programmatically modeling a hypothetical barber shop and how they can be solved using Python's concurrency primitives. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/5668546535227392/5106598466813952). Threading Module - Creating Threads This lesson demonstrates how threads can be created in Python. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/5668546535227392/4916062241947648). Threading Module - Daemon Thread This lesson describes how daemon threads exit as soon as the main program thread exits. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/5668546535227392/6701669125455872). Concurrent Package - Futures This lesson gets into the details of working with threading.Future ( not to be confused with asycncio.Future). View the lesson [here](https://www.educative.io/collection/page/5307417243942912/5668546535227392/4692507327725568). Threading Module - Lock Python's Lock is the equivalent of a Mutex and this lesson looks at its various uses. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/5668546535227392/6315297457831936). Threading Module - RLock This lesson explains the reentrant lock in python's threading module. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/5668546535227392/5898672778772480). Threading Module - ... continued Continuation of discussion on condition variables. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/5668546535227392/6001124123344896). Threading Module - Semaphores This lesson introduces semaphores and their uses in Python. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/5668546535227392/5483568451026944). Threading Module - Events This lesson talks about Events, which is a lesser known utility class within the threading module. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/5668546535227392/5899744607993856). Threading Module - With This lesson introduces the use of with and context management with synchronization primitives. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/5668546535227392/6524373143912448). Threading Module - Quiz 1 Test what you have learnt so far. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/5668546535227392/5556622657060864). Multiprocessing - Spawn This lesson discusses the alternative to forking processes, which is spawning them. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/5668546535227392/5390381720010752). Multiprocessing - Locks & Reentrant Lock This lesson discusses the Lock and Reentrant Lock versions of the multiprocessing module. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/5668546535227392/5817213300768768). Multiprocessing - ... continued Continues the discussion on pools and describes the map API. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/5668546535227392/6392251775188992). Multiprocessing - Manager This lesson introduces the manager as an entity that enables seamless sharing of data and objects amongst processes. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/5668546535227392/4982938787643392). Multiprocessing - SyncManager This lesson discusses the SyncManager from the multiprocessing module which offers proxies for shared objects. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/5668546535227392/6191560288894976). Multiprocessing - Namespace This lesson discusses the Namespace which is conceptually similar to a notice board for all cooperating processes. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/5668546535227392/5104029820518400). Multiprocessing - Quiz 1 Test what you have learnt so far. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/5668546535227392/4657953497939968). Multiprocessing - Quiz 2 Test what you have learnt so far. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/5668546535227392/6032829773250560). Async.io - Send This lesson discusses sending values to a generator function. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/5668546535227392/5461572023484416). Interview Practise Problems - Non-Blocking Queue This lesson is a follow-up to the blocking queue question and explores the various ways in which we can make a blocking queue non-blocking. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/5668546535227392/5487447003627520). Async.io - Native Coroutines This lesson introduces the concept of native coroutines in Python. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/5668546535227392/6090220179030016). Global Interpreter Lock - Multiple Processors This lesson discusses the implementation of the web-service using multiple processors. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/5668546535227392/5353688770019328). Global Interpreter Lock - Multiple Threads This lesson discusses the implementation of the web-service using multiple threads. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/5668546535227392/4611046578847744). Global Interpreter Lock - Asynchronous with Executors In this lesson we introduce executors within an asynchronous program and examine how the right choice can significantly improve performance. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/5668546535227392/5303131468464128). Interview Practise Problems - Unisex Bathroom Problem A synchronization practice problem requiring us to synchronize the usage of a single bathroom by both the genders. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/5668546535227392/5353490903728128). Global Interpreter Lock - Introduction This lesson lays the context for a hands-on exercise we'll undertake to study the effects of GIL on a web-service when designed and implemented using different concurrency paradigms. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/5668546535227392/5950242883108864). Threading Module - Subclassing Thread This lesson demonstrates how we can subclass the Thread class to create threads. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/5668546535227392/5189199680503808). Threading Module - Timer This lesson discusses the Timer class with examples. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/5668546535227392/5108052783005696). Multiprocessing - Fork This lesson discusses the caveats to remember when forking processes. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/5668546535227392/5319268201660416). Multiprocessing - Pool This lesson discusses the various APIs and their working for both thread and process pools. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/5668546535227392/5484562568183808). Multiprocessing - Working with Managers This lesson describes how to implement basic security when working with managers, and caveats to be mindful of. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/5668546535227392/6020530140348416). Threading Module - Condition Variables This lesson explains the concept of condition variables in Python. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/5668546535227392/6233143021404160). Threading Module - Barrier This lesson discusses the all-important barrier synchronization construct. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/5668546535227392/6224824676384768). Threading Module - Quiz 2 Test what you have learnt so far. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/5668546535227392/5805404342714368). Async.io - Web Crawler Example This lesson discusses a text-book example of a concurrent program - the web crawler. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/5668546535227392/4774612271366144). Async.io - Future & Tasks This lesson discusses futures and tasks that can get scheduled on the event loop. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/5668546535227392/6399954228609024). Async.io - Sending and Receiving This lesson discusses combining, sending and receiving data in and out of a generator. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/5668546535227392/5490128153739264). Async.io - Generator This lesson discusses the concept of a generator in Python. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/5668546535227392/6719471039283200). Interview Practise Problems - Implementing a Barrier This lesson discusses how a barrier can be implemented in Python. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/5668546535227392/5989128883666944). Interview Practise Problems - Multithreaded Merge Sort Merge sort using multiple threads. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/5668546535227392/6348774177767424). Interview Practise Problems - Implementing Semaphore Learn how to design and implement a simple semaphore class in Python. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/5668546535227392/5280385460076544). Async.io - Mixing Native & Generator Based Coroutines This lesson demonstrates how generator-based coroutines and native coroutines can be interoperable. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/5668546535227392/5897811885293568). Interview Practise Problems - Read Write Lock We discuss a common interview question involving synchronization of multiple reader threads and a single writer thread. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/5668546535227392/6529682629459968). The Basics - Cooperative vs Preemptive Multitasking This lesson details the differences between the two common models of multitasking. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/5668546535227392/4791154908332032). The Basics - Mutex vs Monitor Learn what a monitor is and how it is different than a mutex. Monitors are advanced concurrency constructs and specific to languages frameworks. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/5668546535227392/4656073355034624). The Basics - Mesa vs Hoare Monitors This lesson looks at the different designs for implementing monitors. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/5668546535227392/5157059261628416). Multiprocessing - Process This lesson demonstrates how to create processes using the multiprocessing module. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/5668546535227392/6590870310617088). Async.io - Generator Based Coroutines This lesson goes into the details of generator-based coroutines in Python. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/5668546535227392/6658746107297792). The Basics - Introduction This lesson introduces concurrency and provides motivational examples to further our understanding of concurrent systems. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/5668546535227392/5962887875002368). The Basics - Concurrency vs Parallelism This lesson clarifies the common misunderstandings and confusions around concurrency and parallelism. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/5668546535227392/6314227553796096). Interview Practise Problems - Rate Limiting Using Token Bucket Filter Implementing rate limiting using a naive token bucket filter algorithm. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/5668546535227392/5861056146571264). The Basics - Thread Safety This lessons discusses the concept of thread safety. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/5668546535227392/5241883963949056). The Basics - Program vs Process vs Thread This lesson discusses the differences between a program, process, and a thread. Also included is an psuedocode-example of a thread-unsafe program. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/5668546535227392/6532373392916480). The Basics - Throughput vs Latency This lessons discusses throughput and latency in the context of concurrent systems. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/5668546535227392/5393056255705088). Interview Practise Problems - Thread Safe Deferred Callback Asynchronous programming involves being able to execute functions at a future occurrence of some event. Designing a thread-safe deferred callback class becomes a challenging interview question. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/5668546535227392/4725654497001472). The Basics - I/O Bound vs CPU Bound In this lesson, we delve into the characteristics of programs with different resource-use profiles and how that can affect program design choices. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/5668546535227392/6000996952047616). Interview Practise Problems - Asynchronous to Synchronous Problem A real-life interview question asking to convert asynchronous execution to synchronous execution. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/5668546535227392/6691741677649920). Concurrent Package - Pool Executors This lesson discusses the various APIs for thread and pool executors. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/5668546535227392/6667832567791616). Concurrent Package - Miscellaneous Functions This lesson demonstrates the use of various utility functions present in the concurrent module. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/5668546535227392/5343567797026816). Async.io - ... continued Continues the discussion on sending and receiving data from generators. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/5668546535227392/4509680166502400). Async.io - Coroutine This lesson discusses the general concept of a coroutine. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/5668546535227392/4805379873570816). Async.io - Yield From This lesson explains the yield from syntax. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/5668546535227392/6333442432172032). Async.io - Async Sleep Problem This lesson discusses how we can implement a method similar to asyncio.sleep API. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/5668546535227392/5233187959603200). The Basics - Deadlock, Liveness & Reentrant Locks We discuss important concurrency concepts such as deadlock, liveness, live-lock, starvation and reentrant locks in depth. Also included are executable code examples for illustrating these concepts. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/5668546535227392/5827809152860160). Async.io - Introduction This lesson introduces the concept of asynchronous programming. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/5668546535227392/6083059965231104). Async.io - Chaining Coroutines This lesson explains how to chain coroutines with an example. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/5668546535227392/6446734441971712). The Basics - ... continued Continuation of the discussion on GIL. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/5668546535227392/5720134477938688). The Basics - Synchronous vs Asynchronous This lesson discusses the differences between asynchronous and synchronous programming which are often talked about in the context of concurrency. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/5668546535227392/4917075531268096). The Basics - Critical Section & Race Conditions This lesson exhibits how incorrect synchronization in a critical section can lead to race conditions and buggy code. The concepts of critical section and race condition are explained in depth. Also included is an executable example of a race condition. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/5668546535227392/5165890653913088). Multiprocessing - Introduction This lesson lays the groundwork for discussing the various APIs and capabilities of the multiprocessing module. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/5668546535227392/6554242829516800). Global Interpreter Lock - Single Thread This lesson discusses the implementation of the web-service using a single thread. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/5668546535227392/6128598412951552). Multiprocessing - Forkserver This lesson discusses the less-used forkserver option to spin off new processes. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/5668546535227392/5749223217692672). Multiprocessing - Barrier, Semaphore, Condition Variable This lesson discusses the various synchronization constructs offered by the multiprocessing module which have counterparts in the threading module. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/5668546535227392/5873056989839360). Async.io - Quiz Test what you have learnt so far. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/5668546535227392/4952289431257088). Interview Practise Problems - Blocking Queue | Bounded Buffer | Consumer Producer Classical synchronization problem involving a limited size buffer which can have items added to it or removed from it by different producer and consumer threads. This problem is known by different names: consumer producer problem, bounded buffer problem or blocking queue problem. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/5668546535227392/5222874270924800). Interview Practise Problems - Dining Philosophers This chapter discusses the famous Dijkstra's Dining Philosopher's problem. Two different solutions are explained at length. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/5668546535227392/5143386774306816).
About the Python Concurrency for Senior Engineering Interviews (C. H. Afzal) category [Python Concurrency for Senior Engineering Interviews (C. H. Afzal)] (1)