Java Multithreading for Senior Engineering Interviews
This course is designed to equip learners, seeking positions as experienced Java programmers, with advanced concurrency and multi-threading concepts.
Concurrency in Java is one of the most complex and advanced topics brought up during senior engineering interviews. Knowledge of concurrency and multithreading can put interviewees at a considerable advantage. This course lays the foundations of advanced concurrency and multithreading and explains concepts such as Monitors and Deferred Callbacks in depth. It also builds simple and complete solutions to popular concurrency problems that can be asked about in interviews like the Reader-Writer Problem and the Dining Philosopher Problem. While prior knowledge of concurrency is not required to follow through with this course, familiarity with the very basics of concurrency would be helpful.
Course Content
1.The Basics
- Introduction
- Program vs Process vs Thread
- Concurrency vs Parallelism
- Cooperative Multitasking vs Preemptive Multitasking
- Synchronous vs Asynchronous
- I/O Bound vs CPU Bound
- Throughput vs Latency
- Critical Sections & Race Conditions
- Deadlocks, Liveness & Reentrant Locks
- Mutex vs Semaphore
- Mutex vs Monitor
- Java’s Monitor & Hoare vs Mesa Monitors
- Semaphore vs Monitor
- Amdahl’s Law
- Moore’s Law
2.Multithreading in Java
- Atomic Assignments
- Thready Safety & Synchronized
- Wait & Notify
- Interrupting Threads
- Volatile
- Reentrant Locks & Condition Variables
- Missed Signals
- Semaphore in Java
- Spurious Wakeups
- Atomic Classes
- More on Atomics
- Non-blocking Synchronization
- Miscellaneous Topics
3.Java’s Memory Model
- Memory Model
- Reordering Effects
- The happens-before Relationship and Model
4.Interview Practice Problems
- Blocking Queue | Bounded Buffer | Consumer Producer
- Rate Limiting Using Token Bucket Filter
- Thread Safe Deferred Callback
- Implementing Semaphore
- ReadWrite Lock
- Unisex Bathroom Problem
- Implementing a Barrier
- Uber Ride Problem
- Dining Philosophers
- Barber Shop
- Superman Problem
- Multithreaded Merge Sort
- Asynchronous to Synchronous Problem
- Nonblocking Stack
- Epilogue
5.Bonus Questions
- Ordered Printing
- Printing Foo Bar n Times
- Printing Number Series (Zero, Even, Odd)
- Build a Molecule
- Fizz Buzz Problem
6.Beyond the Interview
- Next Steps
7.Java Concurrency Reference
- Setting-up Threads
- Basic Thread Handling
- Executor Framework
- Executor Implementations
- Thread Pools
- Types of Thread Pools
- An Example: Timer vs ScheduledThreadPool
- ThreadPoolExecutor
- Callable Interface
- Future Interface
- CompletionService Interface
- ThreadLocal
- ThreadLocalRandom
- CountDownLatch
- CyclicBarrier
- Concurrent Collections
- ConcurrentHashMap
- ConcurrentModificationException
- Lock Interface
- LockSupport
- ReentrantLock
- ReadWriteLock
- StampedLock
- Atomic Boolean
- AtomicInteger
- AtomicIntegerArray
- AtomicIntegerFieldUpdater
- AtomicLong
- AtomicLongArray
- AtomicLongFieldUpdater
- LongAdder
- LongAccumulator
- DoubleAdder
- DoubleAccumulator
- AtomicReference
- AtomicReferenceArray
- AtomicReferenceFieldUpdater
- AtomicStampedReference
- AtomicMarkableReference
- Exchanger
- Phaser
- IllegalMonitorStateException
- TimeoutException
- CancellationException
- ExecutionException
- RejectedExecutionException
- CompletionException
- BrokenBarrierException
- Annotations
8.Revision & Quizzes
- Quiz 1
- Quiz 2
- Quiz 3
- Quiz 4
- Quiz 5
- Quiz 6
- Quiz 7
- Quiz 8
There are no reviews yet.