SlideShare a Scribd company logo
www.rekruitin.com
C, C++ Interview Questions
Part - 1
Page  2
1. What is C++?
Released in 1985, C++ is an object-oriented programming language created
by Bjarne Stroustrup. C++ maintains almost all aspects of the C language,
while simplifying memory management and adding several features -
including a new datatype known as a class (you will learn more about these
later) - to allow object-oriented programming. C++ maintains the features of C
which allowed for low-level memory access but also gives the programmer
new tools to simplify memory management.
C++ used for:
C++ is a powerful general-purpose programming language. It can be used to
create small programs or large applications. It can be used to make CGI
scripts or console-only DOS programs. C++ allows you to create programs to
do almost anything you need to do. The creator of C++, Bjarne Stroustrup,
has put together a partial list of applications written in C++.
Page  3
2. How do you find out if a linked-list has an end? (i.e. the list is not a
cycle)?
You can find out by using 2 pointers. One of them goes 2 nodes each time.
The second one goes at 1 nodes each time. If there is a cycle, the one that
goes 2 nodes each time will eventually meet the one that goes slower. If that
is the case, then you will know the linked-list is a cycle.
3. What is the difference between realloc() and free()?
The free subroutine frees a block of memory previously allocated by the
malloc subroutine. Undefined results occur if the Pointer parameter is not a
valid pointer. If the Pointer parameter is a null value, no action will occur.
The realloc subroutine changes the size of the block of memory pointed to
by the Pointer parameter to the number of bytes specified by the Size
parameter and returns a new pointer to the block. The pointer specified by
the Pointer parameter must have been created with the malloc, calloc, or
realloc subroutines and not been deallocated with the free or realloc
subroutines. Undefined results occur if the Pointer parameter is not a valid
pointer.
Page  4
4. What is function overloading and operator overloading?
Function overloading: C++ enables several functions of the same name to be
defined, as long as these functions have different sets of parameters (at least as
far as their types are concerned). This capability is called function overloading.
When an overloaded function is called, the C++ compiler selects the proper
function by examining the number, types and order of the arguments in the call.
Function overloading is commonly used to create several functions of the same
name that perform similar tasks but on different data types.
Operator overloading allows existing C++ operators to be redefined so that they
work on objects of user-defined classes.
Overloaded operators are syntactic sugar for equivalent function calls. They
form a pleasant facade that doesn't add anything fundamental to the language
(but they can improve understandability and reduce maintenance costs).
Page  5
5. What is the difference between declaration and definition?
The declaration tells the compiler that at some later point we plan to present the
definition of this declaration.
E.g.: void stars () //function declaration
The definition contains the actual implementation.
E.g.: void stars () // declarator
{
for(int j=10; j > =0; j--) //function body
cout << *;
cout << endl; }
6. What are the advantages of inheritance?
It permits code reusability. Reusability saves time in program development. It
encourages the reuse of proven and debugged high-quality software, thus reducing
problem after a system becomes functional.
Page  6
7. Define Storage Classes and explain application domain?
Register: tell to the compiler for use a CPU register for fast aceess for that
variable.
Auto: It's a variable created and initialized when it is defined. It is not visible
outside of the block.
Static: defined inside of the function retain its value between calls. Always is
initialized with 0. Defined as global in a file is visible on for the functions from that
file.
Extern : The definition of the variable is in another file.
8. Define a "dangling" pointer?
Dangling pointer is obtained by using the address of an object which was freed.
9. Any difference between "const int*ptr" and int *const ptr" ?
Yes, it's a major difference. First define a constant data and second define a
constant pointer.
Page  7
10. Define the Storage Qualifiers?
const - define a variable that can not change its value along the program
execution.
volatile - define a variable that can be changed indirectly. An example can
be a counter register that is updated by hardware.
mutuable - a member of a structure or object can be changed even if the
structure, for example is declared const:
Ex: struct complex {mutuable int x; int y;};
const complex Mycomplex = {1, 2};
Mycomplex.x = 3; /* correct */
11. Does c++ support multilevel and multiple inheritance?
Yes.
Page  8
12. What is the difference between an ARRAY and a LIST?
Array is collection of homogeneous elements.
List is collection of heterogeneous elements.
For Array memory allocated is static and continuous.
For List memory allocated is dynamic and Random.
Array: User need not have to keep in track of next memory allocation.
List: User has to keep in Track of next location where memory is allocated.
13. Define a constructor - What it is and how it might be called.
constructor is a member function of the class, with the name of the function
being the same as the class name. It also specifies how the object should be
initialized.
Ways of calling constructor:
1) Implicitly: automatically by complier when an object is created.
2) Calling the constructors explicitly is possible, but it makes the code
unverifiable.
Page  9
14. What is a template?
Templates allow to create generic functions that admit any data type as
parameters and return value without having to overload the function with all
the possible data types. Until certain point they fulfill the functionality of a
macro. Its prototype is any of the two following ones:
template <class indetifier> function_declaration; template <typename
indetifier> function_declaration;
The only difference between both prototypes is the use of keyword class or
typename, its use is indistinct since both expressions have exactly the same
meaning and behave exactly the same way.
15. What is RTTI?
Runtime type identification (RTTI) lets you find the dynamic type of an object
when you have only a pointer or a reference to the base type. RTTI is the
official way in standard C++ to discover the type of an object and to convert
the type of a pointer or reference (that is, dynamic typing). The need came
from practical experience with C++. RTTI replaces many Interview Questions
- Homegrown versions with a solid, consistent approach.
Page  10
16. How can you tell what shell you are running on UNIX system?
You can do the Echo $RANDOM. It will return a undefined variable if you are
from the C-Shell, just a return prompt if you are from the Bourne shell, and a 5
digit random numbers if you are from the Korn shell. You could also do a ps -l
and look for the shell with the highest PID.
17. What do you mean by inheritance?
Inheritance is the process of creating new classes, called derived classes, from
existing classes or base classes. The derived class inherits all the capabilities of
the base class, but can add embellishments and refinements of its own.
18. What is Boyce Codd Normal form?
A relation schema R is in BCNF with respect to a set F of functional
dependencies if for all functional dependencies in F+ of the form a-> , where a
and b is a subset of R, at least one of the following holds:
* a- > b is a trivial functional dependency (b is a subset of a)
* a is a superkey for schema R
Page  11
19. What is namespace?
Namespaces allow us to group a set of global classes, objects and/or
functions under a name.
To say it somehow, they serve to split the global scope in sub-scopes known
as namespaces.
The form to use namespaces is:
namespace identifier { namespace-body }
Where identifier is any valid identifier and namespace-body is the set of
classes, objects and functions that are included within the namespace. For
example:
namespace general { int a, b; }
In this case, a and b are normal variables integrated within the general
namespace. In order to access to these variables from outside the
namespace we have to use the scope operator ::.
For example, to access the previous variables we would have to put:
general::a general::b
The functionality of namespaces is specially useful in case that there is a
possibility that a global object or function can have the same name than
another one, causing a redefinition error.
Page  12
20. What do you mean by binding of data and functions?
Encapsulation.
21. What are virtual functions?
A virtual function allows derived classes to replace the implementation
provided by the base class.
The compiler makes sure the replacement is always called whenever the
object in question is actually of the derived class, even if the object is
accessed by a base pointer rather than a derived pointer. This allows
algorithms in the base class to be replaced in the derived class, even if users
don't know about the derived class.
22. What is the difference between an external iterator and an internal
iterator? Describe an advantage of an external iterator.
An internal iterator is implemented with member functions of the class that
has items to step through. .An external iterator is implemented as a separate
class that can be "attach" to the object that has items to step through
.An external iterator has the advantage that many difference iterators can be
active simultaneously on the same object.
Page  13
23. What is an HTML tag? 
An HTML tag is a syntactical construct in the HTML language that 
abbreviates specific instructions to be executed when the HTML script is 
loaded into a Web browser. 
It is like a method in Java, a function in C++, a procedure in Pascal, or a 
subroutine in FORTRAN.
24. How do you decide which integer type to use?
 
It depends on our requirement. 
When we are required an integer to be stored in 1 byte (means less than or 
equal to 255) we use short int, for 2 bytes we use int, for 8 bytes we use long 
int. 
A char is for 1-byte integers, a short is for 2-byte integers, an int is generally 
a 2-byte or 4-byte integer (though not necessarily), a long is a 4-byte integer, 
and a long long is a 8-byte integer.
25.What is a class? 
Class is a user-defined data type in C++. It can be created to solve a 
particular kind of problem. After creation the user need not know the specifics 
of the working of a class.
Page  14
For more details, Please log on to www.rekruitin.com
Customer Care : 8855041500
Career Guidance : 9823205144
Tech Support : 7758806112
Human Resource: 9823204144
You can also Find us on:
15
Thank You !!!

More Related Content

What's hot

Functions in c language
Functions in c language Functions in c language
Functions in c language
tanmaymodi4
 
Modern C++ Explained: Move Semantics (Feb 2018)
Modern C++ Explained: Move Semantics (Feb 2018)Modern C++ Explained: Move Semantics (Feb 2018)
Modern C++ Explained: Move Semantics (Feb 2018)
Olve Maudal
 
Recursive Function
Recursive FunctionRecursive Function
Recursive Function
Kamal Acharya
 
C Programming Storage classes, Recursion
C Programming Storage classes, RecursionC Programming Storage classes, Recursion
C Programming Storage classes, Recursion
Sreedhar Chowdam
 
Functions in c
Functions in cFunctions in c
Functions in c
sunila tharagaturi
 
Python functions
Python functionsPython functions
Python functions
Prof. Dr. K. Adisesha
 
Functions in c language
Functions in c languageFunctions in c language
Functions in c language
Tanmay Modi
 
Java abstract class & abstract methods
Java abstract class & abstract methodsJava abstract class & abstract methods
Java abstract class & abstract methods
Shubham Dwivedi
 
88 c-programs
88 c-programs88 c-programs
88 c-programs
Leandro Schenone
 
16717 functions in C++
16717 functions in C++16717 functions in C++
16717 functions in C++
LPU
 
Enums in c
Enums in cEnums in c
Pointer to function 1
Pointer to function 1Pointer to function 1
Pointer to function 1
Abu Bakr Ramadan
 
Preprocessor directives in c language
Preprocessor directives in c languagePreprocessor directives in c language
Preprocessor directives in c language
tanmaymodi4
 
Functions In C
Functions In CFunctions In C
Functions In C
Simplilearn
 
Complete C++ programming Language Course
Complete C++ programming Language CourseComplete C++ programming Language Course
Complete C++ programming Language Course
Vivek chan
 
Functions in C
Functions in CFunctions in C
Functions in C
Kamal Acharya
 
07. Virtual Functions
07. Virtual Functions07. Virtual Functions
07. Virtual Functions
Haresh Jaiswal
 
INLINE FUNCTION IN C++
INLINE FUNCTION IN C++INLINE FUNCTION IN C++
INLINE FUNCTION IN C++
Vraj Patel
 
Encapsulation in C++
Encapsulation in C++Encapsulation in C++
Encapsulation in C++
Hitesh Kumar
 

What's hot (20)

Functions in c language
Functions in c language Functions in c language
Functions in c language
 
Modern C++ Explained: Move Semantics (Feb 2018)
Modern C++ Explained: Move Semantics (Feb 2018)Modern C++ Explained: Move Semantics (Feb 2018)
Modern C++ Explained: Move Semantics (Feb 2018)
 
Recursive Function
Recursive FunctionRecursive Function
Recursive Function
 
C Programming Storage classes, Recursion
C Programming Storage classes, RecursionC Programming Storage classes, Recursion
C Programming Storage classes, Recursion
 
Functions in c
Functions in cFunctions in c
Functions in c
 
Python functions
Python functionsPython functions
Python functions
 
Functions in c language
Functions in c languageFunctions in c language
Functions in c language
 
Java abstract class & abstract methods
Java abstract class & abstract methodsJava abstract class & abstract methods
Java abstract class & abstract methods
 
