wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Utility Transform

Total questions: 14

Worksheet time: 7mins

Name
Class
Date
1.

What is ParDo used for in Apache Beam?

a)

To group elements by a key

b)

To apply a function to each element of a PCollection

c)

To combine multiple PCollections into one

d)

To divide a PCollection into several output PCollections

2.

What is the purpose of the GroupByKey transform?

a)

To apply a function to each element of a PCollection

b)

To put all elements with the same key together in the same worker

c)

To combine multiple PCollections into one

d)

To flatten multiple PCollections

3.

What issue can arise with GroupByKey when dealing with very large groups or skewed data?

a)

Hotkey problem

b)

Data loss

c)

Increased latency

d)

Data duplication

4.

`GroupByKey` can inherently cause data loss (True or False)

a)

True

b)

False

5.

`GroupByKey` can cause data duplication. (True or False)

a)

True

b)

False

6.

How does the Combine transform improve performance for large groups?

a)

By grouping all elements with the same key together

b)

By applying a function to each element individually

c)

By making the transformation in a hierarchy of several steps

d)

By dividing the PCollection into several output PCollections

7.

What type of operation can GroupByKey be used to perform?

a)

Inner join

b)

Outer join

c)

Flatten

d)

Both a and b

8.

What does the Flatten transform do?

a)

Groups elements by key

b)

Combines multiple PCollections into one

c)

Divides a PCollection into several output PCollections

d)

Applies a function to each element of a PCollection

9.

What is a key difference between Flatten and joins using GroupByKey?

a)

Flatten only works with PCollections of different types

b)

Joins using GroupByKey require PCollections to have different value types sharing a common key

c)

Flatten can only be used for PCollections with different value types

d)

Joins using GroupByKey require PCollections to have the same type

10.

What does the Partition transform do?

a)

Groups elements by key

b)

Combines multiple PCollections into one

c)

Divides a PCollection into several output PCollections by applying a function that assigns a group ID to each element

d)

Applies a function to each element of a PCollection

11.

In which scenario would you prefer using Combine instead of GroupByKey?

a)

When dealing with very small groups

b)

When the data is highly skewed and you want to avoid the hotkey problem

c)

When you want to join two PCollections

d)

When you want to apply a function to each element

12.

What is a potential performance issue when using GroupByKey with highly skewed data?

a)

Data loss

b)

Hotkey problem leading to imbalance in processing

c)

Increased network latency

d)

Data duplication

13.

When would you use Flatten over GroupByKey?

a)

When you want to combine two PCollections with different types

b)

When you have two PCollections with the same type and want to merge them

c)

When you want to apply a function to each element of a PCollection

d)

When you want to join two PCollections by a common key

14.

Which transform would you use to divide a PCollection into multiple PCollections based on a function?

a)

GroupByKey

b)

Flatten

c)

Combine

d)

Partition