Software Design

Topics

  • OOPS
  • SOLID principles
  • Design Patterns
  • Class Diagram
  • Test cases
  • Thread safety
  • Mutability vs Immutability???
  • Examples:
    • Hotel Management System
    • Parking Lot
    • Elevator (hard to implement)
    • Tic tac toe
    • Chess
    • Snake and Ladders
    • ATM
    • Traffic Control System
    • Uber/Ola/Cab Booking
    • Swiggy/Zomato/Food Delivery
    • Pizza Billing System
    • Logging System
    • Bookmyshow/Fandango
    • File System/Onedrive/Google Drive
    • Splitwise/Expense Sharing

Important points

  • modular code, make classes in different files
  • use interfaces
  • exception handling and create custom exceptions
  • use design patterns and SOLID principles
  • generate UUID if needed

Flow of thinking

  • Identify the objects first
  • find Has-A and IS-A relationship
    • Composition (HAS-A) ◆━━━━━━ (B cannot exist without A)
    • Aggregation (HAS-A) ◇━━━━━━ (B can exist without A)
    • Inheritance (IS-A, generalization) ━━━extends━━━▷
  • favor composition over inheritance

LLD+Concurrency interview problems:

  • Design Movie Ticket Booking System
  • Design cache
  • Design Pub-Sub Model like Kafka
  • Design Rate Limiter

Problems

  • Easy
    • Parking Lot
    • Stack Overflow
    • Vending Machine
    • Logging Framework
    • Task Management
  • Medium
    • ATM
    • LinkedIn
    • LRU Cache
    • Tic Tac Toe
    • Pub/Sub
    • Elevator
    • Car Rental
    • Online Auction System
    • Hotel Management
    • Digital Wallet
    • Airline Management
    • Library Management
    • Social Network (Facebook)
    • Restaurant Management
    • Concert Booking
  • Hard
    • CricInfo
    • Splitwise
    • Chess
    • Snakes and Ladders
    • Ride Sharing (Uber)
    • Course Registration
    • Movie Ticket Booking System (Bookmyshow)
    • Online Shopping (Amazon)
    • Online Stock Brokerage
    • Music Streaming (Spotify)
    • Food Delivery (Swiggy)

Popular Examples

Chain of Responsibility Design Pattern

  • ATM/Vending Machine
  • Design Logger

Research papers to understand thinking