LearnFrenzy
Sign in Take a free test

Technical tests

OOPs Online Test

Predict what Java, C++ and Python classes print, read UML class diagrams and choose designs – every program is compiled and run.

Topics
10
Practice sets
30
Full mocks
2
Questions
450

OOPs questions appear in nearly every placement test and technical interview, usually as "what does this program print?" puzzles about constructors, overriding and static binding, plus design questions about interfaces, SOLID and patterns. Here each program is shown in a code window and was compiled and run in Java, C++ or Python to produce its answer, and class designs are drawn as UML class diagrams.

Full mocks

Test yourself like the real round

Object-Oriented Programming · Full Mock 1

30 questions across all ten OOPs topics – Java, C++ and Python output, UML diagrams, SOLID and design patterns – with negative marking.

  • 30 questions
  • 45 min
  • 2 sections
  • −0.25 per wrong answer

Object-Oriented Programming · Full Mock 2

30 fresh questions – no overlap with Mock 1 – from all ten topics, from constructors and properties to exceptions, LSP and factories.

  • 30 questions
  • 45 min
  • 2 sections
  • −0.25 per wrong answer

Topic-wise practice

Choose a topic and level

01Classes, Objects and Constructors

Classes and objects, references, constructors and overloading, this() chaining, initialisation order, copy constructors, instance vs class attributes and object equality.

  • Beginner Classes & Objects · Beginner15 questions · 23 min Not started Start
  • Intermediate Classes & Objects · Intermediate15 questions · 23 min Not started Start
  • Advanced Classes & Objects · Advanced15 questions · 23 min Not started Start

02Encapsulation and Access Modifiers

Data hiding, getters and setters with validation, public/protected/package/private, Python name mangling and properties, leaky getters, defensive copies and invariants.

  • Beginner Encapsulation · Beginner15 questions · 23 min Not started Start
  • Intermediate Encapsulation · Intermediate15 questions · 23 min Not started Start
  • Advanced Encapsulation · Advanced15 questions · 23 min Not started Start

03Inheritance

is-a relationships, constructor and destructor order, super calls, types of inheritance, field and static hiding, multiple inheritance, the diamond problem, MRO, slicing and the fragile base class.

  • Beginner Inheritance · Beginner15 questions · 23 min Not started Start
  • Intermediate Inheritance · Intermediate15 questions · 23 min Not started Start
  • Advanced Inheritance · Advanced15 questions · 23 min Not started Start

04Polymorphism

Compile-time vs run-time polymorphism, overloading rules, overriding and dynamic dispatch, virtual functions, operator overloading, duck typing, and the traps: static types in overload resolution, default arguments, equals(Object).

  • Beginner Polymorphism · Beginner15 questions · 23 min Not started Start
  • Intermediate Polymorphism · Intermediate15 questions · 23 min Not started Start
  • Advanced Polymorphism · Advanced15 questions · 23 min Not started Start

05Abstract Classes and Interfaces

Abstraction, abstract classes and pure virtual functions, Python ABCs and Protocols, Java interfaces with default, static and private methods, functional interfaces and the rules for default-method conflicts.

  • Beginner Abstraction & Interfaces · Beginner15 questions · 23 min Not started Start
  • Intermediate Abstraction & Interfaces · Intermediate15 questions · 23 min Not started Start
  • Advanced Abstraction & Interfaces · Advanced15 questions · 23 min Not started Start

06Object Lifecycle and Copying

Creation and destruction order, RAII and smart pointers, garbage collection and reference counting, try-with-resources and with, shallow vs deep copy, copy and move semantics, the rules of three and five.

  • Beginner Object Lifecycle · Beginner15 questions · 23 min Not started Start
  • Intermediate Object Lifecycle · Intermediate15 questions · 23 min Not started Start
  • Advanced Object Lifecycle · Advanced15 questions · 23 min Not started Start

07static, final, this and super

Class-level vs instance-level members, static initialisation, final/const variables, methods and classes, this for disambiguation and chaining, super for parent members, classmethod and staticmethod in Python.

  • Beginner static, final, this, super · Beginner15 questions · 23 min Not started Start
  • Intermediate static, final, this, super · Intermediate15 questions · 23 min Not started Start
  • Advanced static, final, this, super · Advanced15 questions · 23 min Not started Start

08Exception Handling

try/catch/finally flow, checked vs unchecked exceptions, exception hierarchies and custom exceptions, finally and return, suppressed and chained exceptions, stack unwinding, noexcept and exception safety.

  • Beginner Exception Handling · Beginner15 questions · 23 min Not started Start
  • Intermediate Exception Handling · Intermediate15 questions · 23 min Not started Start
  • Advanced Exception Handling · Advanced15 questions · 23 min Not started Start

09SOLID and Class Relationships

The five SOLID principles, association, aggregation, composition and dependency in UML, multiplicities, coupling and cohesion, composition over inheritance and common design smells.

  • Beginner SOLID & Relationships · Beginner15 questions · 23 min Not started Start
  • Intermediate SOLID & Relationships · Intermediate15 questions · 23 min Not started Start
  • Advanced SOLID & Relationships · Advanced15 questions · 23 min Not started Start

10Design Patterns

Creational (Singleton, Factory, Builder, Prototype), structural (Adapter, Decorator, Facade, Proxy, Composite) and behavioural (Strategy, Observer, Command, State, Template Method, Iterator, Chain of Responsibility) patterns – recognising them and predicting what they do.

  • Beginner Design Patterns · Beginner15 questions · 23 min Not started Start
  • Intermediate Design Patterns · Intermediate15 questions · 23 min Not started Start
  • Advanced Design Patterns · Advanced15 questions · 23 min Not started Start

Search LearnFrenzy

Esc

Quick links