88 c-programs
88 c-programs88 c-programs
88 c-programs
 
16717 functions in C++
16717 functions in C++16717 functions in C++
16717 functions in C++
 
Enums in c
Enums in cEnums in c
Enums in c
 
Pointer to function 1
Pointer to function 1Pointer to function 1
Pointer to function 1
 
Preprocessor directives in c language
Preprocessor directives in c languagePreprocessor directives in c language
Preprocessor directives in c language
 
Functions In C
Functions In CFunctions In C
Functions In C
 
Complete C++ programming Language Course
Complete C++ programming Language CourseComplete C++ programming Language Course
Complete C++ programming Language Course
 
Functions in C
Functions in CFunctions in C
Functions in C
 
07. Virtual Functions
07. Virtual Functions07. Virtual Functions
07. Virtual Functions
 
Function
FunctionFunction
Function
 
INLINE FUNCTION IN C++
INLINE FUNCTION IN C++INLINE FUNCTION IN C++
INLINE FUNCTION IN C++
 
Encapsulation in C++
Encapsulation in C++Encapsulation in C++
Encapsulation in C++
 

Viewers also liked

C++ questions and answers
C++ questions and answersC++ questions and answers
C++ questions and answers
Deepak Singh
 
C++ questions And Answer
C++ questions And AnswerC++ questions And Answer
C++ questions And Answer
lavparmar007
 
C faqs interview questions placement paper 2013
C faqs interview questions placement paper 2013C faqs interview questions placement paper 2013
C faqs interview questions placement paper 2013
srikanthreddy004
 
100 c interview questions answers
100 c interview questions answers100 c interview questions answers
100 c interview questions answersSareen Kumar
 
C interview question answer 2
C interview question answer 2C interview question answer 2
C interview question answer 2Amit Kapoor
 
C interview-questions-techpreparation
C interview-questions-techpreparationC interview-questions-techpreparation
C interview-questions-techpreparationKushaal Singla
 
C Programming Interview Questions
C Programming Interview QuestionsC Programming Interview Questions
C Programming Interview Questions
Gradeup
 
Cat Quant Cheat Sheet
Cat Quant Cheat SheetCat Quant Cheat Sheet
Cat Quant Cheat Sheet
versabit technologies
 
C interview Question and Answer
C interview Question and AnswerC interview Question and Answer
C interview Question and Answer
Jagan Mohan Bishoyi
 
Geometry formula sheet
Geometry formula sheetGeometry formula sheet
Geometry formula sheetsidraqasim99
 
Algebra formulas
Algebra formulas Algebra formulas
Algebra formulas
Matthew McKenzie
 
C programming interview questions
C programming interview questionsC programming interview questions
C programming interview questions
adarshynl
 
Geometry formula-sheet
Geometry formula-sheetGeometry formula-sheet
Geometry formula-sheet
adheera dra
 
Probability Formula sheet
Probability Formula sheetProbability Formula sheet
Probability Formula sheet
Haris Hassan
 
Notes and-formulae-mathematics
Notes and-formulae-mathematicsNotes and-formulae-mathematics
Notes and-formulae-mathematicsRagulan Dev
 
Research method - How to interview?
Research method - How to interview?Research method - How to interview?
Research method - How to interview?
Hafizah Hajimia
 
C Programming Language Tutorial for beginners - JavaTpoint
C Programming Language Tutorial for beginners - JavaTpointC Programming Language Tutorial for beginners - JavaTpoint
C Programming Language Tutorial for beginners - JavaTpoint
JavaTpoint.Com
 
Top 100 SQL Interview Questions and Answers
Top 100 SQL Interview Questions and AnswersTop 100 SQL Interview Questions and Answers
Top 100 SQL Interview Questions and Answers
iimjobs and hirist
 
Shortcuts in Mathematics for CAT, CET, GRE, GMAT or any similar competitive ...
Shortcuts in  Mathematics for CAT, CET, GRE, GMAT or any similar competitive ...Shortcuts in  Mathematics for CAT, CET, GRE, GMAT or any similar competitive ...
Shortcuts in Mathematics for CAT, CET, GRE, GMAT or any similar competitive ...
paijayant
 
Basic java important interview questions and answers to secure a job
Basic java important interview questions and answers to secure a jobBasic java important interview questions and answers to secure a job
Basic java important interview questions and answers to secure a job
Garuda Trainings
 

Viewers also liked (20)

C++ questions and answers
C++ questions and answersC++ questions and answers
C++ questions and answers
 
C++ questions And Answer
C++ questions And AnswerC++ questions And Answer
C++ questions And Answer
 
C faqs interview questions placement paper 2013
C faqs interview questions placement paper 2013C faqs interview questions placement paper 2013
C faqs interview questions placement paper 2013
 
100 c interview questions answers
100 c interview questions answers100 c interview questions answers
100 c interview questions answers
 
C interview question answer 2
C interview question answer 2C interview question answer 2
C interview question answer 2
 
C interview-questions-techpreparation
C interview-questions-techpreparationC interview-questions-techpreparation
C interview-questions-techpreparation
 
C Programming Interview Questions
C Programming Interview QuestionsC Programming Interview Questions
C Programming Interview Questions
 
Cat Quant Cheat Sheet
Cat Quant Cheat SheetCat Quant Cheat Sheet
Cat Quant Cheat Sheet
 
C interview Question and Answer
C interview Question and AnswerC interview Question and Answer
C interview Question and Answer
 
Geometry formula sheet
Geometry formula sheetGeometry formula sheet
Geometry formula sheet
 
Algebra formulas
Algebra formulas Algebra formulas
Algebra formulas
 
C programming interview questions
C programming interview questionsC programming interview questions
C programming interview questions
 
Geometry formula-sheet
Geometry formula-sheetGeometry formula-sheet
Geometry formula-sheet
 
Probability Formula sheet
Probability Formula sheetProbability Formula sheet
Probability Formula sheet
 
Notes and-formulae-mathematics
Notes and-formulae-mathematicsNotes and-formulae-mathematics
Notes and-formulae-mathematics
 
