System design

Poll Widget

Premium

Question

Design a poll widget that can be easily embedded on websites, such as articles and blogs, to allow website viewers to vote on options.

Poll widget before voting and after voting with proportional result bars and vote counts

Requirements

  • The widget displays the following information:
    • A list of options for users to vote on.
    • The latest number of votes for each option. This is only shown after the user has submitted a vote.
  • The following backend APIs are provided:
    • Fetching of the poll results.
    • Record a new vote on an existing poll option.
    • Remove a vote from an existing poll option.
  • It should not require much effort for a website owner to embed a poll widget within their website.
    Poll Widget | Front End System Design Question