DataDriven
LearnPracticeInterviewDiscussDailyJobs

The Scoreboard Race

A medium Python interview practice problem on DataDriven. Write and execute real python code with instant grading.

Domain
Python
Difficulty
medium
Seniority
L3

Problem

You are replaying a recorded dice game from its log of rolls. Deal the values in `rolls` one at a time around the table in seating order (player 0, then player 1, wrapping back to player 0 after the last player), adding each value to that player's running total. The game ends the instant any player's total reaches or passes `target`, even mid-round before the remaining players have rolled; return all `num_players` scores, indexed by player, at that moment.

Summary

The first to cross the line ends the game, mid-round or not.

Practice This Problem

Solve this Python problem with real code execution. DataDriven runs your Python code in a real environment and grades it automatically.

Related

  • All Practice Problems
  • Mock Interview Mode
  • Python Interview Questions
  • Data Engineering Interview Prep Guide
  • Daily Challenge
  • Data Engineering Lessons