Interview Experience

Persistent Interview Experience C++

persistent_interview_experience_c++

Round 1: Online test for 60 minutes. Test consists of questions related to C++ and analytical problems.

Round 2: Technical interview

  • What are the various OOPs concepts in C++ ?
    Answer : OOPs in C++
  • Difference between encapsulation and abstraction?
  • What are the C++ access specifiers?
    Answer : Check Here
  • How to call private function from child class ?
    Answer : Using Friend Function
  • What is the Diamond Problem in C++ ?
    Answer : Check here and here
  • What is Polymorphism and types of it ?
  • Where and why use run-time Polymorphism ?
  • Why use parameters int argc,char *argv[] in main function ?
    Answer : Check here

  • #include<iostream>
    using namespace std;
    #define main xyz
    int main(int argc,char *argv[])
    {
         main();
         return 0;
    } 
    int xyz()
    {
        cout << "hi";
        return 0;
    }
    Will above program be compiled ? What will be the output ?

  • struct s
    {
        char c;
        int i;
    };
    What is the size of the structure ?
    Answer : 8 (Because of padding). Read here
  • Write C++ program to print below output.
          1      
         2 2     
        3 3 3    
       4 4 4 4   
      5 5 5 5 5  
     6 6 6 6 6 6 
    The number of rows can be any.
    Answer :
    #include <iostream>
    
    using namespace std;
    
    int main()
    {
       int rows;int n;string space = " ";
       cout << "Enter Number of rows" << endl; 
       cin >> rows;
       
       cout << "rows : "<< rows << endl;
       for (int t = 1; t <= rows; t++)
       {
           for (int i = t; i <= rows; i++)
           {
               cout << space;
           }
            n = t; 
           for(int j = 1; j <= t; j++)
           {
               cout << t;
               if( n > 1 )
               {
                   cout << space;
               }
               n--;
           }
           for (int k = t; k <= rows; k++)
           {
               cout << space;
           }
           cout << endl;
       }
       
       return 0;
    }
    


This article is contributed by Ashwini Verma. If you like dEexams.com and would like to contribute, you can also write your article here or mail your article to admin@deexams.com . See your article appearing on the dEexams.com main page and help others to learn.


Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.


Python if , elif and else

Python Conditions and If statements

  • 0
Python for beginners

Learning Python Part 1

  • 3
Struct Alignment and Padding

Struct Alignment and Padding in C++ And C

  • 0
Friend function

Friend function C++

  • 0
Pointers

C++ Pointers

  • 0
Structures

C++ Structures

  • 0
Types of Inheritance in C++

Inheritance and access specifiers C++

  • 0
Java date pattern

Java Date Pattern Syntax

  • 0
Java Date and Calendar

Java Date formats

  • 0
JAVA Data Type

Data types in Java

  • 0
Java unreachable code

Unreachable Code Error in Java

  • 0

Post Comment

Comments(0)

WEB TECHNOLOGY

Articles

×

Forgot Password

Please enter your email address below and we will send you information to change your password.