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
Q

What does the streams method, reduce, do?

A

Combines all elements in a stream into one element

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

What does the .wait method do to a thread?

A

Moves a thread from the running state to the waiting state

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

What interface defines the void run method for threads?

A

null21

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

What is a Collector?

A

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.

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

What is a Deque?

A

null22

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

What is a functional interface?

A

null23

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

What is a HashMap?

A

null24

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

What is a HashSet?

A

null25

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

What is a HashTable?

A

null26

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

What is a Instant class?

A

null27

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

What is a Linked List?

A

null28

36
Q

What is a Map?

A

null29

37
Q

What is a mutex?

A

null30

38
Q

What is an Array List?

A

null31

39
Q

What is an intermediate operation of streams?

A

null322

40
Q

What is a predicate?

A

null33

41
Q

What is a race condition?

A

null34

42
Q

What is a reentrant lock and how is it used in java synchronization?

A

null35

43
Q

What is a semaphore?

A

null36

44
Q

What is a terminating operation of streams?

A

null37

45
Q

What is a thread?

A

null38

46
Q

What is a TreeMap?

A

null39

47
Q

What is a TreeSet?

A

null40

48
Q

What is a Vector?

A

null41

49
Q

What is caching?

A

null42

50
Q

What is covariance?

A

null43

51
Q

What is method overloading?

A

null44

52
Q

What is method overriding?

A

null45

53
Q

What is mutual exclusion?

A

null47

54
Q

What is over/under flow (widening and narrowing)?

A

null46

55
Q

What is parallelism in java multithreading?

A

null 47

56
Q

What is starvation?

A

When a thread cannot access a shared resource due to other threads using too frequently

57
Q

What is the callable interface?

A

null48

58
Q

What is the Collection interface?

A

null49

59
Q

What is the Collections class?

A

null50

60
Q

What is the Date Time api?

A

null51

61
Q

What is the difference between a checked and unchecked exception?

A

null52

62
Q

What is the difference between a HashTable and a HashMap?

A

null53

63
Q

What is the difference between a List and a Set?

A

null54

64
Q

What is the difference between a Set and a Queue?

A

null55

65
Q

What is the difference between Errors and Exceptions?

A

null56

66
Q

What is the difference between final, finalize, and finally?

A

null57

67
Q

What is the difference between java8 date time api vs java7 date time api (why did they remake it?

A

null58

68
Q

What is the difference between throw and throws?

A

null59

69
Q

What is the executor design pattern?

A

null60

70
Q

What is the executor interface?

A

null61

71
Q

What is the factory design pattern?

A

null62

72
Q

What is the Iterable interface?

A

null63

73
Q

What is the java.util.function package?

A

null64

74
Q

What is the producer consumer problem?

A

null65

75
Q

What is the purpose of connection pooling in jdbc or other connection style implementations?

A

null66

76
Q

What is the purpose of the Collections API

A

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
Q

What is the purpose of the thread schedular?

A

null67

78
Q

What is the ReadWriteLock interface in java and what are some notable subclasses?

A

null68

79
Q

What is the Runnable design pattern?

A

null69

80
Q

What is the singleton design pattern?

A

null70

81
Q

What is the stream api?

A

null71

82
Q

What is thread pooling?

A

null 72

83
Q

What is type casting?

A

null73

84
Q

What is up and down casting?

A

null74

85
Q

When adding the synchronized keyword to the method signature, what object is used for the key?

A

null75

86
Q

Which class can we extend to create a custom thread in java?

A

null76