Research method - How to interview?
Research method - How to interview?Research method - How to interview?
Research method - How to interview?
 
C Programming Language Tutorial for beginners - JavaTpoint
C Programming Language Tutorial for beginners - JavaTpointC Programming Language Tutorial for beginners - JavaTpoint
C Programming Language Tutorial for beginners - JavaTpoint
 
Top 100 SQL Interview Questions and Answers
Top 100 SQL Interview Questions and AnswersTop 100 SQL Interview Questions and Answers
Top 100 SQL Interview Questions and Answers
 
Shortcuts in Mathematics for CAT, CET, GRE, GMAT or any similar competitive ...
Shortcuts in  Mathematics for CAT, CET, GRE, GMAT or any similar competitive ...Shortcuts in  Mathematics for CAT, CET, GRE, GMAT or any similar competitive ...
Shortcuts in Mathematics for CAT, CET, GRE, GMAT or any similar competitive ...
 
Basic java important interview questions and answers to secure a job
Basic java important interview questions and answers to secure a jobBasic java important interview questions and answers to secure a job
Basic java important interview questions and answers to secure a job
 

Similar to C, C++ Interview Questions Part - 1

1183 c-interview-questions-and-answers
1183 c-interview-questions-and-answers1183 c-interview-questions-and-answers
1183 c-interview-questions-and-answers
Akash Gawali
 
C++ Interview Question And Answer
C++ Interview Question And AnswerC++ Interview Question And Answer
C++ Interview Question And Answer
Jagan Mohan Bishoyi
 
Interoduction to c++
Interoduction to c++Interoduction to c++
Interoduction to c++
Amresh Raj
 
7.-Download_CS201-Solved-Subjective-with-Reference-by-Aqib.doc
7.-Download_CS201-Solved-Subjective-with-Reference-by-Aqib.doc7.-Download_CS201-Solved-Subjective-with-Reference-by-Aqib.doc
7.-Download_CS201-Solved-Subjective-with-Reference-by-Aqib.doc
abdulhaq467432
 
cbybalaguruswami-e-180803051831.pptx
cbybalaguruswami-e-180803051831.pptxcbybalaguruswami-e-180803051831.pptx
cbybalaguruswami-e-180803051831.pptx
SRamadossbiher
 
cbybalaguruswami-e-180803051831.pptx
cbybalaguruswami-e-180803051831.pptxcbybalaguruswami-e-180803051831.pptx
cbybalaguruswami-e-180803051831.pptx
SRamadossbiher
 
Tcs NQTExam technical questions
Tcs NQTExam technical questionsTcs NQTExam technical questions
Tcs NQTExam technical questions
AniketBhandare2
 
C by balaguruswami - e.balagurusamy
C   by balaguruswami - e.balagurusamyC   by balaguruswami - e.balagurusamy
C by balaguruswami - e.balagurusamy
Srichandan Sobhanayak
 
C questions
C questionsC questions
C questions
parm112
 
C basic questions&amp;ansrs by shiva kumar kella
C basic questions&amp;ansrs by shiva kumar kellaC basic questions&amp;ansrs by shiva kumar kella
C basic questions&amp;ansrs by shiva kumar kella
Manoj Kumar kothagulla
 
Introduction to C++ Programming
Introduction to C++ ProgrammingIntroduction to C++ Programming
Introduction to C++ Programming
Preeti Kashyap
 
New microsoft office word document (2)
New microsoft office word document (2)New microsoft office word document (2)
New microsoft office word document (2)rashmita_mishra
 
Bcsl 031 solve assignment
Bcsl 031 solve assignmentBcsl 031 solve assignment
Unit 1
Unit  1Unit  1
Unit 1
donny101
 
Technical_Interview_Questions.pdf
Technical_Interview_Questions.pdfTechnical_Interview_Questions.pdf
Technical_Interview_Questions.pdf
adityashukla939020
 
C interview questions
C interview questionsC interview questions
C interview questions
Soba Arjun
 
interview questions.docx
interview questions.docxinterview questions.docx
interview questions.docx
SeoTechnoscripts
 

Similar to C, C++ Interview Questions Part - 1 (20)

1183 c-interview-questions-and-answers
1183 c-interview-questions-and-answers1183 c-interview-questions-and-answers
1183 c-interview-questions-and-answers
 
C++ Interview Question And Answer
C++ Interview Question And AnswerC++ Interview Question And Answer
C++ Interview Question And Answer
 
Interoduction to c++
Interoduction to c++Interoduction to c++
Interoduction to c++
 
7.-Download_CS201-Solved-Subjective-with-Reference-by-Aqib.doc
7.-Download_CS201-Solved-Subjective-with-Reference-by-Aqib.doc7.-Download_CS201-Solved-Subjective-with-Reference-by-Aqib.doc
7.-Download_CS201-Solved-Subjective-with-Reference-by-Aqib.doc
 
cbybalaguruswami-e-180803051831.pptx
cbybalaguruswami-e-180803051831.pptxcbybalaguruswami-e-180803051831.pptx
cbybalaguruswami-e-180803051831.pptx
 
cbybalaguruswami-e-180803051831.pptx
cbybalaguruswami-e-180803051831.pptxcbybalaguruswami-e-180803051831.pptx
cbybalaguruswami-e-180803051831.pptx
 
Technical Interview
Technical InterviewTechnical Interview
Technical Interview
 
Tcs NQTExam technical questions
Tcs NQTExam technical questionsTcs NQTExam technical questions
Tcs NQTExam technical questions
 
C by balaguruswami - e.balagurusamy
C   by balaguruswami - e.balagurusamyC   by balaguruswami - e.balagurusamy
C by balaguruswami - e.balagurusamy
 
C questions
C questionsC questions
C questions
 
C basic questions&amp;ansrs by shiva kumar kella
C basic questions&amp;ansrs by shiva kumar kellaC basic questions&amp;ansrs by shiva kumar kella
C basic questions&amp;ansrs by shiva kumar kella
 
My c++
My c++My c++
My c++
 
Introduction to C++ Programming
Introduction to C++ ProgrammingIntroduction to C++ Programming
Introduction to C++ Programming
 
New microsoft office word document (2)
New microsoft office word document (2)New microsoft office word document (2)
New microsoft office word document (2)
 
Bcsl 031 solve assignment
Bcsl 031 solve assignmentBcsl 031 solve assignment
Bcsl 031 solve assignment
 
Unit 1
Unit  1Unit  1
Unit 1
 
Intervies
InterviesIntervies
Intervies
 
Technical_Interview_Questions.pdf
Technical_Interview_Questions.pdfTechnical_Interview_Questions.pdf
Technical_Interview_Questions.pdf
 
C interview questions
C interview questionsC interview questions
C interview questions
 
interview questions.docx
interview questions.docxinterview questions.docx
interview questions.docx
 

More from ReKruiTIn.com

Tips On Telephonic Interview Round
Tips On Telephonic Interview RoundTips On Telephonic Interview Round
Tips On Telephonic Interview Round
ReKruiTIn.com
 
What not to Include in your Resume.
What not to Include in your Resume.What not to Include in your Resume.
What not to Include in your Resume.
ReKruiTIn.com
 
Tips for Salary Negotiation
Tips for Salary NegotiationTips for Salary Negotiation
Tips for Salary Negotiation
ReKruiTIn.com
 
Tips on Group Discussion
Tips on Group DiscussionTips on Group Discussion
Tips on Group Discussion
ReKruiTIn.com
 
Team management
Team managementTeam management
Team management
ReKruiTIn.com
 
Importance of Cover Letter
Importance of Cover LetterImportance of Cover Letter
Importance of Cover Letter
ReKruiTIn.com
 
Mistakes to avoid in Job Interview
Mistakes to avoid in  Job InterviewMistakes to avoid in  Job Interview
Mistakes to avoid in Job Interview
ReKruiTIn.com
 
DB2 Interview Questions - Part 1
DB2 Interview Questions - Part 1DB2 Interview Questions - Part 1
DB2 Interview Questions - Part 1
ReKruiTIn.com
 
Sap Interview Questions - Part 1
Sap Interview Questions - Part 1Sap Interview Questions - Part 1
Sap Interview Questions - Part 1
ReKruiTIn.com
 
Dot Net Interview Questions - Part 1
Dot Net Interview Questions - Part 1Dot Net Interview Questions - Part 1
Dot Net Interview Questions - Part 1
ReKruiTIn.com
 
PeopleSoft Interview Questions - Part 1
PeopleSoft Interview Questions - Part 1PeopleSoft Interview Questions - Part 1
PeopleSoft Interview Questions - Part 1
ReKruiTIn.com
 
Resume Writing Skills
Resume Writing SkillsResume Writing Skills
Resume Writing Skills
ReKruiTIn.com
 
Interview Process
Interview ProcessInterview Process
Interview Process
ReKruiTIn.com
 
Recruitment skills
Recruitment skillsRecruitment skills
Recruitment skills
ReKruiTIn.com
 
Basic Interview Questions
Basic Interview QuestionsBasic Interview Questions
Basic Interview Questions
ReKruiTIn.com
 
Career Development Tips
Career Development TipsCareer Development Tips
Career Development Tips
ReKruiTIn.com
 

More from ReKruiTIn.com (16)

Tips On Telephonic Interview Round
Tips On Telephonic Interview RoundTips On Telephonic Interview Round
Tips On Telephonic Interview Round
 
What not to Include in your Resume.
What not to Include in your Resume.What not to Include in your Resume.
What not to Include in your Resume.
 
Tips for Salary Negotiation
Tips for Salary NegotiationTips for Salary Negotiation
Tips for Salary Negotiation
 
Tips on Group Discussion
Tips on Group DiscussionTips on Group Discussion
Tips on Group Discussion
 
Team management
Team managementTeam management
Team management
 
Importance of Cover Letter
Importance of Cover LetterImportance of Cover Letter
Importance of Cover Letter
 
Mistakes to avoid in Job Interview
Mistakes to avoid in  Job InterviewMistakes to avoid in  Job Interview
Mistakes to avoid in Job Interview
 
DB2 Interview Questions - Part 1
DB2 Interview Questions - Part 1DB2 Interview Questions - Part 1
DB2 Interview Questions - Part 1
 
Sap Interview Questions - Part 1
Sap Interview Questions - Part 1Sap Interview Questions - Part 1
Sap Interview Questions - Part 1
 
Dot Net Interview Questions - Part 1
Dot Net Interview Questions - Part 1Dot Net Interview Questions - Part 1
Dot Net Interview Questions - Part 1
 
PeopleSoft Interview Questions - Part 1
PeopleSoft Interview Questions - Part 1PeopleSoft Interview Questions - Part 1
PeopleSoft Interview Questions - Part 1
 
Resume Writing Skills
Resume Writing SkillsResume Writing Skills
Resume Writing Skills
 
Interview Process
Interview ProcessInterview Process
Interview Process
 
Recruitment skills
Recruitment skillsRecruitment skills
Recruitment skills
 
Basic Interview Questions
Basic Interview QuestionsBasic Interview Questions
Basic Interview Questions
 
Career Development Tips
Career Development TipsCareer Development Tips
Career Development Tips
 

Recently uploaded

133. Reviewer Certificate in Advances in Research
133. Reviewer Certificate in Advances in Research133. Reviewer Certificate in Advances in Research
133. Reviewer Certificate in Advances in Research
Manu Mitra
 
131. Reviewer Certificate in BP International
131. Reviewer Certificate in BP International131. Reviewer Certificate in BP International
131. Reviewer Certificate in BP International
Manu Mitra
 
Widal Agglutination Test: A rapid serological diagnosis of typhoid fever
Widal Agglutination Test: A rapid serological diagnosis of typhoid feverWidal Agglutination Test: A rapid serological diagnosis of typhoid fever
Widal Agglutination Test: A rapid serological diagnosis of typhoid fever
taexnic
 
欧洲杯投注网站-欧洲杯投注网站推荐-欧洲杯投注网站| 立即访问【ac123.net】
欧洲杯投注网站-欧洲杯投注网站推荐-欧洲杯投注网站| 立即访问【ac123.net】欧洲杯投注网站-欧洲杯投注网站推荐-欧洲杯投注网站| 立即访问【ac123.net】
欧洲杯投注网站-欧洲杯投注网站推荐-欧洲杯投注网站| 立即访问【ac123.net】
foismail170
 
Brand Identity For A Sportscaster Project and Portfolio I
Brand Identity For A Sportscaster Project and Portfolio IBrand Identity For A Sportscaster Project and Portfolio I
Brand Identity For A Sportscaster Project and Portfolio I
thomasaolson2000
 
15385-LESSON PLAN- 7TH - SS-Insian Constitution an Introduction.pdf
15385-LESSON PLAN- 7TH - SS-Insian Constitution an Introduction.pdf15385-LESSON PLAN- 7TH - SS-Insian Constitution an Introduction.pdf
15385-LESSON PLAN- 7TH - SS-Insian Constitution an Introduction.pdf
gobogo3542
 
salivary gland disorders.pdf nothing more
salivary gland disorders.pdf nothing moresalivary gland disorders.pdf nothing more
salivary gland disorders.pdf nothing more
GokulnathMbbs
 
134. Reviewer Certificate in Computer Science
134. Reviewer Certificate in Computer Science134. Reviewer Certificate in Computer Science
134. Reviewer Certificate in Computer Science
Manu Mitra
 
Personal Brand exploration KE.pdf for assignment
Personal Brand exploration KE.pdf for assignmentPersonal Brand exploration KE.pdf for assignment
Personal Brand exploration KE.pdf for assignment
ragingokie
 
How Mentoring Elevates Your PM Career | PMI Silver Spring Chapter
How Mentoring Elevates Your PM Career | PMI Silver Spring ChapterHow Mentoring Elevates Your PM Career | PMI Silver Spring Chapter
How Mentoring Elevates Your PM Career | PMI Silver Spring Chapter
Hector Del Castillo, CPM, CPMM
 
132. Acta Scientific Pharmaceutical Sciences
132. Acta Scientific Pharmaceutical Sciences132. Acta Scientific Pharmaceutical Sciences
132. Acta Scientific Pharmaceutical Sciences
Manu Mitra
 
How to Master LinkedIn for Career and Business
How to Master LinkedIn for Career and BusinessHow to Master LinkedIn for Career and Business
How to Master LinkedIn for Career and Business
ideatoipo
 
DIGITAL MARKETING COURSE IN CHENNAI.pptx
DIGITAL MARKETING COURSE IN CHENNAI.pptxDIGITAL MARKETING COURSE IN CHENNAI.pptx
DIGITAL MARKETING COURSE IN CHENNAI.pptx
FarzanaRbcomcs
 
han han widi kembar tapi beda han han dan widi kembar tapi sama
han han widi kembar tapi beda han han dan widi kembar tapi samahan han widi kembar tapi beda han han dan widi kembar tapi sama
han han widi kembar tapi beda han han dan widi kembar tapi sama
IrlanMalik
 
Full Sail_Morales_Michael_SMM_2024-05.pptx
Full Sail_Morales_Michael_SMM_2024-05.pptxFull Sail_Morales_Michael_SMM_2024-05.pptx
Full Sail_Morales_Michael_SMM_2024-05.pptx
mmorales2173
 
New Explore Careers and College Majors 2024.pdf
New Explore Careers and College Majors 2024.pdfNew Explore Careers and College Majors 2024.pdf
New Explore Careers and College Majors 2024.pdf
Dr. Mary Askew
 
Luke Royak's Personal Brand Exploration!
Luke Royak's Personal Brand Exploration!Luke Royak's Personal Brand Exploration!
Luke Royak's Personal Brand Exploration!
LukeRoyak
 
Heidi Livengood Resume Senior Technical Recruiter / HR Generalist
Heidi Livengood Resume Senior Technical Recruiter / HR GeneralistHeidi Livengood Resume Senior Technical Recruiter / HR Generalist
Heidi Livengood Resume Senior Technical Recruiter / HR Generalist
HeidiLivengood
 
Operating system. short answes and Interview questions .pdf
Operating system. short answes and Interview questions .pdfOperating system. short answes and Interview questions .pdf
Operating system. short answes and Interview questions .pdf
harikrishnahari6276
 
135. Reviewer Certificate in Journal of Engineering
135. Reviewer Certificate in Journal of Engineering135. Reviewer Certificate in Journal of Engineering
135. Reviewer Certificate in Journal of Engineering
Manu Mitra
 

Recently uploaded (20)

133. Reviewer Certificate in Advances in Research
133. Reviewer Certificate in Advances in Research133. Reviewer Certificate in Advances in Research
133. Reviewer Certificate in Advances in Research
 
131. Reviewer Certificate in BP International
131. Reviewer Certificate in BP International131. Reviewer Certificate in BP International
131. Reviewer Certificate in BP International
 
Widal Agglutination Test: A rapid serological diagnosis of typhoid fever
Widal Agglutination Test: A rapid serological diagnosis of typhoid feverWidal Agglutination Test: A rapid serological diagnosis of typhoid fever
Widal Agglutination Test: A rapid serological diagnosis of typhoid fever
 
欧洲杯投注网站-欧洲杯投注网站推荐-欧洲杯投注网站| 立即访问【ac123.net】
欧洲杯投注网站-欧洲杯投注网站推荐-欧洲杯投注网站| 立即访问【ac123.net】欧洲杯投注网站-欧洲杯投注网站推荐-欧洲杯投注网站| 立即访问【ac123.net】
欧洲杯投注网站-欧洲杯投注网站推荐-欧洲杯投注网站| 立即访问【ac123.net】
 
Brand Identity For A Sportscaster Project and Portfolio I
Brand Identity For A Sportscaster Project and Portfolio IBrand Identity For A Sportscaster Project and Portfolio I
Brand Identity For A Sportscaster Project and Portfolio I
 
15385-LESSON PLAN- 7TH - SS-Insian Constitution an Introduction.pdf
15385-LESSON PLAN- 7TH - SS-Insian Constitution an Introduction.pdf15385-LESSON PLAN- 7TH - SS-Insian Constitution an Introduction.pdf
15385-LESSON PLAN- 7TH - SS-Insian Constitution an Introduction.pdf
 
salivary gland disorders.pdf nothing more
salivary gland disorders.pdf nothing moresalivary gland disorders.pdf nothing more
salivary gland disorders.pdf nothing more
 
134. Reviewer Certificate in Computer Science
134. Reviewer Certificate in Computer Science134. Reviewer Certificate in Computer Science
134. Reviewer Certificate in Computer Science
 
Personal Brand exploration KE.pdf for assignment
Personal Brand exploration KE.pdf for assignmentPersonal Brand exploration KE.pdf for assignment
Personal Brand exploration KE.pdf for assignment
 
How Mentoring Elevates Your PM Career | PMI Silver Spring Chapter
How Mentoring Elevates Your PM Career | PMI Silver Spring ChapterHow Mentoring Elevates Your PM Career | PMI Silver Spring Chapter
How Mentoring Elevates Your PM Career | PMI Silver Spring Chapter
 
132. Acta Scientific Pharmaceutical Sciences
132. Acta Scientific Pharmaceutical Sciences132. Acta Scientific Pharmaceutical Sciences
132. Acta Scientific Pharmaceutical Sciences
 
How to Master LinkedIn for Career and Business
How to Master LinkedIn for Career and BusinessHow to Master LinkedIn for Career and Business
How to Master LinkedIn for Career and Business
 
DIGITAL MARKETING COURSE IN CHENNAI.pptx
DIGITAL MARKETING COURSE IN CHENNAI.pptxDIGITAL MARKETING COURSE IN CHENNAI.pptx
DIGITAL MARKETING COURSE IN CHENNAI.pptx
 
han han widi kembar tapi beda han han dan widi kembar tapi sama
han han widi kembar tapi beda han han dan widi kembar tapi samahan han widi kembar tapi beda han han dan widi kembar tapi sama
han han widi kembar tapi beda han han dan widi kembar tapi sama
 
Full Sail_Morales_Michael_SMM_2024-05.pptx
Full Sail_Morales_Michael_SMM_2024-05.pptxFull Sail_Morales_Michael_SMM_2024-05.pptx
Full Sail_Morales_Michael_SMM_2024-05.pptx
 
New Explore Careers and College Majors 2024.pdf
New Explore Careers and College Majors 2024.pdfNew Explore Careers and College Majors 2024.pdf
New Explore Careers and College Majors 2024.pdf
 
Luke Royak's Personal Brand Exploration!
Luke Royak's Personal Brand Exploration!Luke Royak's Personal Brand Exploration!
Luke Royak's Personal Brand Exploration!
 
Heidi Livengood Resume Senior Technical Recruiter / HR Generalist
Heidi Livengood Resume Senior Technical Recruiter / HR GeneralistHeidi Livengood Resume Senior Technical Recruiter / HR Generalist
Heidi Livengood Resume Senior Technical Recruiter / HR Generalist
 
Operating system. short answes and Interview questions .pdf
Operating system. short answes and Interview questions .pdfOperating system. short answes and Interview questions .pdf
Operating system. short answes and Interview questions .pdf
 
135. Reviewer Certificate in Journal of Engineering
135. Reviewer Certificate in Journal of Engineering135. Reviewer Certificate in Journal of Engineering
135. Reviewer Certificate in Journal of Engineering
 

