📅Week-3 (Day 1) - 🍅 Let’s Build a Zomato-like Food Delivery App – Tomato! | System Design Explained with UML

Payal KumariPayal Kumari
5 min read

NOTE: - I started my 8-week system design journey with Coder Army. I will be journaling every day, recording what I learn, reflecting on it, and sharing it with my network to help newcomers to system design.

Hello developers, learners, and curious minds!
Welcome back to the #8WeeksLLDChallenge series. In Week 3, we’re taking a delicious dive 🍱 into designing a Zomato-like food delivery app — but ours is lovingly called Tomato! 😋

If you’ve ever ordered food online, this blog will hit differently — because this time, you’re the architect of the entire food delivery system.

💠 Functional Requirements — What Features Do We Need?

Let’s first break down the features that any food delivery app must have. Think like an interviewer sitting across the table asking:

💭 "Design a food delivery app — like Zomato or Swiggy."

Here's what we aim to support in our system:

1. Users can search for restaurants based on location

(Hindi: "User apne location ke hisaab se restaurants dekh sakta hai")

➡️ Imagine you're hungry at college hostel — open the app, and boom, nearby food joints show up.

2. Add food items to the cart

(Hindi: "User apne pasand ke khaane cart mein daal sakta hai")

➡️ Like adding Paneer Butter Masala and Butter Naan to your cart — that easy!

3. Checkout and Payment Flow

(Hindi: "User cart se checkout karke online payment kar sakta hai")

➡️ Use UPI, Card, or Wallet — Tomato app supports it all

4. Notification on Order Placement

(Hindi: "Order successful hone par user ko notify kiya jaata hai")

➡️ Just like Zomato says: "Your food is being prepared" — Tomato will tell you too

💠 Non-Functional Requirements — Let’s Make It Scalable & Modifiable

1. Scalability:

Can our app serve 1000 users a second across India?
Yes, if designed well!

  1. Modifiability:

Tomorrow if we want to add “Scheduled Orders” or “COD” (Cash on Delivery), can we do it easily?
Yes, with a modular & pattern-based design.

💠Bottom-Up vs Top-Down Approach

📍 Bottom-Up (Our Primary Approach):

We start small — design classes like Restaurant, Cart, Order, then connect them.
(Hindi: "Pehle chhoti chhoti cheezen banao, fir unko jodo")

➡️ Like Lego blocks — one by one, build your system.

📍 Top-Down (Sometimes Helpful):

We start big — think of major features first, then break them down into smaller classes.

➡️ Best for planning before coding

💠 Let’s Talk Design Patterns 🍕

We’re not just writing code; we’re architecting smart systems using design patterns! Here’s what we used in Tomato:

📍 Singleton Design Pattern

"Ensure only one instance of a class exists."
(Hindi: "Sirf ek object ban sake aur sab log use hi use karein")

🔄 Used for:
✅ Order Manager
✅ Restaurant Tracker

📍 Factory Pattern for Order Creation

Create different types of orders without changing client code.

(Hindi: "Factory decide kare kaunsa order banana hai — abhi ka ya scheduled")

📅 Example:

  • Instant(Now)Order: Deliver now

  • Scheduled Order: Deliver at 8 PM

📍 Strategy Pattern for Payments

Dynamically choose payment type at runtime.

(Hindi: "User jo bhi payment choose kare — UPI, Card, ya Wallet — sab support hai!")

📲 Example:

  • UPIPaymentStrategy

  • CardPaymentStrategy

  • WalletPaymentStrategy

📍 UML Diagram — From User to Delivery

This is where we and the interviewer sit together like partners in crime and think on the same page (literally )

Key Interfaces & Models:

interface Restaurant {
    List<MenuItem> getMenu();
}

interface PaymentStrategy {
    void pay(double amount);
}

class User {
    Cart cart;
    void searchRestaurant(String location);
}

class Cart {
    List<MenuItem> items;
    void addItem(MenuItem item);
    double calculateTotal();
}

