Lanos logo
Lanos Edtech50 min read1💬 0

1000 OOP Assignments in Java

Y
Yash Namdeo
Full-Stack Intern Lanos · 28 April 2026
Y
Yash Namdeo
Full-Stack Intern Lanos
Published 28 April 2026·50 min read

1000 OOP Assignments in Java

Metadata

Field Value
Topic Object-Oriented Programming in Java
Total Questions 1000
Levels Beginner, Intermediate, Advanced
Distribution 300 Beginner, 300 Intermediate, 400 Advanced
Goal Build deep practical OOP strength through disciplined problem solving
Note Advanced questions are intentionally ordered from lower advanced difficulty to highest advanced difficulty

How to Use This Sheet

  1. Solve Beginner in order if your base is weak.
  2. Solve Intermediate after you are comfortable with classes, objects, constructors, encapsulation, inheritance, abstraction, and interfaces.
  3. Solve Advanced strictly in order because the challenge is progressive.
  4. Write code by hand.
  5. Do not skip design questions. OOP skill is not only syntax.

Level 1: Beginner (300 Questions)

Classes, Objects, Fields, and Methods

  1. Create a Student class with name and age fields.
  2. Create two objects of Student and print their values.
  3. Add a method introduce() in Student that prints student details.
  4. Create a Car class with brand, model, and speed.
  5. Write a method showCarInfo() inside Car.
  6. Create three Car objects with different values.
  7. Create a Book class with title and price.
  8. Write a method in Book that prints whether the book is expensive if price > 500.
  9. Create a MobilePhone class with brand, ram, and storage.
  10. Write a method to display all phone details.
  11. Create an Employee class with id, name, and salary.
  12. Write a method to print yearly salary.
  13. Create a Dog class with name and breed.
  14. Add a method bark() that prints a sentence using the dog's name.
  15. Create a Movie class with title, rating, and language.
  16. Add a method to print whether the movie is family-friendly if rating is less than 13.
  17. Create a Laptop class with brand, price, and processor.
  18. Add a method to compare if the laptop price is above a given amount.
  19. Create a Rectangle class with length and width.
  20. Add methods area() and perimeter().
  21. Create a Circle class with radius.
  22. Add a method that returns the area of the circle.
  23. Create a Fan class with brand, speedLevel, and isOn.
  24. Add methods turnOn() and turnOff().
  25. Create a Pen class with color and price.
  26. Add a method to print whether the pen is premium if price is above 100.
  27. Create a BankCustomer class with customerId and name.
  28. Add a method to print a welcome message.
  29. Create a Bus class with number, route, and seats.
  30. Add a method to print whether seats are available if seats > 0.
  31. Create a Shirt class with size, color, and price.
  32. Add a method that prints discount eligibility if price is above 1000.
  33. Create a Speaker class with brand, volume, and isBluetooth.
  34. Add a method to increase volume by 1.
  35. Create a Keyboard class with type, isMechanical, and price.
  36. Add a method to print the keyboard category.
  37. Create a Bottle class with capacity and material.
  38. Add a method to print if the bottle is travel-friendly if capacity <= 1 liter.
  39. Create a Course class with courseName and duration.
  40. Add a method to print course summary.
  41. Create a Train class with trainNumber, source, and destination.
  42. Add a method printRoute().
  43. Create a Song class with title, artist, and duration.
  44. Add a method to print whether the song is short if duration < 3 minutes.
  45. Create a Watch class with brand, type, and price.
  46. Add a method to print whether the watch is digital or analog.
  47. Create a Light class with isOn and watt.
  48. Add methods switchOn() and switchOff().
  49. Create a Mouse class with dpi, wireless, and brand.
  50. Add a method to print mouse category.

Constructors

  1. Create a Student class with a default constructor.
  2. Print a message from inside the default constructor of Student.
  3. Create a parameterized constructor for Student with name and age.
  4. Create an object using the parameterized constructor and print values.
  5. Create a Book class with both default and parameterized constructors.
  6. Use constructor overloading in a MobilePhone class.
  7. Create a Car constructor that sets default speed to 0.
  8. Create a Rectangle constructor that receives length and width.
  9. Write a constructor that validates price cannot be negative.
  10. Create a Fan constructor that sets isOn to false by default.
  11. Add a constructor to Employee that receives all fields.
  12. Add a constructor to Movie that only receives title.
  13. Add a constructor to Movie that receives title and rating.
  14. Use this() constructor chaining in a Product class.
  15. Create a Laptop class with three overloaded constructors.
  16. Write a BankAccount constructor that sets balance to 0 if negative.
  17. Create a Course constructor that stores course name and duration.
  18. Add constructor chaining to a Circle class.
  19. Create a Shirt class with constructors for different levels of initialization.
  20. Add a constructor to Dog that prints the breed during creation.
  21. Create a Pen class where price defaults to 10 if not passed.
  22. Create a Bus class with constructor overloading for local and express buses.
  23. Create a Speaker class with one constructor for wired and one for wireless.
  24. Create a Bottle class that uses constructor chaining.
  25. Create a Keyboard class and initialize all fields using constructor.
  26. Create a Watch class with a constructor that rejects negative price.
  27. Write a Light constructor that stores watt and default off state.
  28. Create a Mouse constructor that takes only brand and defaults other fields.
  29. Create a Song constructor that accepts title and artist only.
  30. Create a Train constructor that prints source and destination.
  31. Create a Student constructor that sets default grade to A.
  32. Create an Employee constructor that auto-initializes salary to 10000 if omitted.
  33. Create a Course constructor that validates duration > 0.
  34. Create a BankCustomer constructor and print object state through a method.
  35. Create a Movie constructor that rejects invalid rating.
  36. Create a Rectangle class with constructor overloading for square and rectangle.
  37. Create a Circle constructor that accepts integer radius and stores it as double.
  38. Create a Book constructor that sets title to Unknown when null.
  39. Create a Car constructor that increments a static object counter.
  40. Create a Laptop constructor that initializes an object and prints a success message.
  41. Write a Fan constructor that validates speed level range.
  42. Create a Course constructor using this for field assignment.
  43. Create a MobilePhone constructor using constructor chaining for common defaults.
  44. Create a Bottle constructor that supports two capacities.
  45. Create a Bus constructor that sets seats to 40 if not passed.
  46. Create a Speaker class where one constructor calls another with default volume.
  47. Create an Employee constructor that stores name in uppercase.
  48. Create a Student constructor that prevents negative age.
  49. Create a Train constructor that stores route code.
  50. Create a Watch constructor that prints whether the object is premium during creation.

