Популярное

Музыка Кино и Анимация Автомобили Животные Спорт Путешествия Игры Юмор

Интересные видео

2025 Сериалы Трейлеры Новости Как сделать Видеоуроки Diy своими руками

Топ запросов

смотреть а4 schoolboy runaway турецкий сериал смотреть мультфильмы эдисон
dTub
Скачать

Low Level Design of Food Ordering and Rating app using Observer Design Pattern: Java Machine Coding

Автор: System Design and Gossip

Загружено: 2023-12-24

Просмотров: 615

Описание:

This video explains object-oriented design of a Restaurant Food Ordering and Rating system from list of problems on CodeZym.
Problem details : https://codezym.com/question/5
This question is asked in SDE-1, SDE-2 and Senior Software Engineer interviews.
This is a Java machine coding solution which is tested in a multithreaded environment on CodeZym.

Link to blog with code: https://bit.ly/3RYJ3ra
Feel free to reach out to me on LinkedIn: https://bit.ly/45ZeWmU

Design patterns used: Observer Design Pattern and concepts from strategy design pattern.
Thread safe data structures used: ConcurrentHashMap, ConcurrentLinkedDequeue, AtomicInteger

Problem statement:
Write code for low level design (object oriented design) of a restaurant food ordering and rating system similar to food delivery apps like Zomato, Swiggy, Door Dash, Uber Eats etc.

There will be food items like 'Veg Burger', 'Veg Spring Roll', 'Ice Cream' etc.
And there will be restaurants from where you can order these food items.

Same food item can be ordered from multiple restaurants. e.g. you can order 'food-1' 'veg burger' from burger king as well as from McDonald's.

Users can order food, rate orders, fetch restaurants with most rating and fetch restaurants with most rating for a particular food item e.g. restaurants which have the most rating for 'veg burger'.

Your solution should implement below methods :

Method : init(Helper05 helper)

Method : addFoodItem(String foodItemId, double price, String foodItemName)

Method : addRestaurant(String restaurantId, List[String] foodItemIds, String name, String address)

Method : orderFood(String orderId, String restaurantId, String foodItemId)

Method : rateOrder(String orderId, int rating)

Method : List[String] getTopRestaurantsByFood(String foodItemId)

Method : List[String] getTopRatedRestaurants()

Note :
Your code will be tested in a MULTI-THREADED environment, so use thread safe data structures and handle synchronization properly.

method call to rateOrder() will never be done concurrently with
getTopRatedRestaurants() or
getTopRestaurantsByFood(String foodItemId) : for the same foodItemId in given orderId
This is done to keep system state consistent and also test accurately in a multithreaded environment.

There will be at max 50 food items, at max 10,000 restaurants, and each restaurant can sell at max 25 food items

Rating for unrated restaurants or food items should be considered 0

when you rate an order it will count towards overall average rating of restaurant as well as average rating of restaurant for that particular food item.

when you are rating an order e.g giving 4 stars to an order then it means you are assigning 4 stars to both the food item in that restaurant as well as 4 stars to the overall restaurant ranting.

Ratings will range from 1,2,3,4 or 5 stars, 1 being the worst and 5 being the best rating.

Average ratings are rounded down to 1 decimal point, i.e. 4.05, 4.08, 4.11, 4.12, 4.14 all become 4.1 and 4.15, 4.19, 4.22, 4.24 all become 4.2


List of topics for this question:

Design a food delivery app
Design a food rating system
Design a food app
Food delivery app low level design
design a food ordering system
Food ordering app
Design swiggy
Design zomato
Design doordash
Design uber eats
Design uber eats app
Swiggy lld
Zomato lld


low level design
object oriented design
design patterns
Strategy design pattern
Observer design pattern
Strategy pattern
Observer pattern
Java
Machine coding

design patterns in java
lld system design
lld interview question
lld interview
lld & hld system design
low level system design
machine coding
machine coding round
machine coding interview
object oriented programming

Low Level Design of Food Ordering and Rating app using Observer Design Pattern: Java Machine Coding

Поделиться в:

Доступные форматы для скачивания:

Скачать видео mp4

  • Информация по загрузке:

Скачать аудио mp3

Похожие видео

Low Level Design of a Webpage Visits Counter or Hits/Views/Likes Counter: Machine Coding in Java

Low Level Design of a Webpage Visits Counter or Hits/Views/Likes Counter: Machine Coding in Java

Ограничитель скорости. Часть 1 | Проектирование системы

Ограничитель скорости. Часть 1 | Проектирование системы

Cała prawda o Danii! Miśko: To co robili na Grenlandii było straszne!

Cała prawda o Danii! Miśko: To co robili na Grenlandii było straszne!

How to design classes for bookmyshow like app using Facade Design Pattern | LLD | Low Level Design

How to design classes for bookmyshow like app using Facade Design Pattern | LLD | Low Level Design

Синьор 1С: 10 привычек, без которых ты не вырастешь

Синьор 1С: 10 привычек, без которых ты не вырастешь

LLD and Machine Coding Problems | Crack SDE Interviews

LLD and Machine Coding Problems | Crack SDE Interviews

A Beginner's Guide to Event-Driven Architecture

A Beginner's Guide to Event-Driven Architecture

27. All Creational Design Patterns | Prototype, Singleton, Factory, AbstractFactory, Builder Pattern

27. All Creational Design Patterns | Prototype, Singleton, Factory, AbstractFactory, Builder Pattern

Проектирование высокого уровня против проектирования низкого уровня | HLD против LLD | Концепции ...

Проектирование высокого уровня против проектирования низкого уровня | HLD против LLD | Концепции ...

Что делает программист весь день? Показываю

Что делает программист весь день? Показываю

Проектирование системы: масштабирование системы от нуля до миллиона пользователей | #systemdesign

Проектирование системы: масштабирование системы от нуля до миллиона пользователей | #systemdesign

Patterns of Event Driven Architecture - Mark Richards

Patterns of Event Driven Architecture - Mark Richards

The Windows 11 Disaster That's Killing Microsoft

The Windows 11 Disaster That's Killing Microsoft

Где начало СХЕМЫ? Понимаем, читаем, изучаем схемы. Понятное объяснение!

Где начало СХЕМЫ? Понимаем, читаем, изучаем схемы. Понятное объяснение!

Snakes and Ladders LLD in Java | UML, Extensible Design & Code Explained

Snakes and Ladders LLD in Java | UML, Extensible Design & Code Explained

BookMyShow/MovieTicketBooking — Низкоуровневое проектирование | Серия интервью по программировани...

BookMyShow/MovieTicketBooking — Низкоуровневое проектирование | Серия интервью по программировани...

32. All Structural Design Patterns | Decorator, Proxy, Composite, Adapter, Bridge, Facade, FlyWeight

32. All Structural Design Patterns | Decorator, Proxy, Composite, Adapter, Bridge, Facade, FlyWeight

Микросервисы на практике - сервис продажи билетов

Микросервисы на практике - сервис продажи билетов

ООП На Простых Примерах | Объектно-Ориентированное Программирование

ООП На Простых Примерах | Объектно-Ориентированное Программирование

Low Level Design | The Code Mate

Low Level Design | The Code Mate

© 2025 dtub. Все права защищены.



  • Контакты
  • О нас
  • Политика конфиденциальности



Контакты для правообладателей: infodtube@gmail.com