Skip to content

lakshaythareja/swiggy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

swiggy

Steps to follow:

  1. Choose the option number from the list
  2. Enter the id/timing as integer values.
  3. To check for restaurants enter the time you want to select.

NOTE: Before checking for restaurants at a specific time, please update the cache for that time as a continous service is not running for updating the cache. Enter all values as int only.

Sample Output:

What would you like to do

  1. Enter new restaurant
  2. Enter holiday timings
  3. Check restaurants for current time
  4. Update cache for the given time
  5. Exit choose -1 1 Enter the restaurant id as int 1 Please enter the timings of the restaurant Enter the number of timing values 2 Enter the opening time 1 Enter the closing time 7 Enter the opening time 13 Enter the closing time 17 What would you like to do
  6. Enter new restaurant
  7. Enter holiday timings
  8. Check restaurants for current time
  9. Update cache for the given time
  10. Exit choose -1 4 Enter the time for which cache should be updated 1 Updating the cache for current time period Cache updated What would you like to do
  11. Enter new restaurant
  12. Enter holiday timings
  13. Check restaurants for current time
  14. Update cache for the given time
  15. Exit choose -1 3 Enter the current time 3 Restaurant 1 open What would you like to do
  16. Enter new restaurant
  17. Enter holiday timings
  18. Check restaurants for current time
  19. Update cache for the given time
  20. Exit choose -1 2 Enter the restaurant id as int 1 Please enter the timings of the restaurant Enter the start time 3 Enter the end time 4 What would you like to do
  21. Enter new restaurant
  22. Enter holiday timings
  23. Check restaurants for current time
  24. Update cache for the given time
  25. Exit choose -1 4 Enter the time for which cache should be updated 3 Updating the cache for current time period Cache updated What would you like to do
  26. Enter new restaurant
  27. Enter holiday timings
  28. Check restaurants for current time
  29. Update cache for the given time
  30. Exit choose -1 3 Enter the current time 3 Restaurant 1 closed will open at 4

For Scale (Not 100% sure this is the optimal way to do it): We can run a periodic service/cron jobs that just updates the cache at that interval or we can have a lambda function trigger a cache update whenever the time is the same as the starttime of updateState. For caching we can use a redis cache.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages