Highest-Rated Restaurant

Easy
Ranking

Highest-Rated Restaurant

The restaurants table contains restaurant ratings.

Return the single highest-rated restaurant as restaurant_id, restaurant_name, rating. Break ties by the smaller restaurant_id.

Browser Engine: Evaluates PySpark DataFrame & SQL logic locally in Pyodide WebAssembly.

Input data

1 DataFrame

These DataFrames are passed to solve(spark, dfs). Access one with dfs['name'].

df.restaurants6 rows
restaurant_id (int)restaurant_name (string)rating (double)
1Spice Route4.5
2Curry House4.8
3Tandoori Nights4.8
4Green Bowl4.2
5Sushi Bay4.7
6Pasta Point4.8

Return these columns

restaurant_id(int)
restaurant_name(string)
rating(double)

Column names and order must match. Sort order is specified in the question.

Browser engine
Loading Python editor…
Click Run to try the sample cases, or Submit to check the hidden cases. First run caches the browser Python engine (~8–15s once); all code stays on your device.