Flipkart | Disease Tracker | Low-level-Design | Machine coding

Disease Tracker

Description:
There are many Wars with disease fought all over the world. For example, in the past war with
virus like Ebola, Zika, Spanish Flu etc were reported and they spread over multiple countries.
The most recent case is Covid-19 which has affected around 190 countries and is spreading
very fast among the world population.
These diseases usually start from one region and spread through various human/animal
interactions in other regions. However there can be some like famine, hunger, cancer etc which
can start in unrelated places.
Governments all over the world want to control the spread of diseases by taking appropriate
measures for which they need to track the disease at regional level first.
You are required to create a tracker tool which will help to track the diseases.
Features:

  1. Should be able to track multiple Disease Wars.
  2. Should be able to capture Affected cases at country, state.
  3. One individual can be infected with multiple diseases at a time
  4. Should be able to capture cured cases for diseases as well as fatality cases.
  5. Should be able to show stats at multiple levels (state/country/global) in an anonymized
    manner.
    a. Total count = person Affected + person recovered + person passed due to same
    disease + person passed due to different war with disease
  6. Should be able to show stats at disease level in an anonymized manner.
    a. Total count = person Affected + person recovered + person passed due to same
    disease + person passed due to different war with disease
    Bonus Feature:
  7. For admins, details to be available in non-anonymized manner. No access control
    expected for admin and non admin, it can be on the basis of input.
    Requirements:
  8. Onboard different incidents (name, type, infectionType, transmission type etc)
  9. Report as positive case in the tracker with required info, demographics like
    (diseaseType, IndividualId, region)
  10. Report a cured/fatality case in the tracker: (diseaseType, IndividualDetails, region)
  11. Show stats at different levels as in feature 5.
  12. For edge cases like having an individual involved in multiple wars getting passed please
    count for all the diseases.
    Bonus question:
  13. Show non-anonymized reports to area managers for the same area and anonymized for
    others.
  14. Tracker should be able to show stats for a given country: country level summary, state
    wise breakup summary. Show state wise breakup summary for a given disease in a
    country
    Other Details:
  15. Do not use any database or NoSQL store, use the in-memory store for now.
  16. Do not create any UI for the application.
  17. Write a driver class for the demo purposes. Which will execute all the commands at one
    place in the code and test cases.
  18. Please prioritize code compilation, execution, and completion.
  19. Work on the expected output first and then add good-to-have features of your own.
  20. You can choose whatever input format you want as long as all the input parameters are

Test Cases:
(Test cases are defined for understanding feature requirements only. Please model it appropriately based on your service
implementation)

Test Case 1:

  1. registerDisease(“COVID-19”, VIRAL, TRANSMISSIBLE, AIR)
  2. registerDisease(“HUNGER”, ECONOMY, NON-TRANSMISSIBLE, NONE)
  3. registerDisease(“TYPHOID”, Bacterial, TRANSMISSIBLE, WATER)
  4. report(“COVID-19”, P1, “China”, “Hubei”, “Wuhan” )
  5. report(“COVID-19”, P2, “China”, “Hubei”, “Wuhan”)
  6. report(“COVID-19”, P3, “China”, “Jiangsu”, “Shanghai”)
  7. report(“COVID-19”, P4, “India”, “Uttar Pradesh”, “Agra”)
  8. report(“COVID-19”, P5, “India”, “Uttar Pradesh”, “Varanasi”)
  9. report(“COVID-19”, P6, “India”, “Karnataka”, “Bangalore”)
  10. report(“COVID-19”, P7, “India”, “Karnataka”, “Bangalore”)
  11. report(“COVID-19”, P8, “India”, “Karnataka”, “Bangalore”)
  12. report(“Spanish Flu”, P9, “USA”, “California”, “Los Angeles”)
  13. report(“Spanish Flu”, P10, “USA”, “California”, “San-francisco”)
  14. ShowWorldSummary() =>
    a. Overall:
    i. Total : 10
    ii. Cured : 0
    iii. Fatality : 0
    iv. Active : 10
  15. ShowWorldSummaryDiseasesBreakup() =>
    a. COVID-19:
    i. Total : 8
    ii. Cured : 0
    iii. Fatality : 0
    iv. Active : 8
    b. Spanish Flu:
    i. Total : 2
    ii. Cured : 0
    iii. Fatality : 0
    iv. Active : 2
  16. ShowCountryBreakup(“COVID-19”) =>
    a. China:
    i. Total : 3
    ii. Cured : 0
    iii. Fatality : 0
    iv. Active : 3
    b. India:
    i. Total : 5
    ii. Cured : 0
    iii. Fatality : 0
    iv. Active : 5
  17. cured(“COVID-19”, P8)
  18. ShowCountryBreakup(“COVID-19”) =>
    a. China:
    i. Total : 3
    ii. Cured : 0
    iii. Fatality : 0
    iv. Active : 3
    b. India:
    i. Total : 5
    ii. Cured : 1
    iii. Fatality : 0
    iv. Active : 4
  19. registerFatility(“COVID-19”, P2)
    Bonus:
  20. ShowStateBreakup(“COVID-19”, “India”)
    a. Uttar Pradesh:
    i. Total : 2
    ii. Cured : 0
    iii. Fatality : 0
    iv. Active : 2
    b. Karnataka:
    i. Total : 3
    ii. Cured : 0
    iii. Fatality : 0
    iv. Active : 3
  21. ShowDetailsToAdmin()
    i. COVID-19:
  22. Total : 8 {p1, p2, ...}
  23. Cured : 1 {P8}
  24. Fatality : 1 {P2}
  25. Active : 6 {.... }
Comments (4)