Singleton Managers:

class OrderManager {
    private static OrderManager instance = null;
    private OrderManager() {}
    public static OrderManager getInstance() {
        if (instance == null) instance = new OrderManager();
        return instance;
    }
}

class RestaurantTracker {
    private static RestaurantTracker instance = null;
    // similar pattern as above
}

📍Notification Service 📲

After successful order → notify via email, SMS, or push notification.

(Hindi: "Order ke baad turant user ko khushi ki khabar milti hai!")

🧵 Putting It All Together — End-to-End Flow

  1. User searches 🍕

  2. Selects restaurant & items 🛒

  3. Adds to Cart 🧺

  4. Proceeds to Checkout 💳

  5. Payment using selected strategy ✅

  6. Factory creates Order (Now/Schedule) 🏭

  7. Singleton Manager tracks Order & Restaurant 📦

  8. Notification sent ✅

👉 "Tomato 🍅 app ban gaya!"

💠 Code: My GitHub Repo

🔗 GitHub: Tomato Code

📍Interview Tip: UML is our Best Friend

During LLD rounds — don't rush to code.
Draw, think, and co-design with the interviewer. 🤝🧠

"Code se zyada UML samjhaata hai!"
(UML diagrams often explain more than code itself.)

🗣️ “Interview ho ya real-life project — this LLD understanding is pure gold!”

Week - 3 (Day 1) Completed ✅ System Design

NOTE : - A big thanks to my mentors Rohit Negi Sir and Aditya Sir for launching this amazing 8-week course absolutely free on YouTube via CoderArmy9 :- youtube.com/@CoderArmy9 . 🙌

👉 Share this blog with your connections! Let’s keep learning, growing, and supporting one another on this journey. 🚀

✍️ Payal Kumari 👩‍💻 Github

Follow me : X

Jai Hind 🇮🇳 | #CoderArmy #LearningInPublic #SystemDesign #TechForAll #MentorshipMatters #8weeksLLdChallenge #LowLevelDesign #LLD

0
Subscribe to my newsletter

Read articles from Payal Kumari directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Payal Kumari
Payal Kumari

I'm a passionate full-stack developer with a strong foundation in the MERN stack—building and maintaining scalable web applications using React.js, Node.js, and Next.js. My journey in open source began with Hacktoberfest 2023, where I made four impactful pull requests that sparked a love for collaborative coding, global learning, and open knowledge sharing. Since then, I’ve contributed to and mentored projects in top open source programs like GSSoC’24, SSOC’24, and C4GT’24. As a Google Gen AI Exchange Hackathon ’24 Finalist and Google’s Women Techmakers (WTM) Ambassador, I’ve been privileged to support diverse communities in building meaningful tech solutions. My work as a Top 50 Mentor for GSSoC ’24 reflects my commitment to nurturing new talent in tech. Beyond development, I serve as a Student Career Guide, Profile Building Expert & Evangelist at Topmate.io, where I conduct workshops, guide students through resume building and career strategy, and help mentees navigate open source and tech careers. Recognized among the Top 5% of mentors and featured on “Topmate Discover,” I take pride in making mentorship accessible and impactful. My technical voice has also been acknowledged by LinkedIn, where I’ve earned the Top Voice badge seven times in domains like web development, programming, and software engineering. In addition, I hold LinkedIn Golden Badges for Research Skills, Interpersonal Skills, Critical Thinking, and Teamwork—signaling a well-rounded approach to both individual contribution and team collaboration. Graduating with an MCA from Chandigarh University in 2023, I’ve continued to fuel my curiosity by writing technical articles and sharing practical MERN stack insights across platforms. Whether it’s building polished UIs, optimizing backend performance, or guiding a mentee through their first pull request, I’m driven by the power of community and continuous learning. Let’s connect! I'm open to collaborations, mentorship, or building something impactful together. Reach out to me at kumaripayal7488@gmail.com or visit my profile on Topmate.io.