Lesson 2 Quiz - Coursera
Lesson 2 Quiz - Coursera
100%
Correct
Exactly!
Correct
Exactly!
Correct
Correct.
4. How does your application find out the executors to work with? 1 / 1 point
The SparkContext object allocates the executors by communicating with the cluster manager.
Correct
Exactly!
You can ask Spark to make several copies of your persistent dataset.
Correct
Correct
Yes, you can tune persistence level to use both the disk & the memory.
Spark keeps all the intermediate data in the memory until the end of the computation, that is why it is a 'lighting-fast
computing'!
Yes!
While executing a job, Spark loads data from HDFS only once.
6. Imagine that you need to deliver three floating-point parameters for a machine learning 1 / 1 point
algorithm used in your tasks. What is the best way to do it?
Capture them into the closure to be sent during the task scheduling.
Correct
7. Imagine that you need to somehow print corrupted records from the log file to the screen. 1 / 1 point
How can you do that?
Use an accumulator variable to collect all the records and pass them back to the driver.
Use a broadcast variable to broadcast the corrupted records and listen for these events in the driver.
Correct
The executors distribute the content with a peer-to-peer, torrent-like protocol, and the driver seeds the content.
The executors are organized in a tree-like hierarchy, and the distribution follows the tree structure.
The driver sends the content in parallel to every executor.
Correct
Correct.
9. What will happen if you use a non-associative, non-commutative operator in the accumulator 1 / 1 point
variables?
Correct
Yes. As the order of the updates is unknown in advance, we must be able to apply them in any order. Thus,
commutativity and associativity.
10. Mark all the operators that are both associative and commutative. 1 / 1 point
first(x, y) = x
prod(x, y) = x * y
Correct
Correct.
avg(x, y) = (x + y) / 2
Correct
Correct.
Correct
Correct.
last(x, y) = y
sum(x, y) = x + y
Correct
Correct.
11. Does Spark guarantee that accumulator updates originating from actions are applied only 1 / 1 point
once?
Yes.
No.
Correct
Correct.
12. Does Spark guarantee that accumulator updates originating from transformations are applied 1 / 1 point
at least once?
No.
Yes.
Correct
Correct.