this, Instance State, and Validation

  1. Create a Student constructor that uses this.name = name.
  2. Create a Product class where field and parameter names are same, then resolve using this.
  3. Create a Book class with this() constructor chaining.
  4. Create a BankAccount class with this.balance.
  5. Create a Car method setSpeed(int speed) and use this.speed.
  6. Create a Laptop class and return this from a method.
  7. Create a Rectangle class with method chaining for setting length and width.
  8. Create a Circle method increaseRadius(double value) and use this.
  9. Create a Dog method rename(String name) using this.
  10. Create a MobilePhone method that returns current object after setting storage.
  11. Create a Fan method to set speed level and return this.
  12. Create a Watch method to update price only if positive.
  13. Create a Speaker method to update volume only if between 0 and 100.
  14. Create a Student method that prevents age from exceeding 100.
  15. Create a BankAccount method deposit(double amount) with validation.
  16. Create a BankAccount method withdraw(double amount) with validation.
  17. Create a Pen method to update price only if positive.
  18. Create a Bottle method to update capacity only if valid.
  19. Create an Employee method to raise salary by a positive percentage.
  20. Create a Movie method to update rating only if between 0 and 10.
  21. Create a Bus method to reserve one seat if available.
  22. Create a Train method to change destination and return this.
  23. Create a Course method to extend duration by a given number of days.
  24. Create a Keyboard method to mark keyboard as mechanical.
  25. Create a Mouse method to change DPI safely.
  26. Create a Light method toggle() using current object state.
  27. Create a Song method to rename song using this.
  28. Create a Car method to accelerate by given amount.
  29. Create a Car method to brake without letting speed go below 0.
  30. Create a Student method to print current object hash code.
  31. Create a Product method that compares price of current object with another product.
  32. Create a Rectangle method that compares area with another rectangle.
  33. Create a Circle method that returns true if current circle is larger than another.
  34. Create a Dog method that copies breed from another dog.
  35. Create a Book method that copies price from another book.
  36. Create a Laptop method to upgrade RAM by given GB.
  37. Create an Employee method to reset salary to base value.
  38. Create a Speaker method to mute and return current object.
  39. Create a Watch method that doubles price only if luxury flag is true.
  40. Create a MobilePhone method to combine storage upgrade and RAM upgrade.
  41. Create a Student method to update both name and age.
  42. Create a Train method to swap source and destination.
  43. Create a Bottle method to mark bottle as reusable.
  44. Create a Bus method to refill seat count for next trip.
  45. Create a Movie method to reset rating.
  46. Create a Light method that changes watt value only if above 0.
  47. Create a Pen method that marks pen as out of stock.
  48. Create a Course method to mark course completed.
  49. Create a BankCustomer method to update mobile number with validation.
  50. Create a Keyboard method that returns this for chained configuration.

Encapsulation and Access Modifiers

  1. Create a BankAccount class with private balance.
  2. Add a public getter for balance.
  3. Add a public deposit method for BankAccount.
  4. Prevent direct access to balance from main.
  5. Create a User class with private password.
  6. Add a setter that stores password only if length >= 8.
  7. Add a getter for username but not for password.
  8. Create an Employee class with private salary.
  9. Add a public method showSalary() instead of direct getter.
  10. Create a Student class with private marks.
  11. Add a method that updates marks only if between 0 and 100.
  12. Create a Movie class with private rating.
  13. Add getter and validated setter for rating.
  14. Create a Car class with private speed.
  15. Add methods accelerate() and brake() instead of exposing speed setter.
  16. Create a Circle class with private radius.
  17. Add a constructor and getter for radius.
  18. Prevent negative radius through constructor validation.
  19. Create a Product class with private price.
  20. Add a method to apply percentage discount.
  21. Create a Fan class with private speedLevel.
  22. Add methods to increase and decrease speed safely.
  23. Create a BankCustomer class with private customerId and no setter.
  24. Explain in code why customerId should not be changeable.
  25. Create a Light class with private isOn.
  26. Expose only switchOn, switchOff, and isLightOn.
  27. Create a Bottle class with private capacity.
  28. Add a setter that accepts only positive values.
  29. Create a Course class with private courseName.
  30. Add public method to rename course if non-empty.
  31. Create a Bus class with private seats.
  32. Add a method to decrement seat count when booking.
  33. Create a Train class with private routeCode.
  34. Add getter but no setter for route code.
  35. Create a Watch class with private price.
  36. Add method to apply tax and return final price.
  37. Create a Speaker class with private volume.
  38. Expose only safe methods for volume control.
  39. Create a Laptop class with private ram.
  40. Add method upgradeRam(int extra).
  41. Create a Mouse class with private dpi.
  42. Add a getter and validated setter.
  43. Create a Keyboard class with private isMechanical.
  44. Add a getter named isMechanical().
  45. Create a Pen class with private stock.
  46. Add method to reduce stock on sale.
  47. Create a Song class with private duration.
  48. Add a getter and a method to extend duration for remix.
  49. Create a Book class with private title.
  50. Add method to print uppercase title.

Static Members

  1. Create a Car class with static field totalCars.
  2. Increment totalCars every time an object is created.
  3. Print total objects created after making three Car objects.
  4. Create a Student class with static field schoolName.
  5. Print the same schoolName from two student objects.
  6. Change schoolName once and show the effect on all objects.
  7. Create a Book class with static method libraryPolicy().
  8. Call static method using class name.
  9. Create an Employee class with static field companyName.
  10. Create a static method changeCompanyName.
  11. Create a BankAccount class with static interest rate.
  12. Print simple interest using static rate and instance balance.
  13. Create a Circle class with static method piValue().
  14. Create a Product class with static tax rate.
  15. Create a Fan class with static field counting running fans.
  16. Increment and decrement static count when turning fan on or off.
  17. Create a Train class with static field transportType = "Rail".
  18. Create a Bus class with static field transportType = "Road".
  19. Create a Laptop class with static field warrantyYears.
  20. Update warranty years and show change across objects.
  21. Create a Speaker class with static constant MAX_VOLUME.
  22. Use MAX_VOLUME in volume validation.
  23. Create a Watch class with static field brandCount.
  24. Create a static method to print number of created watches.
  25. Create a Mouse class with static utility method isGamingDpi(int dpi).
  26. Create a Keyboard class with static method to compare two prices.
  27. Create a Bottle class with static method converting liters to milliliters.
  28. Create a Course class with static field platformName.
  29. Create a Movie class with static method to validate rating.
  30. Create a Pen class with static field manufacturer.
  31. Create a Song class with static method to convert minutes to seconds.
  32. Create a Student class with both static and instance fields and print both.
  33. Create an Employee class with static initialization of company policy text.
  34. Create a BankCustomer class with static method to validate phone number length.
  35. Create a Car class with static method compareBrands(Car a, Car b).
  36. Create a Bus class with static fare rate per km.
  37. Create a Train class with static field for current fiscal year.
  38. Create a Course class with static counter for total enrollments.
  39. Create a Book class with static discount rate for all books.
  40. Create a Laptop class with static method to print common configuration tips.
  41. Create a MobilePhone class with static method to format IMEI.
  42. Create a Circle class with static method to create a unit circle.
  43. Create a Rectangle class with static helper to make square.
  44. Create a Fan class with static method to validate speed level.
  45. Create a Light class with static unit conversion for watts to kilowatts.
  46. Create a Speaker class with static method to test if volume is safe.
  47. Create a Watch class with static method to compare two models.
  48. Create a Mouse class with static field for default DPI.
  49. Create a Keyboard class with static field for default key count.
  50. Create a Pen class with static factory-like method returning a blue pen.

