Are you a candidate looking to sharpen your skills? Try our practice tests or view sample interview questions & Get hired by the best. Click Here×

CPP Online Assessment Test

Topics Covered

  • Classes in C++
  • Types of Constructor
  • Types of Deconstructor
  • Types of Iterators and Objects
  • OOPs concept

Useful for hiring

  • Entry Level Software Engineer
  • CPP Developer

Start hiring job-fit candidates using this assessment

GET A DEMO

"The best part of Interview Mocha is they have topic wise questions available. The skill wise extensive reports and advanced analytics lets us measure & benchmark the proficiency level of employees in that particular skill."

Cheryl Tolkinen, Securian, USA,
Learning & Development Manager
Question

The given code snippet compiles even when an integer is passed as an argument in func function, however, expected argument is of data type A. It's an example of conversion constructor, which makes code prone to error.

class A 
{
    public: 
          int i;
          A(int k) { i = k;}
          int getA() { return i;}        
};
void func(A a)
{
    int i = a.getA();
}
int main ()

    func(7); 
}

What keyword should be placed before the constructor to avoid the above error?

Answer
    • 1) explicit

    • 2) implicit

    • 3) static

    • Both 1 & 3

    • Both 1 & 2

Question

Would the destructor be called in this code snippet? If yes, then due to which vector?

#include
#include
using namespace std;
 
class a
{
    public :
        ~a()
        {
            cout << "destroy";
        }
};
int main()
{
   vector *v1  = new vector;
   vector *v2  = new vector;
   return 0;
}

Answer
    • v1

    • v2

    • v1 and v2

    • no destructor call.

Question

Given below are few statements in the context of C++ program implementation:
1) In a class implementation, one should always overload new and delete operators.
2) One should always surround code which has a potential of throwing an exception with a try-catch block.
3) It is recommended to not modularize the program.

If b = number of statements indicating good practice and a = number of statements indicating bad practice, choose the correct relation between them.

Answer
    • b = 2a

    • a = b

    • a = 2b

    • a * 0 = b

Test details:

CPP Online Test enables employers and recruiters to identify & hire software engineer by evaluating working skills and job readiness. For this reason, the emphasis is laid upon evaluating the knowledge of applied skills gained through real work experience, rather than theoretical knowledge.

The test may contain MCQ's (Multiple Choice Questions), MAQ's (Multiple Answer Questions), Fill in the Blank, Descriptive, Whiteboard Questions, Audio / Video Questions, True or False.
 
Test Duration: 20 minutes

20 Application Questions

The CPP skills test contains a combination of application and theory questions that help you to evaluate the practical skills of candidates.

Test description:

CPP Online Test has been designed and developed to evaluate the CPP language skills of software engineer as per Industry Standards.
CPP Test helps Recruiters & Hiring Managers to assess the understanding of CPP language of a software engineer.

CPP is a middle-level language which runs on a variety of platforms such as Windows, Mac OS and various versions of UNIX. Software Programmer should have good hands on basic programming languages used in Information Technology. Every language used in IT has its own basic form of structure which Software Engineer should understand. 

CPP assessment test contains meaningful questions on:
 

  • Classes in C++ 

  • Types of Constructor

  • Types of Deconstructor

  • Types of Iterators and Objects 

  • OOPs concept
     

CPP Test is designed by our subject matter experts to gauge understanding about CPP language of candidates to hire as a software engineer. Using powerful reporting, you can have a detailed analysis of the test results to help you make a better hiring decision and predict the candidate’s performance.

Good News! You can customize this test as per your requirement

  • Choose and add questions from Interview Mocha question libraries

  • Add your own set of questions

  • Customize test settings like duration, number of questions, passing score, web proctoring and much more

  • Mail us at support@interviewmocha.com to create a custom test

Looking for a tailor-made test, to suit your assessment needs?

Get in touch

Global companies using Mocha assessments

  • altran
  • credit suisse
  • sephora
  • nielsen
  • capgemini
  • akamai

How Mocha assessments are brewed

Speed up your IT recruitment with Interview Mocha

  • 500+ IT skill tests
  • 20+ coding languages
  • 50+ domain knowledge tests
  • 100+ digital 2.0 skill tests
  • Customer focus aptitude tests
  • Enterprise ready features & more...
GET A DEMO

Why hiring managers and recruiters across the globe love Interview Mocha

Take your first step to hire job fit candidates

GET A DEMO