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. Does Python have private attributes? What do _x and __x mean?

    Python has no true private. A single underscore _x is a hint that it is internal. A double underscore __x triggers name mangling, which renames it to _ClassName__x to avoid clashes in subclasses.

    IntermediateQuick answer1 min read
  2. How do you make a property private in JavaScript classes?

    Prefix the field with

    IntermediateQuick answer1 min read