educative.io

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


The Basics - Moore’s Law Discusses impact of Moore's law on concurrency. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/6328791100030976/5666421238398976). API Overview - 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/6328791100030976/5664397533904896). API Overview - Quiz 2 Questions relating to the Threading API are covered in this lesson. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/6328791100030976/5534787198517248). API Overview - Quiz 4 Questions relating to the Threading API covered in this chapter. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/6328791100030976/5833332791181312). Interview Practice Problems - ... continued This lesson demonstrates how to implement consumer-producer problem using mutexes. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/6328791100030976/5429814808805376). The Basics - Throughput vs Latency This lesson discusses throughput and latency in the context of concurrent systems. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/6328791100030976/6368579173744640). The Basics - Mutex vs Semaphore The concept of and the differences between a mutex and a semaphore will befuddle most developers. 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/6328791100030976/5869081221660672). The Basics - Mutex vs Monitor In this lesson, let's learn what a monitor is and how it is different than a mutex. Monitors are advanced concurrency constructs and specific to language frameworks. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/6328791100030976/5011290990837760). 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/6328791100030976/4929801536143360). 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/6328791100030976/6180016536682496). 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/6328791100030976/5723669550596096). The Basics - Critical Sections & Race Conditions This lesson exhibits how incorrect synchronization in a critical section can lead to race conditions and buggy code. The concepts of the 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/6328791100030976/4550796106530816). The Basics - Deadlocks, 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/6328791100030976/6646145193345024). The Basics - Amdahl's Law Blindly adding threads to speed up program execution may not always be a good idea. In this lesson, let’s find out what Amdahl's Law says about parallelizing a program. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/6328791100030976/4961204290191360). 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/6328791100030976/5962640658530304). API Overview - Creating Threads This lesson discusses the various ways in which we can create, run, prioritise and check the status of threads. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/6328791100030976/4908546313420800). The Basics - Cooperative Multitasking vs Preemptive Multitasking This lesson details the differences between the two prevailing models of multitasking. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/6328791100030976/5610435069870080). The Basics - Program vs Process vs Thread This lesson discusses the differences between a program, a process, and a thread. Also included is a pseudocode-example of a thread-unsafe program. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/6328791100030976/4875587992682496). The Basics - Hoare vs Mesa Monitors This lesson looks at the different designs for implementing monitors. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/6328791100030976/6084531947831296). 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/6328791100030976/5236257519042560). API Overview - Thread Variables This lesson discusses thread-local variables. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/6328791100030976/5201735167508480). Brief Intro to Asynchronous Programming - ... continued This lesson continues the discussion on asynchronous programming. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/6328791100030976/6526627720724480). API Overview - Condition Variables This lesson explores the use of condition variables in Ruby. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/6328791100030976/6720439562797056). API Overview - ... continued This lesson continues the discussion on instantiating threads. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/6328791100030976/6225364588167168). API Overview - ...continued This lesson continues the discussion of Mutex in Ruby. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/6328791100030976/5454979433234432). API Overview - Exception Handling in Threads This lesson discusses exception handling in threads. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/6328791100030976/4683540627193856). Interview Practice Problems - Multithreaded Merge Sort ​In this lesson, we will implement merge sort using multiple threads. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/6328791100030976/5836285237264384). Interview Practice Problems - Implementing a Barrier This lesson discusses how a barrier is implemented in Ruby. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/6328791100030976/6214563575889920). Interview Practice Problems - Thread-safe Singleton This lesson discusses correctly implementing a singleton pattern in Ruby. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/6328791100030976/5968300611731456). API Overview - Sleeping and Terminating Threads This lesson talks about putting threads to sleep and terminating them. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/6328791100030976/5173937535188992). Interview Practice 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: blocking queue problem, bounded buffer problem or consumer producer problem. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/6328791100030976/4713039620210688). Interview Practice Problems - Dining Philosophers This lesson discusses the famous Dijkstra's Dining Philosophers problem. Two different solutions are explained at length. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/6328791100030976/4514747993030656). API Overview - Mutex This lesson discusses Mutex as used in Ruby. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/6328791100030976/5995593165963264). API Overview - Monitor This lesson introduces the use of Monitor in Ruby. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/6328791100030976/6525486299611136). API Overview - Quiz 3 Questions relating to the Threading API are covered in this lesson. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/6328791100030976/6535323964145664). Interview Practice Problems - Unisex Bathroom Problem In this lesson, we will look at a synchronization practice problem requiring us to synchronize the usage of a single bathroom by both genders. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/6328791100030976/6418112746356736). Interview Practice 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/6328791100030976/5770386849398784). Brief Intro to Asynchronous Programming - Introduction This lesson introduces the concept of asynchronous programming as an important programming paradigm. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/6328791100030976/6669142184689664). Interview Practice Problems - Rate Limiting Using Token Bucket Filter In this lesson, we will be ​ implementing rate limiting using a naive token bucket filter algorithm. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/6328791100030976/6362607709585408). Interview Practice 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 ​and we will learn about it in this lesson​ . View the lesson [here](https://www.educative.io/collection/page/5307417243942912/6328791100030976/5896195098542080). Interview Practice Problems - Barber Shop This lesson visits the synchronization issues when programmatically modeling a hypothetical barber shop and how they can be solved using Ruby's concurrency primitives. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/6328791100030976/4880941535199232). API Overview - Quiz 1 Questions relating to the Threading API are covered in this lesson. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/6328791100030976/6166052029333504). Brief Intro to Asynchronous Programming - Fiber This lesson introduces the concept of Fibers in Ruby, which is, in a sense, the equivalent of coroutines. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/6328791100030976/4596011534123008). Interview Practice Problems - ReadWrite Lock ​In this lesson, ​ we discuss a common interview question involving the synchronization of multiple reader threads and a single writer thread. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/6328791100030976/6740159527649280). Interview Practice Problems - Asynchronous to Synchronous Problem In this lesson, we will study a​ real-life interview question asking to convert asynchronous execution to synchronous execution. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/6328791100030976/5017658934165504). Epilogue - Acknowledgements Final thoughts and acknowledgements. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/6328791100030976/6064741317345280). Interview Practice Problems - Implementing Semaphore In this lesson, you will learn how to design and implement a simple semaphore class in Ruby. View the lesson [here](https://www.educative.io/collection/page/5307417243942912/6328791100030976/5215545592905728).
About the Ruby Concurrency for Senior Engineering Interviews (C. H. Afzal) category [Ruby Concurrency for Senior Engineering Interviews (C. H. Afzal)] (1)