← All CodeSignal Technical Assessment Flashcard Decks

Object-Oriented Programming Flashcards

7 cards from real CodeSignal Technical Assessment practice questions. Tap to flip, then mark Knew It or Still Learning — missed cards come back until you master them.

Read the first 7 Object-Oriented Programming flashcards as text
  1. What is method overriding in OOP?

    Answer: A subclass providing its own implementation of a method already defined in its superclass

    Method overriding lets a subclass supply a specific implementation for a method defined in its parent class, changing the behavior for that subtype.

  2. What is method overloading?

    Answer: Defining multiple methods with the same name but different parameter lists within the same class

    Method overloading allows a class to have multiple methods sharing a name, differentiated by their parameter count, types, or order.

  3. Which access modifier restricts a class member to be accessible only within its own class?

    Answer: private

    `private` is the most restrictive access level, preventing any access to the member from outside the class where it is declared.

  4. What is an interface in object-oriented programming?

    Answer: A contract specifying methods a class must implement, without providing implementation details

    An interface defines a contract of method signatures that any implementing class must fulfill, enabling loose coupling and polymorphism.

  5. Which statement best describes the difference between composition and inheritance?

    Answer: Inheritance models an 'is-a' relationship while composition models a 'has-a' relationship

    Inheritance expresses that one type 'is a' subtype of another (Dog is an Animal), while composition expresses that one type 'has a' component of another (Car has an Engine).

  6. What defines a static method in OOP?

    Answer: A method that belongs to the class itself rather than to any specific instance

    Static methods are associated with the class, not with individual objects; they can be called using the class name without creating an instance.

  7. Which SOLID principle states that software entities should be open for extension but closed for modification?

    Answer: Open/Closed Principle

    The Open/Closed Principle says code should allow new functionality to be added (open for extension) without altering existing tested code (closed for modification).

Object-Oriented Programming Flashcards — CodeSignal Technical Assessment Study Cards with Answers