Java Flashcards
Describe caching in a cpu.
null1
Describe deadlock.
null2
Describe visibility of a variable.
null3
Describe volatility and the volatile keyword.
null4
Does a thread get its own heap?
null5
Does a thread get its own stack?
null6
Give examples of some concurrency safe collections.
null7
Give some examples of collections that are not concurrency safe.
null8
How can enums help with making singletons thread safe?
null9
How can we alter the singleton design pattern to be thread safe?
null10
How do we fix race conditions?
null11
In java multithreading, what is the monitor design pattern?
null12
Is the classic singleton design pattern thread safe?
null13
What are Consumer interfaces?
null14
What are locks and keys?
null15
What are Predicate interfaces, and what do they return?
null16
What are the states of a thread?
null17
What design pattern can we use to reuse threads and minimize the overhead in an application?
null18
What does the .interrupt method do to a thread?
Moves a thread from the running state to the runnable state
What does the .join method do to a thread?
Calling thread enters the waiting state until the referenced thread terminates
What does the .notifyAll method do?
All threads are moved from the waiting state to the runnable state
What does the .notify method do to a thread?
One thread is moved from the waiting state to runnable state (chosen by the schedular)
What does the streams method, filter, do?
null19
What does the streams method, map, do?
null20
What does the streams method, reduce, do?
Combines all elements in a stream into one element
What does the .wait method do to a thread?
Moves a thread from the running state to the waiting state
What interface defines the void run method for threads?
null21
What is a Collector?
A mutable reduction operation that accumulates input elements into a mutable result container, optionally transforming the accumulated result into a final representation after all input elements have been processed.
What is a Deque?
null22
What is a functional interface?
null23
What is a HashMap?
null24
What is a HashSet?
null25
What is a HashTable?
null26
What is a Instant class?
null27