Bird
0
0
LLDsystem_design~5 mins

Concurrency considerations in LLD - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is concurrency in system design?
Concurrency means multiple tasks or processes are happening at the same time or overlapping in time to improve efficiency and performance.
Click to reveal answer
beginner
Why do we need locks or mutexes in concurrent systems?
Locks or mutexes prevent multiple processes from changing the same data at the same time, avoiding errors and data corruption.
Click to reveal answer
intermediate
What is a race condition?
A race condition happens when two or more processes try to change shared data at the same time, causing unpredictable results.
Click to reveal answer
intermediate
Explain deadlock in concurrency.
Deadlock is when two or more processes wait forever for each other to release resources, so none can continue.
Click to reveal answer
intermediate
What is the difference between concurrency and parallelism?
Concurrency is about managing multiple tasks at once, possibly by switching between them. Parallelism is running multiple tasks exactly at the same time using multiple processors.
Click to reveal answer
What problem does a mutex solve in concurrent systems?
AAutomatically fixes bugs in code
BIncreases the speed of a single process
CAllows unlimited access to shared resources
DPrevents multiple processes from accessing shared data simultaneously
Which of the following best describes a race condition?
AProcesses waiting forever for each other
BMultiple processes accessing shared data causing unpredictable results
CA process running faster than expected
DA system crash due to hardware failure
Deadlock occurs when:
AA single process crashes
BProcesses run in parallel without issues
CProcesses wait forever for resources held by each other
DResources are never requested
Which technique helps avoid race conditions?
AUsing locks or synchronization mechanisms
BRunning processes sequentially only
CIgnoring shared data
DIncreasing CPU speed
What is the main difference between concurrency and parallelism?
AConcurrency is multitasking; parallelism is multitasking on multiple processors
BConcurrency is faster than parallelism
CParallelism uses one processor only
DThey are the same
Describe common concurrency problems and how to handle them.
Think about what happens when multiple processes share data or resources.
You got /4 concepts.
    Explain the difference between concurrency and parallelism with examples.
    Consider how tasks are managed or executed at the same time.
    You got /4 concepts.