Inheritance Basics

  1. Create a parent class Animal and child class Dog.
  2. Add eat() in Animal and bark() in Dog.
  3. Create an object of Dog and call both methods.
  4. Create parent Vehicle and child Car.
  5. Add start() in Vehicle and openTrunk() in Car.
  6. Create parent Person and child Student.
  7. Add common fields in Person and student-specific field in Student.
  8. Create parent Employee and child Manager.
  9. Add common method work() in Employee.
  10. Add specific method conductMeeting() in Manager.
  11. Create parent Shape and child Rectangle.
  12. Add parent displayType() and child-specific area().
  13. Create parent Appliance and child Fan.
  14. Add turnOn() in parent and changeSpeed() in child.
  15. Create parent Account and child SavingsAccount.
  16. Add balance field in parent and interestRate in child.
  17. Create parent Book and child TextBook.
  18. Add subject field in child.
  19. Create parent Mobile and child SmartPhone.
  20. Add internet-specific method in child.
  21. Create parent Employee and child Developer.
  22. Add coding hours field in Developer.
  23. Create parent Furniture and child Chair.
  24. Add fold feature in child.
  25. Create parent Machine and child Printer.
  26. Add printDocument() in child.
  27. Create parent Payment and child CardPayment.
  28. Add parent field amount and child field cardNumber.
  29. Create parent Animal and child Cat.
  30. Add meow() in child.
  31. Create parent Device and child Laptop.
  32. Add compileCode() in child.
  33. Create parent Shape and child Circle.
  34. Create parent User and child Admin.
  35. Add manageUsers() in Admin.
  36. Create parent Transport and child Bus.
  37. Add openDoor() in child.
  38. Create parent Worker and child Teacher.
  39. Add teach() in child.
  40. Create parent Account and child CurrentAccount.
  41. Add transaction charge field in child.
  42. Create parent Media and child Song.
  43. Add singer field in child.
  44. Create parent Course and child ProgrammingCourse.
  45. Add language field in child.
  46. Create parent Game and child Chess.
  47. Add movePiece() in child.
  48. Create parent Building and child School.
  49. Add conductAssembly() in child.
  50. Create parent FoodItem and child Pizza.

Level 2: Intermediate (300 Questions)

Inheritance, super, Overriding, and Runtime Behavior

  1. Create Animal and Dog, then use super to initialize parent fields.
  2. Create Vehicle and Car, then call parent constructor with super.
  3. Override a method sound() in child class Dog.
  4. Override a method start() in child class Car.
  5. Create Employee and Developer, override calculateSalary().
  6. Create Shape hierarchy and override area() in each child.
  7. Create Account and SavingsAccount, override showAccountType().
  8. Create Book and TextBook, override displayInfo().
  9. Create Payment and CardPayment, override process().
  10. Create Mobile and SmartPhone, override showSpecs().
  11. Create Media and Song, override play().
  12. Create Furniture and Chair, override showMaterial().
  13. Create Game and Chess, override startGame().
  14. Create Appliance and Fan, override powerConsumption().
  15. Create Worker and Teacher, override work().
  16. Create User and Admin, override login().
  17. Create Transport and Bus, override showFare().
  18. Create Course and ProgrammingCourse, override showSyllabus().
  19. Create Building and School, override showPurpose().
  20. Create FoodItem and Pizza, override prepare().
  21. Create parent Message and child EmailMessage, override send().
  22. Create parent Discount and child FestivalDiscount, override apply().
  23. Create parent Sensor and child TemperatureSensor, override readValue().
  24. Create parent Report and child PdfReport, override generate().
  25. Create parent Player and child CricketPlayer, override play().
  26. Create parent Subscription and child PremiumSubscription, override price().
  27. Create parent Question and child MCQQuestion, override display().
  28. Create parent Room and child ClassRoom, override showUsage().
  29. Create parent HospitalStaff and child Doctor, override performDuty().
  30. Create parent Machine and child WashingMachine, override operate().
  31. Create Animal a = new Dog() and call overridden method.
  32. Create Vehicle v = new Car() and call overridden start().
  33. Store a Developer object in Employee reference and call calculateSalary().
  34. Demonstrate runtime polymorphism using Shape array.
  35. Demonstrate runtime polymorphism using Payment array.
  36. Create a loop over Animal[] containing Dog and Cat objects.
  37. Show that fields are not polymorphic but methods are.
  38. Override method and call parent version using super.methodName().
  39. Create child method that extends parent behavior instead of replacing it completely.
  40. Override toString() in a child class.

Encapsulation, Class Design, and Validation

  1. Design a BankAccount with private state and strict withdraw validation.
  2. Design a Student class where marks update must stay within 0 to 100.
  3. Design a Product class where price cannot be negative.
  4. Design an Employee class where ID is immutable after object creation.
  5. Design a Movie class where rating can change but title cannot.
  6. Design a Rectangle class where dimensions must always remain positive.
  7. Design a Circle class with controlled radius growth only.
  8. Design a User class where password is write-only and validated.
  9. Design a Course class where completed course cannot reduce duration.
  10. Design a Bus class where booked seats cannot exceed total seats.
  11. Design a TrainTicket class where cancellation is blocked after travel date.
  12. Design a Laptop class where RAM can only be upgraded, not downgraded.
  13. Design a MobilePhone class where IMEI cannot change after construction.
  14. Design a Book class where ISBN is read-only.
  15. Design a Speaker class where volume range is 0 to 100.
  16. Design a Watch class where price update logs old and new values.
  17. Design a Mouse class with validated DPI range.
  18. Design a Keyboard class where key count cannot be less than 60.
  19. Design a Pen class with stock that cannot go below zero.
  20. Design a Bottle class where capacity must be in milliliters and positive.
  21. Design an Order class with private status and controlled transitions.
  22. Design a Task class with restricted priority values.
  23. Design an Invoice class with immutable invoice number.
  24. Design a Customer class with controlled email updates.
  25. Design a Flight class where seats and fare are validated.
  26. Design a LibraryMember class where membership status is internally controlled.
  27. Design a Reservation class where confirmation only happens once.
  28. Design a Wallet class with deposit and spend rules.
  29. Design a Quiz class where marks are recalculated through methods only.
  30. Design a Loan class where interest cannot be negative.

Abstract Classes and Interfaces

  1. Create an abstract class Shape with abstract method area().
  2. Implement Circle and Rectangle using abstract Shape.
  3. Create an abstract class Payment with abstract processPayment().
  4. Implement CardPayment and UpiPayment from Payment.
  5. Create an interface NotificationSender with method send.
  6. Implement EmailSender and SmsSender.
  7. Create an interface Playable and implement it in Song.
  8. Create an interface Flyable and implement it in Bird.
  9. Create an abstract class Employee and derive Developer and Manager.
  10. Create abstract class Appliance with common field brand.
  11. Implement Fan and WashingMachine from abstract Appliance.
  12. Create an interface DiscountStrategy with applyDiscount.
  13. Implement NoDiscount, StudentDiscount, and FestivalDiscount.
  14. Create an abstract class Report with method generate.
  15. Implement PdfReport and ExcelReport.
  16. Create an interface Logger and implement ConsoleLogger.
  17. Implement FileLogger for same Logger interface.
  18. Create an abstract class Vehicle with abstract fuelType.
  19. Implement PetrolCar and ElectricCar.
  20. Create an interface Searchable and implement it in BookCatalog.
  21. Create an abstract class Account with abstract calculateInterest.
  22. Implement SavingsAccount and FixedDepositAccount.
  23. Create an interface Taxable and implement it in Product.
  24. Create an abstract class GameCharacter with abstract attack.
  25. Implement Warrior and Mage.
  26. Create an interface Exportable and implement in CsvExporter.
  27. Implement JsonExporter for same Exportable interface.
  28. Create an abstract class Message with concrete validateRecipient.
  29. Implement EmailMessage and SmsMessage.
  30. Create an interface AuthenticationProvider and implement two providers.
  31. Create abstract class ExamQuestion and subclasses for text and code questions.
  32. Create an interface Cache and implement MemoryCache.
  33. Create RedisCache class for same Cache interface.
  34. Create abstract class Notification with abstract deliver.
  35. Create interface Payable and make multiple unrelated classes implement it.
  36. Create a class implementing two interfaces.
  37. Create an interface with default method and override it in implementation.
  38. Create an interface with static utility method and call it via interface name.
  39. Compare abstract class and interface in one mini-system.
  40. Create a Device abstraction and model behavior using both abstract class and interface.

Composition and Object Collaboration

  1. Create a Car class that contains an Engine object.
  2. Create a Computer class that contains Keyboard and Monitor.
  3. Create a Library class that contains multiple Book objects.
  4. Create a School class that contains multiple Student objects.
  5. Create an Order class that contains multiple Product objects.
  6. Create a Playlist class that contains multiple Song objects.
  7. Create a Team class that contains multiple Player objects.
  8. Create a Wallet class that contains multiple Transaction objects.
  9. Create a Course class that contains multiple Lesson objects.
  10. Create a Hospital class that contains multiple Doctor objects.
  11. Create a Department class that holds employees and prints headcount.
  12. Create a Company class containing departments and employees.
  13. Create a Cart class with methods to add and remove products.
  14. Create a ReportService that uses a Logger.
  15. Create an OrderService that uses a NotificationSender.
  16. Create a PaymentService that uses a PaymentGateway.
  17. Create a StudentService that uses a StudentRepository.
  18. Create a TicketService that uses a PricingStrategy.
  19. Create a VideoPlayer that uses a SubtitleRenderer.
  20. Create a RestaurantOrder that uses a BillCalculator.
  21. Create a UserProfile that contains an Address value object.
  22. Create a TravelPlan that contains multiple CityStop objects.
  23. Create a ChessGame class that contains Board and Player objects.
  24. Create a CabTrip that contains Driver, Rider, and FarePolicy.
  25. Create a FoodDeliveryOrder that uses a DeliveryPartner.
  26. Create a BlogPost that contains multiple Comment objects.
  27. Create a ChatRoom that contains many Message objects.
  28. Create a MovieTicketBooking that uses SeatAllocator.
  29. Create a ParkingLot that contains ParkingSlot objects.
  30. Create a Bank class that manages many BankAccount objects.

Method Overloading, Overriding, and Object Utility Methods

  1. Overload add() for two integers and three integers.
  2. Overload add() for int and double.
  3. Overload printDetails() with different parameters.
  4. Overload calculateArea() for square and rectangle.
  5. Overload login() with username-password and mobile-OTP.
  6. Overload setData() for different field combinations.
  7. Overload constructor and also overload a behavior method in same class.
  8. Override toString() in Student.
  9. Override equals() in Student based on ID.
  10. Override hashCode() consistently with equals().
  11. Override toString() in Product and print object directly.
  12. Override equals() in Book based on ISBN.
  13. Override toString() in BankAccount.
  14. Override toString() in Employee hierarchy and print polymorphically.
  15. Override a method and call super before child logic.
  16. Override a method and call super after child logic.
  17. Create overloaded pay() methods with different signatures.
  18. Create overloaded search() methods for id and name.
  19. Create overloaded notifyUser() methods for email and SMS text.
  20. Create overloaded bookSeat() methods for one seat and many seats.
  21. Create overloaded deposit() methods for int and double.
  22. Create overloaded withdraw() methods with and without remarks.
  23. Create a class where overloading would cause ambiguity and resolve it.
  24. Show invalid overloading by changing only return type and explain why.
  25. Create parent-child classes and override display() correctly.
  26. Create parent-child classes and intentionally break override using different parameters.
  27. Use @Override annotation to catch override mistakes.
  28. Create a class with overloaded build() methods returning different configured objects.
  29. Create a child class that overrides calculate() and narrows behavior correctly.
  30. Create utility class demonstrating toString, equals, and hashCode together.

Scenario-Based Intermediate Assignments

  1. Design a LibraryBook system with borrow and return methods.
  2. Design a BusPass system with validity and renewal behavior.
  3. Design a StudentReportCard with subject marks and grade methods.
  4. Design a FoodOrder with item count and billing logic.
  5. Design a ShoppingCart with add, remove, and total methods.
  6. Design an ATM model with withdraw, deposit, and balance inquiry.
  7. Design a MovieBooking object with seat confirmation logic.
  8. Design a FlightTicket model with cancel and reschedule rules.
  9. Design a HotelRoom booking model with availability updates.
  10. Design a GymMembership class with active and expired states.
  11. Design a VehicleInsurance class with premium calculation.
  12. Design a LoanApplication class with approval eligibility logic.
  13. Design a QuizAppQuestion hierarchy with text and MCQ questions.
  14. Design a RestaurantTableBooking class with reservation status changes.
  15. Design a CourierPackage class with tracking status and fee.
  16. Design a RideBooking model with fare and trip status.
  17. Design a CinemaSeat class with lock and book actions.
  18. Design a WarehouseItem with stock and reorder threshold.
  19. Design a LibraryMember class with fine calculation.
  20. Design an ECommerceProductReview class with rating validation.
  21. Design a ClassroomAttendance class with present and absent counters.
  22. Design a TournamentTeam class with wins, losses, and points.
  23. Design a MusicPlaylist class with play next and remove song behavior.
  24. Design a TaskManagerItem with state transitions.
  25. Design a PrinterQueueJob model with queued, printing, and done states.
  26. Design a TrainReservation class with RAC and waiting list states.
  27. Design an InventoryMovement class with incoming and outgoing stock.
  28. Design a FoodCoupon system using discount strategy objects.
  29. Design a DocumentApproval workflow using status checks.
  30. Design a CustomerSupportTicket with escalation behavior.
  31. Design a BlogPost and Comment model with ownership rules.
  32. Design a ParkingTicket system with time-based billing.
  33. Design a CabDriver payout model with per-trip earnings.
  34. Design a Medicine class with expiry-date validation.
  35. Design a HospitalAppointment class with scheduling logic.
  36. Design a MealPlan class with calorie calculations.
  37. Design a ShoppingCoupon hierarchy with fixed and percentage discounts.
  38. Design a NotificationCenter that supports multiple senders.
  39. Design a UserSession class with login, logout, and timeout.
  40. Design a TaxCalculator strategy-based system.

Mini Projects and Refactoring Questions

  1. Refactor a student record program with raw variables into a Student class.
  2. Refactor a product billing program into Product and Bill classes.
  3. Refactor a banking script into encapsulated BankAccount.
  4. Refactor a marks calculator into Student, Subject, and ReportCard.
  5. Refactor a ticket booking script using classes and methods.
  6. Refactor a restaurant bill calculator using object collaboration.
  7. Refactor a print-all-in-main program into multiple classes.
  8. Refactor a repeated-discount code block into discount strategy classes.
  9. Refactor a large if-else payment selection into polymorphism.
  10. Refactor duplicated Dog and Cat code into inheritance.
  11. Refactor a Vehicle hierarchy that wrongly duplicates speed code.
  12. Refactor a public-field Employee design into encapsulated design.
  13. Refactor a class with too many setters into safer design.
  14. Refactor a class with mixed responsibilities into two cohesive classes.
  15. Refactor a GodService that handles orders, payment, and notifications.
  16. Refactor a loyalty discount logic into an interface-based solution.
  17. Refactor a file export utility into separate exporter classes.
  18. Refactor a system that uses instanceof everywhere into polymorphism.
  19. Refactor an immutable value object that currently has setters.
  20. Refactor an inheritance design that should really use composition.
  21. Refactor a chat app model where message sending is hardcoded.
  22. Refactor a report generator to support PDF and CSV exporters.
  23. Refactor a login system to support multiple authentication providers.
  24. Refactor a direct-email dependency into interface-based notification.
  25. Refactor a shopping cart to use CartItem objects instead of parallel arrays.
  26. Refactor an exam system where all question types live in one huge class.
  27. Refactor a game character class into parent and specialized child classes.
  28. Refactor a device system to avoid repeated validation logic.
  29. Refactor an invoice model to introduce a value object for money.
  30. Refactor a library management model to protect book status changes.

Progressive Intermediate Challenge Set

  1. Build a LibrarySystem with books, members, and issue logic.
  2. Extend the LibrarySystem with fine calculation.
  3. Extend the LibrarySystem with separate item types: book, magazine, journal.
  4. Build an OrderSystem with products and order total.
  5. Extend the OrderSystem with discount strategies.
  6. Extend the OrderSystem with notification sending.
  7. Build an EmployeePayroll hierarchy with salary overrides.
  8. Extend EmployeePayroll with bonus policies.
  9. Extend EmployeePayroll with tax calculation abstraction.
  10. Build a ParkingLot with slots and parked vehicles.
  11. Extend ParkingLot with different vehicle types.
  12. Extend ParkingLot with ticket calculation rules.
  13. Build a QuizSystem with multiple question types.
  14. Extend QuizSystem with scoring strategies.
  15. Extend QuizSystem with report export support.
  16. Build a FoodDelivery model with restaurant, menu item, and order.
  17. Extend FoodDelivery with coupon strategy support.
  18. Extend FoodDelivery with delivery-partner assignment.
  19. Build a HospitalManagement mini-model with doctor, patient, appointment.
  20. Extend it with billing logic.
  21. Extend it with notification reminders.
  22. Build a RideBooking model with rider, driver, and trip.
  23. Extend it with fare strategies.
  24. Extend it with trip cancellation policies.
  25. Build a SchoolSystem with student, teacher, classroom.
  26. Extend it with attendance tracking.
  27. Extend it with exam result generation.
  28. Build a MovieBookingSystem with seat, screen, show.
  29. Extend it with payment abstraction.
  30. Extend it with ticket cancellation rules.
  31. Build a WarehouseSystem with items and stock changes.
  32. Extend it with supplier tracking.
  33. Extend it with reorder alert logic.
  34. Build a GymManagement system with member, plan, trainer.
  35. Extend it with attendance log objects.
  36. Extend it with plan-upgrade rules.
  37. Build a MusicApp model with playlist and song objects.
  38. Extend it with shuffle logic.
  39. Extend it with favorite song tracking.
  40. Build an ATMSystem with account operations and transaction history.
  41. Extend it with transaction type hierarchy.
  42. Extend it with receipt generation.
  43. Build an InsurancePolicy model.
  44. Extend it with policy type hierarchy.
  45. Extend it with claim processing abstraction.
  46. Build a TravelBooking model with traveler, ticket, hotel.
  47. Extend it with cancellation rules.
  48. Extend it with invoice generation.
  49. Build an ECommerceReview system.
  50. Extend it with moderation workflow.
  51. Extend it with report abuse behavior.
  52. Build a DocumentWorkflow model.
  53. Extend it with approval roles.
  54. Extend it with notification channels.
  55. Build a CabFleet system with vehicles and availability.
  56. Extend it with driver rating logic.
  57. Extend it with maintenance status support.
  58. Build a RestaurantBilling system.
  59. Extend it with tax and discount policies.
  60. Extend it with multiple payment modes.

Level 3: Advanced (400 Questions)

Important Note for Advanced Level

Questions 601 to 1000 are intentionally ordered from lower advanced difficulty to highest advanced difficulty. Do not solve them randomly if your goal is real growth.

Advanced Stage 1: Strong OOP Implementation and Design Reasoning (601-700)

  1. Design a Money value object that is immutable and supports safe addition only for same currency.
  2. Add subtraction support to Money while preventing negative results when business rule disallows it.
  3. Add comparison methods to Money and define logical equality correctly.
  4. Override equals, hashCode, and toString for Money.
  5. Design an immutable EmailAddress value object that validates format at construction time.
  6. Design an immutable DateRange object that rejects invalid start-end order.
  7. Add overlap detection to DateRange.
  8. Add containment checks to DateRange.
  9. Design a Percentage value object that only allows 0 to 100.
  10. Use Percentage inside a discount system instead of raw doubles.
  11. Design a UserId value object and replace raw String IDs in a user model.
  12. Design an immutable Address object and embed it inside Customer.
  13. Design a mutable ShoppingCart that only accepts valid CartItem objects.
  14. Prevent duplicate product entries in ShoppingCart by merging quantities.
  15. Add total price calculation to ShoppingCart.
  16. Add remove and decrement behaviors to ShoppingCart.
  17. Introduce a PricingPolicy abstraction into ShoppingCart.
  18. Add coupon application without modifying core cart logic directly.
  19. Design CartItem so quantity can never become zero or negative.
  20. Design a ProductCatalog class that exposes safe lookup operations but not internal storage directly.
  21. Design a StudentRegistry that prevents duplicate roll numbers.
  22. Add update behavior to StudentRegistry without exposing raw collection state.
  23. Design an ExamResult object that computes grade lazily or eagerly and justify your choice.
  24. Design a TransactionHistory class that records deposits and withdrawals as separate objects.
  25. Add a rule that every transaction must carry timestamp and type.
  26. Design a BankStatement report object from TransactionHistory.
  27. Separate bank domain entities from report-generation concerns.
  28. Design a PasswordPolicy abstraction and inject it into UserRegistrationService.
  29. Implement two password policies and switch them without changing registration flow.
  30. Design a LoginAttemptTracker with locked-state rules.
  31. Prevent state corruption in LoginAttemptTracker under repeated failed attempts.
  32. Design a CourseEnrollment object linking student and course with enrollment status.
  33. Add state transitions such as enrolled, completed, dropped, and rejected.
  34. Ensure invalid transitions are blocked.
  35. Design a RoomBooking model that rejects overlapping bookings.
  36. Separate booking validation from persistence concerns.
  37. Design a SeatAllocator abstraction for theater booking.
  38. Implement two seat-allocation strategies and switch them polymorphically.
  39. Design a TaxPolicy abstraction for products of different categories.
  40. Add country-specific tax calculation without rewriting product model.
  41. Design a ShippingChargePolicy abstraction.
  42. Combine TaxPolicy and ShippingChargePolicy in a checkout flow.
  43. Design a Bill object that keeps line items immutable after generation.
  44. Prevent recalculation bugs by freezing bill totals after confirmation.
  45. Design a RefundRequest lifecycle model.
  46. Add approval and rejection transitions to RefundRequest.
  47. Design a SupportTicket model that tracks assignment and escalation cleanly.
  48. Add comments to SupportTicket using composition.
  49. Separate comment author identity from comment content through value objects.
  50. Design a RideFareCalculator abstraction with multiple pricing modes.
  51. Add surge pricing without modifying core ride entity.
  52. Add coupon support on top of fare calculation.
  53. Design a SubscriptionPlan hierarchy and explain where inheritance is justified.
  54. Replace an incorrect SubscriptionPlan inheritance design with composition.
  55. Design a NotificationTemplate system with different renderers.
  56. Create renderer abstraction for email, SMS, and push formatting.
  57. Prevent channel-specific logic from leaking into template model.
  58. Design a PaymentReceipt object with immutable state.
  59. Add a ReceiptFormatter abstraction and multiple implementations.
  60. Design an AuditLog class that is append-only.
  61. Prevent edits to historical log entries.
  62. Design a FeatureFlag object that supports controlled evaluation.
  63. Separate flag evaluation rules from flag storage.
  64. Design a LibraryLoan object that tracks due date and renewal rules.
  65. Prevent renewal after max renewal count.
  66. Design a PenaltyPolicy abstraction for overdue items.
  67. Add different penalties for book, DVD, and journal loans.
  68. Design a VehicleAssignment model linking driver and cab.
  69. Prevent assigning one active cab to multiple drivers at once.
  70. Design a BatchProcessor that applies a common interface to many tasks.
  71. Add result aggregation while keeping task interface small.
  72. Design an ImportJob state machine with pending, running, failed, completed.
  73. Prevent illegal state transitions in ImportJob.
  74. Design a DocumentVersion model with immutable revisions.
  75. Add a Document aggregate that owns versions safely.
  76. Design a Leaderboard object that maintains top scores.
  77. Prevent direct score tampering by exposing only update methods.
  78. Design a StudentAttendancePolicy abstraction.
  79. Implement strict and relaxed attendance policies.
  80. Design a FeeCalculator using strategy objects.
  81. Add scholarship policy composition to FeeCalculator.
  82. Design a PromoCode domain model with expiration and usage rules.
  83. Prevent reusing single-use promo codes.
  84. Design a ParkingSession with entry time, exit time, and fee calculation.
  85. Separate fee calculation from parking session entity.
  86. Design a ReservationStatus model that avoids stringly typed code.
  87. Replace raw status strings with enum-based or object-based modeling.
  88. Design a QuestionBank class that groups question objects by topic.
  89. Add polymorphic question evaluation without giant if-else chains.
  90. Design a ChatMessage hierarchy and justify what should be common parent state.
  91. Prevent a ChatRoom from exposing internal mutable message storage.
  92. Design an InvoiceNumberGenerator with uniqueness guarantee at object level.
  93. Separate identifier generation from invoice behavior.
  94. Design an InventoryReservation object.
  95. Prevent selling inventory already reserved by another order.
  96. Design a GradePolicy abstraction.
  97. Implement grade calculation by marks, percentile, and relative ranking.
  98. Design a TranslationService abstraction with swappable providers.
  99. Build a small cohesive model around Order, OrderLine, and Money.
  100. Refactor that small order model to improve immutability and responsibility boundaries.

Advanced Stage 2: Polymorphism, Interfaces, and Behavior-Centric Design (701-800)

  1. Design a report-export system where adding a new format requires zero changes to existing exporters.
  2. Add PDF, CSV, and JSON exporters using interface-based design.
  3. Introduce a common export coordinator that depends only on abstraction.
  4. Design a command-processing system where each command is its own object.
  5. Add undo capability to the command system.
  6. Separate command validation from command execution.
  7. Design a payment processing pipeline with validation, execution, and notification stages.
  8. Keep the pipeline open for new payment methods without modifying coordinator logic.
  9. Model a RuleEngine where each rule can approve or reject an input object.
  10. Add rule composition using AND and OR combinations.
  11. Design a PricingEngine where pricing rules are pluggable.
  12. Add customer-tier pricing, coupon pricing, and seasonal pricing together.
  13. Resolve rule ordering problems without hardcoded if-else chains.
  14. Design a SearchFilter abstraction for product filtering.
  15. Add category, price-range, and rating filters.
  16. Allow combining filters dynamically.
  17. Design a Serializer interface with implementations for XML, JSON, and plain text.
  18. Introduce a service that works with any Serializer.
  19. Design a StorageService abstraction for local, cloud, and in-memory storage.
  20. Ensure calling code does not know storage implementation details.
  21. Design a NotificationChannel hierarchy and add retry rules.
  22. Separate message formatting from message sending.
  23. Design a game skill system using object hierarchies or interfaces.
  24. Add cooldown behavior without tightly coupling skill logic to player logic.
  25. Introduce effect stacking rules through composition.
  26. Design a discount engine that supports chained discounts with clear rules.
  27. Prevent invalid discount combinations through policy objects.
  28. Design an achievement system where each achievement is evaluated independently.
  29. Add polymorphic conditions for time-based and event-based achievements.
  30. Design a WorkflowStep abstraction for approval flows.
  31. Create multiple steps and a coordinator that only depends on the step contract.
  32. Add rollback or compensation behavior to failed workflow steps.
  33. Design a ReportScheduler that runs different report tasks polymorphically.
  34. Add result notification without mixing scheduler and notifier responsibilities.
  35. Design an AuthenticationFlow where multiple strategies exist for login.
  36. Add password login, OTP login, and OAuth-style placeholder login.
  37. Ensure controller logic depends on abstraction only.
  38. Design a FraudCheck pipeline for transactions.
  39. Add velocity, amount, and device-based checks as interchangeable rules.
  40. Design a classroom evaluation system where question type drives grading behavior.
  41. Avoid type checking in grading logic.
  42. Design a tax engine with composable policies and exemption rules.
  43. Add a country-specific adapter layer without breaking existing tax abstractions.
  44. Design a DocumentParser interface and create multiple parser implementations.
  45. Add a coordinator that chooses parser based on document type cleanly.
  46. Design a file-upload validation system using rule abstractions.
  47. Add size, type, and virus-scan rules without giant controller logic.
  48. Design a workflow where OrderService depends on InventoryChecker, PaymentProcessor, and Notifier.
  49. Replace direct concrete dependencies with abstractions.
  50. Demonstrate how test doubles become easier with this design.
  51. Design an event-listener style interface for user actions.
  52. Add multiple listeners without changing source event producer.
  53. Design a PromotionEligibility system.
  54. Add employee-based, purchase-count-based, and referral-based eligibility rules.
  55. Design a RecommendationStrategy abstraction.
  56. Add popular-item, recent-item, and similarity-based dummy strategies.
  57. Design a QuestionEvaluationStrategy abstraction for coding platform questions.
  58. Separate code execution result parsing from final score calculation.
  59. Design a CachePolicy abstraction with eviction strategies.
  60. Add LRU-like placeholder and no-eviction strategy behaviorally.
  61. Design a booking confirmation system with channel-specific confirmation senders.
  62. Ensure new channels do not require editing booking logic.
  63. Design a mini game engine loop that calls polymorphic update() on entities.
  64. Add player, enemy, and projectile entities without type checks.
  65. Design a stateful MediaPlayer model and then refactor it into state-like behavior objects.
  66. Design a PaymentFailureHandler abstraction.
  67. Add different failure responses based on failure type.
  68. Design a scheduler with task priorities using behavior-rich task objects.
  69. Add logging decorators around task execution.
  70. Design a DocumentFormatter abstraction for resume generation.
  71. Add section-level formatters through composition.
  72. Design a ShippingProvider abstraction with cost and ETA methods.
  73. Add two providers and a service that compares them.
  74. Design a RideMatchingStrategy abstraction.
  75. Add nearest-driver and least-busy-driver strategies.
  76. Design a DeliverySlotAllocator abstraction.
  77. Add different slot-selection policies.
  78. Design a fraud alert notification design using abstraction, composition, and strategy.
  79. Build a reusable policy-driven validation framework using interfaces.
  80. Add short-circuit evaluation rules to that framework.
  81. Design a DocumentSigner abstraction.
  82. Add manual and auto-sign signer implementations.
  83. Build a FormFieldValidator framework with one validator per rule.
  84. Add aggregation of errors without hardwiring validation logic.
  85. Design a SurveyQuestion hierarchy with rendering and answer validation.
  86. Add text, MCQ, checkbox, and rating questions.
  87. Build a polymorphic Shape editor that can draw and resize objects without instanceof.
  88. Extend it with grouping behavior while keeping responsibilities clear.
  89. Design a TravelFareStrategy system that supports train, bus, cab, and flight placeholders.
  90. Ensure route planner depends on abstraction only.
  91. Design a RuleBasedMessageRouter using condition and handler abstractions.
  92. Add route branching without nested conditional complexity.
  93. Design a DeviceHealthCheck system with pluggable checks.
  94. Add CPU, memory, disk, and network checks.
  95. Design a TransactionProcessor with pluggable steps and handlers.
  96. Make it testable without real gateway or notifier.
  97. Design an interview-grade ParkingLot abstraction for vehicle type pricing.
  98. Add polymorphic parking fee calculation and slot assignment.
  99. Refactor a large billing if-else into strategy and policy objects.
  100. Refactor a role-based access check into capability-based abstractions.

Advanced Stage 3: Composition, Aggregates, State, and Robust Domain Modeling (801-900)

  1. Design an Order aggregate root that owns OrderLine objects and protects invariants.
  2. Prevent OrderLine from existing in invalid quantity state.
  3. Prevent confirmed orders from being edited directly.
  4. Add explicit methods for adding, removing, and changing quantity safely.
  5. Design an Invoice aggregate with immutable line snapshots from Order.
  6. Explain why invoice should not hold mutable references back to live order lines.
  7. Design a Library aggregate with Member, BookCopy, and Loan.
  8. Protect the rule that one book copy cannot be loaned twice at the same time.
  9. Add waiting-list behavior without corrupting loan rules.
  10. Design a Trip aggregate with driver, rider, and fare breakdown.
  11. Prevent invalid trip status transitions.
  12. Add cancellation rules depending on trip stage.
  13. Design a SeatMap object that owns seat state transitions.
  14. Prevent double booking under repeated requests in the domain model.
  15. Model a school exam aggregate with exam, sections, and questions.
  16. Prevent score updates after publishing results.
  17. Design a ShoppingCart to Order conversion flow as a domain transition.
  18. Ensure cart mutability and order immutability are properly separated.
  19. Design a Warehouse aggregate with stock lots instead of raw counts.
  20. Prevent shipping more items than available across lots.
  21. Design a PayrollRun object that owns employee salary calculations for a pay cycle.
  22. Prevent recalculating archived payroll runs accidentally.
  23. Design a Project aggregate with tasks, assignees, and status rules.
  24. Ensure a project cannot be marked complete while active tasks remain incomplete.
  25. Design a BlogPost aggregate with comments and moderation actions.
  26. Prevent deleted posts from accepting new comments.
  27. Design a CartPromotionApplication object that records which promotions were used.
  28. Prevent stacking incompatible promotions.
  29. Design a Reservation aggregate for restaurant booking with table assignment.
  30. Prevent assigning two reservations to one table for overlapping times.
  31. Design a LoanRepaymentSchedule object.
  32. Protect repayment ordering rules and overdue calculations.
  33. Design a HospitalVisit aggregate with patient, doctor notes, prescription, and billing.
  34. Ensure closed visits cannot be modified except through explicit amendment flow.
  35. Design a TicketConversation model with comment timeline and status changes.
  36. Separate public replies and internal notes cleanly.
  37. Design a ContestSubmission model with attempt history.
  38. Prevent hidden mutation of historical attempts.
  39. Design a GradeBook aggregate with student records and locked terms.
  40. Ensure published term results cannot be changed without revision workflow.
  41. Design a HotelStay model with check-in, extension, and check-out rules.
  42. Prevent room reassignment after checkout completion.
  43. Design a FoodOrder aggregate with line items, kitchen status, and billing status.
  44. Ensure kitchen-prepared items cannot be silently removed.
  45. Design a SubscriptionAccount model with renew, suspend, cancel, and resume transitions.
  46. Prevent invalid state transitions.
  47. Design a ParcelShipment aggregate with checkpoints and delivery status.
  48. Prevent delivered parcels from re-entering in-transit state.
  49. Design a RecruitmentPipeline model with candidates and interview stages.
  50. Ensure rejected candidates cannot move to later interview rounds directly.
  51. Design a ClassSession aggregate with attendance, topic coverage, and homework.
  52. Prevent attendance changes after session lock unless admin amendment exists.
  53. Design a PaymentAttempt history model for an order.
  54. Separate order payment status from individual payment attempts.
  55. Design a Budget aggregate with categories and allocations.
  56. Prevent overspending relative to category allocation unless override policy exists.
  57. Design a WarehouseTransfer object moving stock between locations.
  58. Prevent transfer completion without source deduction and destination addition both succeeding.
  59. Design a ReturnRequest aggregate that owns item-level return reasons.
  60. Prevent approving return quantities greater than purchased quantities.
  61. Design a DriverShift model with start, end, breaks, and active-trip rules.
  62. Prevent shift closure while an active trip exists.
  63. Design a FoodDeliveryBatch model grouping multiple deliveries.
  64. Ensure batch status reflects child delivery statuses coherently.
  65. Design a MedicalPrescription aggregate with medicine lines and dosage rules.
  66. Prevent editing dosage after doctor approval without amendment note.
  67. Design an ExamPaper model with section ordering and total marks validation.
  68. Prevent total marks mismatch from final publication.
  69. Design a Playlist model where position ordering is explicit.
  70. Prevent inconsistent ordering after song insertions and removals.
  71. Design a ResearchSubmission workflow with draft, submitted, reviewed, accepted, rejected.
  72. Encode valid transitions without stringly typed branching.
  73. Design an AccessControlPolicy aggregate with roles and permissions.
  74. Prevent duplicate permission assignment bugs.
  75. Design a TravelItinerary model with legs and total duration calculations.
  76. Prevent invalid overlapping travel legs.
  77. Design a PatientQueue model with priority and arrival order.
  78. Prevent queue corruption after reprioritization.
  79. Design an Auction aggregate with bids and close rules.
  80. Prevent late bids after close time.
  81. Design a ScoreBoard aggregate with rounds and participants.
  82. Prevent out-of-order round score entry.
  83. Design a LoanApplicationReview process with multiple review decisions.
  84. Require final decision only after mandatory checks pass.
  85. Design a PolicyDocument aggregate with versions and publish rules.
  86. Prevent editing already published versions directly.
  87. Design a RefundSettlement model with settlement attempts.
  88. Prevent marking refund complete when settlement attempt failed.
  89. Design a FleetMaintenanceSchedule with service records and due checks.
  90. Prevent closing maintenance jobs without mandatory checklist completion.
  91. Design a GameMatch aggregate with players, turns, and result locking.
  92. Prevent further moves after result declaration.
  93. Design a DigitalWalletTransfer model with sender, receiver, limits, and state.
  94. Prevent balance deduction and receiver credit from going out of sync in domain logic.
  95. Design a DonationCampaign aggregate with pledges and fulfillment status.
  96. Prevent campaign closure when unresolved pledges exist unless explicitly allowed.
  97. Design a ProcurementRequest aggregate with approval chain and vendor quotes.
  98. Prevent quote selection before minimum vendor response count is satisfied.
  99. Design a UniversitySemesterPlan aggregate with courses and credit rules.
  100. Refactor one of the above aggregates to improve cohesion and lower coupling.

Advanced Stage 4: High-Difficulty OOP Engineering and Refactoring Challenges (901-1000)

  1. Refactor a deep inheritance hierarchy of vehicles into a cleaner composition-heavy design.
  2. Refactor a payment system where concrete classes are created directly inside services.
  3. Replace direct new calls across services with injected abstractions where appropriate.
  4. Refactor a UserManager class that handles login, reporting, email, and audit.
  5. Extract cohesive services from that UserManager while preserving behavior.
  6. Refactor a giant OrderService with 12 responsibilities into a clear object collaboration model.
  7. Identify aggregate roots and supporting services in that OrderService design.
  8. Refactor a school management model where every class has public fields.
  9. Add invariant-protecting methods and remove direct state mutation.
  10. Refactor a class hierarchy where child classes constantly override methods with empty bodies.
  11. Diagnose why that hierarchy violates substitutability and redesign it.
  12. Refactor a Bird hierarchy where some birds cannot fly without breaking behavior contracts.
  13. Replace inheritance with capability interfaces where needed.
  14. Refactor a design where instanceof checks determine payment behavior everywhere.
  15. Replace those checks with runtime polymorphism and strategies.
  16. Refactor a discount engine that modifies one giant method every festival season.
  17. Make the discount system open for extension and closed for modification.
  18. Refactor a report generator that hardcodes output format strings in business logic.
  19. Separate report data preparation from report rendering.
  20. Refactor a chat application where message sending is mixed with persistence and notification.
  21. Separate domain model, sender abstraction, and notification behavior.
  22. Refactor a product system where money is modeled as double everywhere.
  23. Introduce a Money value object and explain where API boundaries change.
  24. Refactor an order model where status is a raw string used in many places.
  25. Replace string status with safer domain modeling and explicit transitions.
  26. Refactor a booking system where seat selection, payment, and ticket issuance are tightly coupled.
  27. Separate them into collaborating objects without losing consistency.
  28. Refactor a reporting system that returns large mutable internal collections.
  29. Prevent clients from mutating internal aggregate state accidentally.
  30. Refactor a customer service model where comments, escalations, and assignment are all methods on one class.
  31. Improve cohesion and event traceability.
  32. Refactor a batch job framework where each job contains logging, error handling, retry, and business logic mixed together.
  33. Separate cross-cutting concerns from job-specific logic.
  34. Refactor an exam system where all question types use one giant class with many nullable fields.
  35. Replace it with a more explicit object model.
  36. Refactor a loyalty program where tier logic is duplicated in multiple services.
  37. Centralize tier rules without creating a god class.
  38. Refactor a payroll system where different pay rules are encoded with nested if-else trees.
  39. Introduce a pay-rule abstraction and explain testing benefits.
  40. Refactor a warehouse system where inventory counts can become inconsistent because updates happen from multiple places.
  41. Centralize mutation paths inside a proper aggregate.
  42. Refactor a media player model where state logic is spread across UI and domain classes.
  43. Introduce a better state-oriented design.
  44. Refactor a cart system where discounts and taxes are applied in inconsistent order across codebase.
  45. Model pricing pipeline explicitly.
  46. Refactor a user-notification system where each service chooses its own notification formatting rules.
  47. Centralize message composition without hard-coding sender channel behavior.
  48. Refactor a support-ticket workflow that allows invalid status jumps due to open setters.
  49. Replace open setters with explicit domain operations.
  50. Refactor an invoice model where invoice totals are recalculated on every getter call from mutable lines.
  51. Make invoice snapshots stable and predictable.
  52. Refactor a cab booking system where fare, trip, and driver availability are changed by multiple services independently.
  53. Identify consistency boundaries and redesign around them.
  54. Refactor a document approval system where permissions are checked ad hoc in many methods.
  55. Introduce clear policy abstractions or authorization services.
  56. Refactor a fitness app where workout, nutrition, and subscription logic live in one large member class.
  57. Split responsibilities while maintaining a coherent domain.
  58. Refactor an e-commerce product model where digital and physical products share wrong inheritance.
  59. Replace fragile inheritance with capabilities or composition.
  60. Refactor a shopping cart system to support plug-in pricing rules from external teams.
  61. Design extension points without exposing domain internals dangerously.
  62. Refactor a monolithic billing class to support auditability of each applied rule.
  63. Introduce objects representing intermediate calculation stages where needed.
  64. Refactor a survey platform where all answer types are strings.
  65. Model answer types explicitly and validate them polymorphically.
  66. Refactor a game engine where weapons are subclasses of characters due to bad inheritance.
  67. Correct the model with composition and explain why.
  68. Refactor a loan approval flow where rule ordering changes frequently and is brittle.
  69. Introduce configurable rule objects and a rule engine coordinator.
  70. Refactor a codebase where constructors perform database calls, network calls, and validation all together.
  71. Split object construction, validation, and infrastructure concerns appropriately.
  72. Refactor a command-processing app where handler selection is hardcoded in controller logic.
  73. Move to a registration-based or map-based polymorphic dispatch design.
  74. Refactor a report-export subsystem to support streaming large outputs without changing callers.
  75. Redesign abstractions so scalability concern does not leak badly.
  76. Refactor a school result system where one object both stores marks and renders HTML reports.
  77. Improve cohesion and testing ability.
  78. Refactor a package-shipping workflow where address parsing logic is scattered.
  79. Introduce a proper address value object and supporting parser boundary.
  80. Refactor a user-account model where security-sensitive fields are mutable from UI layer directly.
  81. Introduce safe mutation APIs and boundary validation.
  82. Refactor a collaborative editing model where document changes are applied by arbitrary services.
  83. Centralize change application and versioning rules.
  84. Refactor an audit system where every service creates audit entries in different formats.
  85. Introduce consistent audit abstractions without overengineering.
  86. Refactor a chat moderation system where blocked content checks are duplicated.
  87. Create a reusable moderation rule model.
  88. Refactor a travel itinerary system where each transport type duplicates scheduling rules.
  89. Extract common scheduling behavior without forcing invalid inheritance.
  90. Refactor a CRM where customer, lead, and prospect models share partial overlapping state badly.
  91. Decide which parts belong in shared abstractions and which do not.
  92. Refactor a parking lot system that stores all vehicles in one mutable map with weak invariants.
  93. Introduce stronger domain boundaries and behavior-rich slot assignments.
  94. Refactor a marketplace checkout system to support future split payments and partial refunds.
  95. Prepare the object model for those changes with minimal rewrite risk.
  96. Refactor a ride-sharing domain where one huge class handles rider, driver, payment, and trip status.
  97. Break it into proper entities, value objects, and services while preserving the workflow.
  98. Choose one earlier advanced system and redesign it to maximize low coupling and high cohesion.
  99. Choose one earlier advanced system and redesign it to maximize testability and replaceable dependencies.
  100. Design and implement a complete interview-grade OOP mini-system of your choice, then write a design note explaining where you used encapsulation, abstraction, polymorphism, composition, immutable value objects, and dependency inversion.

Closing Note

If a student solves this entire sheet honestly, OOP will stop feeling like a classroom chapter and start feeling like an engineering discipline.

That is exactly the point.

#oops#practice-time#just-do-it
Found this useful?

Related Posts

Comments (0)

No comments yet. Be the first to share your thoughts!

Leave a Comment