Follow Our FB Page << CircleMedia.in >> for Daily Laughter. We Post Funny, Viral, Comedy Videos, Memes, Vines...

C++ General Interview Questions

How much is size of struct having 1 char & 1 integer?

10436

4113

if there is binary tree which one is the easiest way to delete all child node?

4674

Write a C program to calculate the salary of each employee in your company. You need to input the hours worked and the hourly rate. The company pays 1.5 times the hourly rate for all hours worked in excess of 48 hours. Use the formulas below to calculate the salary: if employee worked less than 48 hours salary = hours * rate; if employee worked more than 48 hours salary = 48.0 * rate + ( hours − 48.0 ) * rate * 1.5; You are required to use a loop to produce the sample output as given below.

11099

When is a template better solution than a base class??

emc2,

6641

Explain calling an object's member function(declared virtual)from its constructor?

2076

You're given an array containing both positive and negative integers and required to find the sub-array with the largest sum (O(N) a la KBL). Write a routine in C for the above.

9976

Given an array of size N in which every number is between 1 and N, determine if there are any duplicates in it. You are allowed to destroy the array if you like. [ I ended up giving about 4 or 5 different solutions for this, each supposedly better than the others ].

4374

Give a very good method to count the number of ones in a "n" (e.g. 32) bit number.

6425

What is the output of the following 3D Array int arr[3][2][2]={1,2,3,4,5,6,7,8,9,10,11,12}; what is the output for arr[2][1][0]?

25866

What are the advantages of C++ programming compared to C programming?

HAL,

4084

9658

what is the difference between linear list linked representaion and linked representation? what is the purpose of representing the linear list in linked represention ? is it not avoiding rules of linear represention?

1325

What is volatile and pragma? When they are used?

2455

In which memory a class gets stored(in heap /in stack)? And why??

6903

Un-Answered Questions { C++ General }

Differentiate between a pointer and a reference with respect to c++.

159

Why use of template is better than a base class?

164

what are the iterator and generic algorithms.

1062

What is the difference between a reference and a pointer?

140

How does a copy constructor differs from an overloaded assignment operator?

145

129

What is the difference between structures and unions?

148

Explain what happens when a pointer is deleted twice?

155

What are namespaces in c++?

131

If a round rectangle has straight edges and rounded corners, your roundrect class inherits both from rectangle and from circle, and they in turn both inherit from shape, how many shapes are created when you create a roundrect?

166

What is the best it certification?

130

How do c++ struct differs from the c++ class?

146

Can I learn c++ without learning c?

127

In inline " expression passed as argument are evalauated once " while in macro "in some cases expression passed as argument are evaluated more than once " --> i am not getting it plz help to make me understand....

1451

What is the use of setprecision in c++?

127