Concurrency Flashcards

1
Q

Synchronous fs asynchronous

A

Synchronous = blocking
Asyn = non-blocking, code executes immediately

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

Why use async?

A

Better user experience

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

What is a thread?

A

A path of execution of a group of statements

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

What is multithreading?

A

Like hafing another cpu to execute code

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

Name 3 multithreading problems

A

Deadlock
Race conditions
Starfation

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

What are Lambdas?

A

Anon functions
Like arrow functions

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

What is CompletableFutures used for?

A

Used to multithread

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

What should you use completable futures?

A

I/O bound operations: Db calls, API calls
Parallel processing: Large datasets
Responsife UI

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

When shouldn’t you use completable futures?

A

Short lifed operations
Operations that inherently block
When oferusing threads

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