The goal is to print the numbers in order, while one thread only prints the even numbers and the other thread only prints the odd numbers.
Design a thread-safe singleton class in Java, ensuring that only a single instance is created even in a multi-threaded environment.
Implement a program that performs matrix multiplication using multiple threads to achieve parallel processing and improve performance.
- Linked list
- Queue
- Stack
- Fairness/starvation free
- Caste variation
- Multi bathroom variation
- Priority
Implement a rate limiter that can control the rate of job execution, ensuring that jobs are not executed more frequently than a specified limit.
Implement a thread-safe LRU (Least Recently Used) cache with support for concurrent read and write operations, considering efficiency and thread safety.
Deque
- Exit when disk is full.
Implement a concurrent task scheduler that can execute multiple tasks concurrently while limiting the maximum number of parallel executions.
- void return type
- with some return value
- task delay support
- shutdown support
- cancel support
- cache support
- dont accept new tasks if some currently running task fails
- tasks with dependencies
Implement a thread-safe job queue in Java that supports adding jobs, removing jobs, and retrieving the next job to execute efficiently.
Implement a job scheduler that supports job priorities and allows for dynamically changing the priority of running jobs.
Design a distributed lock manager that can coordinate job execution across multiple nodes to prevent concurrent execution of conflicting jobs.