Skip to main content
← Back to PySpark Assessments
🎓 PYSPARK CERTIFICATION LEARNING STUDIO

PySpark Practice Test 04

50 Comprehensive Questions (Questions 151–200)
✓0 / 50 Mastered
Question 1 of 500 of 50 Checked (0%)
Question 151of 50
🤔 Step: Reason & Select

Input DataFrame:

+------+
|salary|
+------+
|  1000|
|  1000|
|  2000|
+------+

Code:

from pyspark.sql.functions import rank
from pyspark.sql.window import Window

w = Window.orderBy("salary")
df.withColumn("r", rank().over(w)).select("r")

What will be the sequence of rank values output by this operation?

💡
Think Before You Check: Take a moment to reason through the scenario, evaluate architectural trade-offs, and choose your option before checking.
A
A. 1, 1, 2
B
B. 1, 1, 3
C
C. 1, 2, 3
D
D. 2, 2, 3
Question 1 of 50
Question Navigator (Test 04)0 / 50 Checked
Mastered (0) Needs Review (0) Unchecked (50) Current