Java Flashcards

1
Q

Describe caching in a cpu.

A

null1

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Describe deadlock.

A

null2

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Describe visibility of a variable.

A

null3

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Describe volatility and the volatile keyword.

A

null4

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Does a thread get its own heap?

A

null5

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Does a thread get its own stack?

A

null6

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Give examples of some concurrency safe collections.

A

null7

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Give some examples of collections that are not concurrency safe.

A

null8

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How can enums help with making singletons thread safe?

A

null9

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How can we alter the singleton design pattern to be thread safe?

A

null10

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How do we fix race conditions?

A

null11

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

In java multithreading, what is the monitor design pattern?

A

null12

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Is the classic singleton design pattern thread safe?

A

null13

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What are Consumer interfaces?

A

null14

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What are locks and keys?

A

null15

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What are Predicate interfaces, and what do they return?

A

null16

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

What are the states of a thread?

A

null17

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

What design pattern can we use to reuse threads and minimize the overhead in an application?

A

null18

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

What does the .interrupt method do to a thread?

A

Moves a thread from the running state to the runnable state

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

What does the .join method do to a thread?

A

Calling thread enters the waiting state until the referenced thread terminates

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

What does the .notifyAll method do?

A

All threads are moved from the waiting state to the runnable state

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

What does the .notify method do to a thread?

A

One thread is moved from the waiting state to runnable state (chosen by the schedular)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

What does the streams method, filter, do?

A

null19

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

What does the streams method, map, do?

A

null20

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
What does the streams method, reduce, do?
Combines all elements in a stream into one element
26
What does the .wait method do to a thread?
Moves a thread from the running state to the waiting state
27
What interface defines the void run method for threads?
null21
28
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.
29
What is a Deque?
null22
30
What is a functional interface?
null23
31
What is a HashMap?
null24
32
What is a HashSet?
null25
33
What is a HashTable?
null26
34
What is a Instant class?
null27
35
What is a Linked List?
null28
36
What is a Map?
null29
37
What is a mutex?
null30
38
What is an Array List?
null31
39
What is an intermediate operation of streams?
null322
40
What is a predicate?
null33
41
What is a race condition?
null34
42
What is a reentrant lock and how is it used in java synchronization?
null35
43
What is a semaphore?
null36
44
What is a terminating operation of streams?
null37
45
What is a thread?
null38
46
What is a TreeMap?
null39
47
What is a TreeSet?
null40
48
What is a Vector?
null41
49
What is caching?
null42
50
What is covariance?
null43
51
What is method overloading?
null44
52
What is method overriding?
null45
53
What is mutual exclusion?
null47
54
What is over/under flow (widening and narrowing)?
null46
55
What is parallelism in java multithreading?
null 47
56
What is starvation?
When a thread cannot access a shared resource due to other threads using too frequently
57
What is the callable interface?
null48
58
What is the Collection interface?
null49
59
What is the Collections class?
null50
60
What is the Date Time api?
null51
61
What is the difference between a checked and unchecked exception?
null52
62
What is the difference between a HashTable and a HashMap?
null53
63
What is the difference between a List and a Set?
null54
64
What is the difference between a Set and a Queue?
null55
65
What is the difference between Errors and Exceptions?
null56
66
What is the difference between final, finalize, and finally?
null57
67
What is the difference between java8 date time api vs java7 date time api (why did they remake it?
null58
68
What is the difference between throw and throws?
null59
69
What is the executor design pattern?
null60
70
What is the executor interface?
null61
71
What is the factory design pattern?
null62
72
What is the Iterable interface?
null63
73
What is the java.util.function package?
null64
74
What is the producer consumer problem?
null65
75
What is the purpose of connection pooling in jdbc or other connection style implementations?
null66
76
What is the purpose of the Collections API
A collections framework represents a unified application programming interface for not only representing collections of objects, but also for manipulating them in a consistent manner at a high enough level of abstraction to encourage reusability and good object-oriented design.
77
What is the purpose of the thread schedular?
null67
78
What is the ReadWriteLock interface in java and what are some notable subclasses?
null68
79
What is the Runnable design pattern?
null69
80
What is the singleton design pattern?
null70
81
What is the stream api?
null71
82
What is thread pooling?
null 72
83
What is type casting?
null73
84
What is up and down casting?
null74
85
When adding the synchronized keyword to the method signature, what object is used for the key?
null75
86
Which class can we extend to create a custom thread in java?
null76