Instagram Story Completion Rate

Easy
Arithmetic
Product Metrics
Instagram

Instagram Story Completion Rate

An Instagram-style stories team tracks how many viewers finish each story.

Return story_id, completion_pct, where completion rate is completions / views * 100, rounded to 2 decimal places. Sort by story_id ascending.

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.stories6 rows
story_id (int)story_name (string)views (int)completions (int)
1Launch Teaser100008500
2Behind the Scenes80006000
3Product Drop1200011400
4Q&A50002500
5Poll60004500
6Recap90008100

Return these columns

story_id(bigint)
completion_pct(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.