Videos
I was wondering if anyone knew of a question bank or practice tests for OOP questions on Hackerrank. The questions that I am referring to specifically are the MCQ questions in languages such as C++ or Python where you are given a list of functions and classes and then told to evaluate what is printed out by the program. These are often very tricky, and it would be nice to have a repository of questions to learn the general tricks and patterns.
An example would be something like the following in C++. The prompt would be to evaluate the output. I am looking for some really difficult examples that I can practice, especially in a timed environment.
#include<iostream>
#include<iostream>
using namespace std;
class Base1 {
public:
Base1()
{ cout << " Base1's constructor called" << endl; }
};
class Base2 {
public:
Base2()
{ cout << "Base2's constructor called" << endl; }
};
class Derived: public Base1, public Base2 {
public:
Derived()
{ cout << "Derived's constructor called" << endl; }
};
int main()
{
Derived d;
return 0;
}I am aware of there being a bunch of these on GeeksforGeeks. Curious if there are any other niche locations. Looking to practice these for the Old Mission OA, if anyone's taken that.
Here's what I have tried so far: Codewars - The problems labelled classes were either too complex to understand for me, or I found no actual need for implementing OOPS. None of the problems required you to create a class anyways.
Hackerrank - Just two problems in the OOP/ classes section ( don't remember what they exactly call them) and they two were hard math problems, so I need to first of all understand the complex maths concepts before I can get to programming.
Leetcode - Can't actually filter out problems based on OOP.