Pertanyaan dan Jawaban Wawancara Paling Populer & Tes Online
Platform edukasi untuk persiapan wawancara, tes online, tutorial, dan latihan langsung

Bangun keterampilan dengan jalur belajar terfokus, tes simulasi, dan konten siap wawancara.

WithoutBook menghadirkan pertanyaan wawancara per subjek, tes latihan online, tutorial, dan panduan perbandingan dalam satu ruang belajar yang responsif.

Prepare Interview

PySpark Pertanyaan dan Jawaban Wawancara

Ques 21. What is the purpose of the 'groupBy' operation in PySpark?

'groupBy' is used to group the data based on one or more columns. It is often followed by aggregation functions to perform operations on each group.

Example:

grouped_data = df.groupBy('Category').agg({'Price': 'mean'})

Apakah ini membantu? Add Comment View Comments
 

Ques 22. Explain the difference between 'cache' and 'persist' operations in PySpark.

'Cache' is a shorthand for 'persist(memory_only=True)', while 'persist' allows more flexibility by specifying storage levels (memory-only, disk-only, etc.).

Example:

df.cache()

Apakah ini membantu? Add Comment View Comments
 

Ques 23. How can you create a temporary view from a PySpark DataFrame?

You can use the 'createOrReplaceTempView' method to create a temporary view from a PySpark DataFrame.

Example:

df.createOrReplaceTempView('temp_view')

Apakah ini membantu? Add Comment View Comments
 

Ques 24. What is the purpose of the 'orderBy' operation in PySpark?

'OrderBy' is used to sort the rows of a DataFrame based on one or more columns.

Example:

result = df.orderBy('column')

Apakah ini membantu? Add Comment View Comments
 

Ques 25. Explain the role of the 'broadcast' variable in PySpark.

A 'broadcast' variable is used to cache a read-only variable in each node of a cluster to enhance the performance of joins.

Example:

from pyspark.sql.functions import broadcast

result = df1.join(broadcast(df2), 'key')

Apakah ini membantu? Add Comment View Comments
 

Most helpful rated by users:

Hak Cipta © 2026, WithoutBook.