Skip to main content
Internal Service β€” This is not an HTTP endpoint. It’s called by the ranking-score route.

Purpose

Generates 4 fake competitor scores that are displayed alongside the user’s score. Creates the impression of a competitive landscape.

Function Signature

Parameters

Returns

List[int] - 4 competitor scores, sorted descending (highest first)

Rules

Example Output

For a user score of 38:
The user sees: β€œYou rank #5 out of 5 competitors”

Why This Design?

  1. Close competitor - Shows the user they’re β€œalmost” beating someone
  2. Higher scores - Creates urgency (β€œcompetitors are ahead”)
  3. Sorted descending - Easy to display as a leaderboard
  4. Randomized ranking - Some users rank 4th (hope), some rank 5th (urgency)

Code Location