C, C++ Interview Questions Part - 1

  • 2. Page  2 1. What is C++? Released in 1985, C++ is an object-oriented programming language created by Bjarne Stroustrup. C++ maintains almost all aspects of the C language, while simplifying memory management and adding several features - including a new datatype known as a class (you will learn more about these later) - to allow object-oriented programming. C++ maintains the features of C which allowed for low-level memory access but also gives the programmer new tools to simplify memory management. C++ used for: C++ is a powerful general-purpose programming language. It can be used to create small programs or large applications. It can be used to make CGI scripts or console-only DOS programs. C++ allows you to create programs to do almost anything you need to do. The creator of C++, Bjarne Stroustrup, has put together a partial list of applications written in C++.
  • 3. Page  3 2. How do you find out if a linked-list has an end? (i.e. the list is not a cycle)? You can find out by using 2 pointers. One of them goes 2 nodes each time. The second one goes at 1 nodes each time. If there is a cycle, the one that goes 2 nodes each time will eventually meet the one that goes slower. If that is the case, then you will know the linked-list is a cycle. 3. What is the difference between realloc() and free()? The free subroutine frees a block of memory previously allocated by the malloc subroutine. Undefined results occur if the Pointer parameter is not a valid pointer. If the Pointer parameter is a null value, no action will occur. The realloc subroutine changes the size of the block of memory pointed to by the Pointer parameter to the number of bytes specified by the Size parameter and returns a new pointer to the block. The pointer specified by the Pointer parameter must have been created with the malloc, calloc, or realloc subroutines and not been deallocated with the free or realloc subroutines. Undefined results occur if the Pointer parameter is not a valid pointer.
  • 4. Page  4 4. What is function overloading and operator overloading? Function overloading: C++ enables several functions of the same name to be defined, as long as these functions have different sets of parameters (at least as far as their types are concerned). This capability is called function overloading. When an overloaded function is called, the C++ compiler selects the proper function by examining the number, types and order of the arguments in the call. Function overloading is commonly used to create several functions of the same name that perform similar tasks but on different data types. Operator overloading allows existing C++ operators to be redefined so that they work on objects of user-defined classes. Overloaded operators are syntactic sugar for equivalent function calls. They form a pleasant facade that doesn't add anything fundamental to the language (but they can improve understandability and reduce maintenance costs).
  • 5. Page  5 5. What is the difference between declaration and definition? The declaration tells the compiler that at some later point we plan to present the definition of this declaration. E.g.: void stars () //function declaration The definition contains the actual implementation. E.g.: void stars () // declarator { for(int j=10; j > =0; j--) //function body cout << *; cout << endl; } 6. What are the advantages of inheritance? It permits code reusability. Reusability saves time in program development. It encourages the reuse of proven and debugged high-quality software, thus reducing problem after a system becomes functional.
  • 6. Page  6 7. Define Storage Classes and explain application domain? Register: tell to the compiler for use a CPU register for fast aceess for that variable. Auto: It's a variable created and initialized when it is defined. It is not visible outside of the block. Static: defined inside of the function retain its value between calls. Always is initialized with 0. Defined as global in a file is visible on for the functions from that file. Extern : The definition of the variable is in another file. 8. Define a "dangling" pointer? Dangling pointer is obtained by using the address of an object which was freed. 9. Any difference between "const int*ptr" and int *const ptr" ? Yes, it's a major difference. First define a constant data and second define a constant pointer.
  • 7. Page  7 10. Define the Storage Qualifiers? const - define a variable that can not change its value along the program execution. volatile - define a variable that can be changed indirectly. An example can be a counter register that is updated by hardware. mutuable - a member of a structure or object can be changed even if the structure, for example is declared const: Ex: struct complex {mutuable int x; int y;}; const complex Mycomplex = {1, 2}; Mycomplex.x = 3; /* correct */ 11. Does c++ support multilevel and multiple inheritance? Yes.
  • 8. Page  8 12. What is the difference between an ARRAY and a LIST? Array is collection of homogeneous elements. List is collection of heterogeneous elements. For Array memory allocated is static and continuous. For List memory allocated is dynamic and Random. Array: User need not have to keep in track of next memory allocation. List: User has to keep in Track of next location where memory is allocated. 13. Define a constructor - What it is and how it might be called. constructor is a member function of the class, with the name of the function being the same as the class name. It also specifies how the object should be initialized. Ways of calling constructor: 1) Implicitly: automatically by complier when an object is created. 2) Calling the constructors explicitly is possible, but it makes the code unverifiable.
  • 9. Page  9 14. What is a template? Templates allow to create generic functions that admit any data type as parameters and return value without having to overload the function with all the possible data types. Until certain point they fulfill the functionality of a macro. Its prototype is any of the two following ones: template <class indetifier> function_declaration; template <typename indetifier> function_declaration; The only difference between both prototypes is the use of keyword class or typename, its use is indistinct since both expressions have exactly the same meaning and behave exactly the same way. 15. What is RTTI? Runtime type identification (RTTI) lets you find the dynamic type of an object when you have only a pointer or a reference to the base type. RTTI is the official way in standard C++ to discover the type of an object and to convert the type of a pointer or reference (that is, dynamic typing). The need came from practical experience with C++. RTTI replaces many Interview Questions - Homegrown versions with a solid, consistent approach.
  • 10. Page  10 16. How can you tell what shell you are running on UNIX system? You can do the Echo $RANDOM. It will return a undefined variable if you are from the C-Shell, just a return prompt if you are from the Bourne shell, and a 5 digit random numbers if you are from the Korn shell. You could also do a ps -l and look for the shell with the highest PID. 17. What do you mean by inheritance? Inheritance is the process of creating new classes, called derived classes, from existing classes or base classes. The derived class inherits all the capabilities of the base class, but can add embellishments and refinements of its own. 18. What is Boyce Codd Normal form? A relation schema R is in BCNF with respect to a set F of functional dependencies if for all functional dependencies in F+ of the form a-> , where a and b is a subset of R, at least one of the following holds: * a- > b is a trivial functional dependency (b is a subset of a) * a is a superkey for schema R
  • 11. Page  11 19. What is namespace? Namespaces allow us to group a set of global classes, objects and/or functions under a name. To say it somehow, they serve to split the global scope in sub-scopes known as namespaces. The form to use namespaces is: namespace identifier { namespace-body } Where identifier is any valid identifier and namespace-body is the set of classes, objects and functions that are included within the namespace. For example: namespace general { int a, b; } In this case, a and b are normal variables integrated within the general namespace. In order to access to these variables from outside the namespace we have to use the scope operator ::. For example, to access the previous variables we would have to put: general::a general::b The functionality of namespaces is specially useful in case that there is a possibility that a global object or function can have the same name than another one, causing a redefinition error.
  • 12. Page  12 20. What do you mean by binding of data and functions? Encapsulation. 21. What are virtual functions? A virtual function allows derived classes to replace the implementation provided by the base class. The compiler makes sure the replacement is always called whenever the object in question is actually of the derived class, even if the object is accessed by a base pointer rather than a derived pointer. This allows algorithms in the base class to be replaced in the derived class, even if users don't know about the derived class. 22. What is the difference between an external iterator and an internal iterator? Describe an advantage of an external iterator. An internal iterator is implemented with member functions of the class that has items to step through. .An external iterator is implemented as a separate class that can be "attach" to the object that has items to step through .An external iterator has the advantage that many difference iterators can be active simultaneously on the same object.
  • 13. Page  13 23. What is an HTML tag?  An HTML tag is a syntactical construct in the HTML language that  abbreviates specific instructions to be executed when the HTML script is  loaded into a Web browser.  It is like a method in Java, a function in C++, a procedure in Pascal, or a  subroutine in FORTRAN. 24. How do you decide which integer type to use?   It depends on our requirement.  When we are required an integer to be stored in 1 byte (means less than or  equal to 255) we use short int, for 2 bytes we use int, for 8 bytes we use long  int.  A char is for 1-byte integers, a short is for 2-byte integers, an int is generally  a 2-byte or 4-byte integer (though not necessarily), a long is a 4-byte integer,  and a long long is a 8-byte integer. 25.What is a class?  Class is a user-defined data type in C++. It can be created to solve a  particular kind of problem. After creation the user need not know the specifics  of the working of a class.
  • 14. Page  14 For more details, Please log on to www.rekruitin.com Customer Care : 8855041500 Career Guidance : 9823205144 Tech Support : 7758806112 Human Resource: 9823204144 You can also Find us on: