Java Flashcards

1
Q

What is context switching in multi-threaded apps?

A

The time it takes to start processing another thread.

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

What is the sort algorithm for Arrays.sort()

A

QuickSort - dual pivot

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

What does SOLID stand for

A
  1. Single-responsiblity Principal
  2. Open-closed Principal
  3. Liskov Substitution Principal
  4. Interface Segregation Principal
  5. Dependency Inversion Principal
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Which one is threadsafe StringBuilder or StringBuffer?

A

StringBuffer

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

What are two ways to create a task that can run in parallel?

A
  1. Extends Thread
  2. Implements Runnable
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the Open-closed principal?

A

Open to change, closed to modification.

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

What is the Liskov Substitution Principal?

A

Polymorphism just works.

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

What is the Interface Segregation Principal?

A

Client should never be forced to implement an interface they do not use.

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

What is the Dependency Inversion Principal

A

Entities must depend on abstractions.

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

What is your perspective on the SOLID principals.

A

The Dependency Inversion Principal is pliable - tension with the YAGNI principal.

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

In java what do you call to start a thread?

A

start()

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