Giter Site home page Giter Site logo

digg-clone's Introduction

This is sample clone for Digg.com with simple topics, in-memory storage(No persistence) using a Priority Queue(Min heap) of fixed size.

Assumptions:

  1. No user logins and registrations
  2. Topics with same title and content is allowed by same user or different user
  3. Upvotes and Downvotes can submitted by any user to any topic any number of times.
  4. UI fancy designs, validations etc are not needed. It is simple UI and might have some validation and rendering issues.

Design:

  1. REST services for every operation and UI just uses to render data.
  2. REST services implemented in java, springboot
  3. Proper exception handling framework created. Sending a new error response in generic format is just a config change
  4. Popular topics are maintained in a Priority Queue(Min heap). So, updating PQ is of time complexity O(LogN) and to get all popular topics O(20) which is constant.
  5. PQs size is configurable.
  6. PQs are maintained for every kind of vote (Upvote, Downvote etc). Just adding a new Enum takes care of everything and no further code changes needed.
  7. NO UNIT TESTS WERE WRITTEN. But, code is very much testable.
  8. All operations are thread safe. Used synchronization where ever it is required and provided comments at every place explaining why it is used.(See TopicsDao.java)

digg-clone's People

Watchers

Manjeer Srujan avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.