Interview Q&A / Object-Oriented Programming

INTERVIEW Q&A · 69 QUESTIONS

Object-Oriented Programming interview questions

The four pillars, interfaces, abstract classes and design basics.

  1. How do you spot a Single Responsibility violation in real code?

    Look for a class whose description needs the word and, imports from unrelated areas, unrelated groups of fields, or edits from different people for different reasons.

    IntermediateQuick answer1 min read
  2. How is the Interface Segregation Principle different from the Single Responsibility Principle?

    SRP is about a class having one reason to change. ISP is about the interface a client sees: it should be small and fit that client's needs. One is about implementation, the other about the contract.

    IntermediateQuick answer1 min read