Object-Oriented Programming · Rippling · Medium
Design an in-memory voting service for articles. Each user can have one current vote per article: UP, DOWN, or NONE. Initially, no user has voted on any article. An article's score is $$U - D$$, where $$U$$ is the number of current UP votes and $$D$$ is the number of current DOWN votes. All data is kept in memory for a single process; no persistence is required. A flip occurs only when a user changes an existing vote directly from UP to DOWN or from DOWN to UP. Changing a…
Checking your access…