Skip to content

React - The Polling Booth #1

@aditya-xq

Description

@aditya-xq

React Interview Challenge: The Polling Booth

Objective: Implement a simple real-time polling application using React.
Company: Eventbrite (Source)


Problem Statement

Scenario:

You are tasked with creating a polling application where users can vote between two choices. The UI should be intuitive and responsive, providing immediate feedback to user interactions.

Requirements:

  1. Choices Display: Present the user with two choices. Each choice will have its own label and a corresponding "Vote Me" button.

  2. Voting Mechanism:

    • Users should be able to click on the "Vote Me" button of a choice to cast their vote.
    • Users can vote multiple times for any choice.
    • Each click on the "Vote Me" button counts as one vote.
  3. Real-time Results:

    • Display the real-time results at the bottom of the choices. The results should update immediately after a vote is cast.
    • The result display should show the number of votes each choice has received.
  4. Winner Declaration:

    • Below the real-time results, provide a button labeled "Declare Winner".
    • When clicked, this button should determine the choice with the most votes and display it as the winner.
    • Once the winner is declared, both "Vote Me" buttons should be disabled to prevent further voting.
    • If the votes are tied, indicate that there is no clear winner.

Bonus:

  • Use CSS to style your components, providing a visually appealing interface.
  • Add a simple animation to the vote count to make the real-time updating more dynamic.
  • Implement the functionality such that it would be easy to scale from two choices to multiple choices in the future.

Evaluation Criteria

Your solution will be evaluated based on the following:

  1. Functionality: Does the solution satisfy all the given requirements?
  2. Code Organization: Is the application's codebase structured logically and cleanly?
  3. Clarity: Is the codebase understandable, with meaningful variable/function/component names?
  4. Design: Is the application visually appealing and user-friendly?
  5. Responsiveness: How well does the application handle a rapid sequence of votes?
  6. Extensibility: How easy would it be to extend the features or scale the choices?

Metadata

Metadata

Assignees

No one assigned

    Labels

    problemProblem statement to be solved

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions