All 59 questions

  1. What does SOLID stand for, and what does each principle mean?

    Asked in 18 of 347 interviews · last asked Oct 15 · Concept · Mid-level

    Show answer

    SOLID stands for Single Responsibility (a class has one reason to change), Open/Closed (extend behavior without changing existing code), and Liskov Substitution (subtypes must honor base-type contracts). It also includes Interface Segregation (clients should not depend on methods they do not need) and Dependency Inversion (high-level and low-level code depend on abstractions).

    • Single Responsibility groups code that changes for the same reason, not necessarily code with only one method.
    • A subtype must work wherever its base type is expected, without breaking expected behavior.
    • With Dependency Inversion, details depend on abstractions; abstractions do not depend on details.
    • These principles guide design; adding interfaces everywhere can create needless complexity.

    What the interviewer checks: The interviewer checks whether you can name all five principles and explain how they guide software design.

    Common mistake (in 4 of 7 reviewed answers): Many answers forget that SOLID has five principles; name each one and explain its meaning.

    Other ways it was asked
    • “What are the SOLID principles?”
    • “Can you explain the SOLID principles?”
    • “What are the SOLID principles, and how do they guide software design?”
  2. What is a UML class diagram?

    Asked in 6 of 347 interviews · last asked Mar 27 · Concept · Junior

    Show answer

    A UML class diagram shows the static structure of a system: its classes, their attributes and operations, and their relationships. Each class is usually drawn as a box with sections for its name, attributes, and operations. It describes how the system is organized, not how it runs step by step.

    • UML stands for Unified Modeling Language.
    • Relationships include association, inheritance, aggregation, and composition.
    • Visibility symbols include + for public, - for private, and # for protected.
    • Multiplicity shows how many objects can be linked, such as one or many.

    What the interviewer checks: The interviewer is checking whether you can read and explain a basic object-oriented design diagram.

    Other ways it was asked
    • “What do you mean by a class diagram?”
    • “What is a class in UML?”
    • “What is a class diagram?”
  3. How would you design an immutable class in Java?

    Asked in 5 of 347 interviews · last asked Oct 6 · Concept · Mid-level

    Show answer

    An immutable Java class cannot change its state after construction. Make the class final, keep fields private and final, and provide no methods that change its state. Copy mutable inputs and return defensive copies of mutable fields, so callers cannot change the object's internal state.

    • A final class prevents subclasses from adding behavior that breaks immutability.
    • A final reference cannot be reassigned, but the referenced object may still change.
    • Copy mutable data on input and output; immutable values can be shared.
    • Do not let this escape during construction.
    Code
    public final class Event {
        private final java.util.Date when;
        public Event(java.util.Date when) {
            this.when = new java.util.Date(when.getTime());
        }
        public java.util.Date getWhen() {
            return new java.util.Date(when.getTime());
        }
    }

    What the interviewer checks: The interviewer checks whether you can prevent state changes through methods, subclasses, and shared mutable objects.

    Other ways it was asked
    • “How do you make a class immutable in Java?”
    • “Can you explain immutable class design?”
    • “What does immutable class design mean in Java?”
  4. What is the Dependency Inversion Principle, and which modules should depend on which?

    Asked in 3 of 347 interviews · last asked Sep 30 · Concept · Junior

    Other ways it was asked
    • “What is dependency inversion?”
    • “What is the Dependency Inversion Principle?”
    • “What is the definition of dependency inversion?”
  5. Can you give an example of a violation of the Liskov Substitution Principle?

    Asked in 2 of 347 interviews · last asked Sep 4 · Concept · Mid-level

    Other ways it was asked
    • “What is the Liskov Substitution Principle?”
  6. What is the difference between cohesion and coupling?

    Asked in 2 of 347 interviews · last asked Oct 20 · Concept · Junior

  7. How do you ensure that a large C++ codebase remains modular, testable, and maintainable over time?

    Asked once · last asked Jun 15 · Design · Senior

    Other ways it was asked
    • “What best practices do you follow to keep a large C++ codebase modular, testable, and maintainable?”
  8. In C#, how do default equality and ordering comparisons work, and when would you customize CompareTo or GetHashCode?

    Asked once · last asked Jan 28 · Concept · Mid-level

    Other ways it was asked
    • “In C#, how does default comparison work, and when should you override CompareTo or GetHashCode?”
  9. When would you choose a record, class, or struct for a domain type, and why?

    Asked once · last asked Mar 16 · Concept · Mid-level

  10. Can you explain the difference between sequence and collaboration diagrams?

    Asked once · last asked Mar 27 · Concept · Junior

  11. What coding practices would you use when building an application, including reusable components?

    Asked once · last asked Apr 16 · Concept · Mid-level

  12. How can a library expose errors to its clients, and would you represent them with a dedicated error object?

    Asked once · last asked May 7 · Concept · Mid-level

  13. How would you write maintainable and testable code for a feature that sends email notifications to users? Discuss the design principles and practices you would apply.

    Asked once · last asked May 8 · Scenario · Mid-level

  14. What design principles do you prioritize for a long-running system maintained by many engineers?

    Asked once · last asked May 11 · Design · Senior

  15. In what situations is it best to use an immutable class? Can you give an example?

    Asked once · last asked May 25 · Concept · Mid-level

  16. How would you ensure a set does not contain two distinct objects with the same values representing the same person?

    Asked once · last asked Jun 9 · Concept · Mid-level

  17. How would you calculate an object's hash code?

    Asked once · last asked Jun 9 · Concept · Mid-level

  18. Imagine you have two objects that reference each other, creating a circular reference. What problem does this cause during JSON serialization, and how can you handle it?

    Asked once · last asked Jun 16 · Scenario · Mid-level

  19. How would you structure Java classes for a management system using object-oriented programming principles?

    Asked once · last asked Jun 20 · Scenario · Junior

  20. During code review, a teammate submits an implementation in one class and method with 20 parameters and 2,000 lines of code. What would you propose?

    Asked once · last asked Jun 25 · Scenario · Senior

  21. What principle should be followed when creating subclasses?

    Asked once · last asked Jul 16 · Concept · Mid-level

  22. What are the differences between traits and service classes in Laravel, and when would you use each?

    Asked once · last asked Jul 16 · Concept · Mid-level

  23. What’s the biggest focus area for you in how you structure code, and how do you think about managing complexity in applications?

    Asked once · last asked Jul 16 · Concept · Mid-level

  24. How would you implement a class that validates payment cards and processes transactions?

    Asked once · last asked Jul 17 · Write code · Mid-level

  25. How would you apply software architecture principles, SOLID principles, and design patterns when developing a project from scratch or maintaining an existing one?

    Asked once · last asked Jul 31 · Scenario · Senior

  26. In PHP, what are read-only properties and read-only classes, and how do they differ?

    Asked once · last asked Aug 12 · Concept · Mid-level

  27. Describe a small program for Minesweeper and identify class responsibilities.

    Asked once · last asked Aug 28 · Design · Mid-level

  28. How would you implement equality and assignment for a claim ID?

    Asked once · last asked Sep 2 · Write code · Mid-level

  29. Design a parking lot system for motorcycles, cars, and trucks with different types of parking spots. Define the classes, interfaces, relationships, and allocation strategy, and explain how you would scale the system.

    Asked once · last asked Sep 9 · Design · Mid-level

  30. Why should fields in an immutable Java class be declared final?

    Asked once · last asked Sep 11 · Concept · Mid-level

  31. When should an immutable Java class create copies of objects it returns?

    Asked once · last asked Sep 11 · Scenario · Mid-level

  32. How would you use generics in an application, and can you give an example?

    Asked once · last asked Sep 21 · Scenario · Mid-level

    Other ways it was asked
    • “How would you use generics in an application? Give an example.”
  33. What considerations would lead you to split an implementation into three files rather than keep it in one script?

    Asked once · last asked Sep 29 · Design · Mid-level

    Other ways it was asked
    • “Why did you split the implementation into three files instead of one script?”
  34. How do you ensure the data integrity of an order object so the total price always matches the sum of its items?

    Asked once · last asked Oct 6 · Scenario · Mid-level

  35. How would you apply SOLID and DRY principles when designing React components?

    Asked once · last asked Oct 12 · Behavioral · Mid-level

    Other ways it was asked
    • “How have you applied SOLID and DRY principles when designing React components?”
  36. When adding Spock and lizard to rock, paper, scissors, should you replace the existing rules, and why?

    Asked once · last asked Jun 9 · Scenario · Mid-level

    Other ways it was asked
    • “How would adding Spock and lizard to rock, paper, scissors affect the design of your code?”
    • “Is adding more rules enough to support Spock and lizard in rock, paper, scissors?”
  37. How does comparison work for reference types in C#?

    Asked once · last asked Jan 28 · Concept · Junior

  38. Who is the Liskov substitution principle named after?

    Asked once · last asked Feb 11 · Concept · Junior

  39. Do we need separate methods to add to or deduct from a balance?

    Asked once · last asked Mar 2 · Concept · Mid-level

  40. What is an object in UML?

    Asked once · last asked Mar 26 · Concept · Junior

  41. What is cohesion in software design, and why is it important?

    Asked once · last asked Mar 27 · Concept · Junior

  42. What is a UML collaboration diagram?

    Asked once · last asked Mar 27 · Concept · Junior

  43. What is coupling in software design?

    Asked once · last asked Mar 27 · Concept · Junior

  44. What is modularity?

    Asked once · last asked Mar 27 · Concept · Junior

  45. Which is not a characteristic of good software design: high cohesion, low coupling, high complexity, or abstraction? Explain your reasoning.

    Asked once · last asked Mar 31 · Concept · Junior

  46. In a notification system, what responsibilities should the send and deliver methods have?

    Asked once · last asked Mar 31 · Concept · Mid-level

  47. Should classes be loosely or tightly coupled, and why?

    Asked once · last asked Apr 27 · Concept · Junior

  48. What can you say about low coupling and high cohesion?

    Asked once · last asked May 12 · Concept · Mid-level

  49. In an e-commerce application, what does a product model represent?

    Asked once · last asked Jun 5 · Concept · Junior

  50. Which object method should be implemented to compare two distinct objects by their values?

    Asked once · last asked Jun 9 · Concept · Junior

  51. Besides the Single Responsibility Principle, which other SOLID principle do you consider important, and why?

    Asked once · last asked Jun 24 · Concept · Junior

  52. What general programming principles do you apply in your day-to-day work?

    Asked once · last asked Jul 16 · Concept · Mid-level

  53. What is a DTO?

    Asked once · last asked Jul 14 · Concept · Junior

  54. What is your understanding of the principles of software development?

    Asked once · last asked Jul 16 · Concept · Junior

  55. How do you understand the Single Responsibility Principle?

    Asked once · last asked Jul 27 · Concept · Junior

  56. What is the Single Responsibility Principle (SRP)?

    Asked once · last asked Aug 17 · Concept · Junior

  57. What do the KISS and DRY principles mean?

    Asked once · last asked Aug 25 · Concept · Junior

  58. What are the attributes of an apple?

    Asked once · last asked Sep 15 · Concept · Junior

  59. What are the benefits of design patterns and SOLID principles in object-oriented programming?

    Asked once · last asked Oct 16 · Concept · Mid-level

More OOP and Design Patterns interview questions

How this list is made

Every question here was asked by a real interviewer in a real job interview that a candidate ran MeetAssist in. After the call, the interviewer's questions are pulled from the transcript. Practice sessions, tests, exams and anything that was not a job interview are dropped.

Questions are rewritten so they make sense on their own: names of people, employers and clients are removed, and speech-to-text mistakes are fixed. Small talk, logistics and questions about one candidate's own résumé are left out. Rephrasings of the same question are merged, and the count is the number of different interviews it came up in.

The interviews come from candidates who use MeetAssist, so they lean towards software, data and AI roles: the shares describe these interviews, not every OOP and Design Patterns interview. Answers to the most asked questions are written and checked by an editor; a "common mistake" is shown only when reviews of real answers in these interviews show it, with the count.

347 interviews, 240 candidates, Sep 2025 to Oct 2026. Updated every month with new interviews.