epam-short-track

OOP, Prototypal Inheritance, SOLID cross interview #4

  1. How do you define a constructor in JavaScript?
  2. How do you initialize object properties using a constructor?
  3. What is the difference between public and private members in a class?
  4. How do you declare a public member in a JavaScript class?
  5. How do you declare a private member in a JavaScript class?
  6. What is a static member in a class?
  7. Can static members be accessed from an instance of a class?
  8. What is encapsulation in OOP?
  9. What is the difference between a method and a property in a class?
  10. How do you create getter and setter methods in a class?
  11. What is the role of the this keyword in class methods?
  12. How do you inherit properties and methods from another class?
  13. What is prototypal inheritance in JavaScript?
  14. How do you set the prototype of an object?
  15. What is the proto property?
  16. How does Object.create() work?
  17. What is a temporary constructor pattern?
  18. How does the instanceof operator work?
  19. What are the differences between classical and prototypal inheritance?
  20. How do you extend a class using the extends keyword?
  21. What is the super keyword used for in ES2015 classes?
  22. Can you call a parent class’s method from a subclass? How?
  23. How do you implement inheritance using function constructors?
  24. How do you implement inheritance using ES2015 classes?
  25. What does the SOLID acronym stand for?
  26. What is the Single Responsibility Principle?
  27. How does the Open/Closed Principle apply to classes?
  28. What is the Liskov Substitution Principle?
  29. How does the Interface Segregation Principle improve code design?
  30. What is the Dependency Inversion Principle?