SlideShare a Scribd company logo
1 of 15
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

ZIO-Direct - Functional Scala 2022
ZIO-Direct - Functional Scala 2022ZIO-Direct - Functional Scala 2022
ZIO-Direct - Functional Scala 2022Alexander Ioffe
 
OPERATOR OVERLOADING IN C++
OPERATOR OVERLOADING IN C++OPERATOR OVERLOADING IN C++
OPERATOR OVERLOADING IN C++Aabha Tiwari
 
The Art of Unit Testing - Towards a Testable Design
The Art of Unit Testing - Towards a Testable DesignThe Art of Unit Testing - Towards a Testable Design
The Art of Unit Testing - Towards a Testable DesignVictor Rentea
 
OOP in C++
OOP in C++OOP in C++
OOP in C++ppd1961
 
Clean code and Code Smells
Clean code and Code SmellsClean code and Code Smells
Clean code and Code SmellsMario Sangiorgio
 
Python Interview Questions And Answers
Python Interview Questions And AnswersPython Interview Questions And Answers
Python Interview Questions And AnswersH2Kinfosys
 
Memory Management C++ (Peeling operator new() and delete())
Memory Management C++ (Peeling operator new() and delete())Memory Management C++ (Peeling operator new() and delete())
Memory Management C++ (Peeling operator new() and delete())Sameer Rathoud
 
Clean Lambdas & Streams in Java8
Clean Lambdas & Streams in Java8Clean Lambdas & Streams in Java8
Clean Lambdas & Streams in Java8Victor Rentea
 
Windows Debugging with WinDbg
Windows Debugging with WinDbgWindows Debugging with WinDbg
Windows Debugging with WinDbgArno Huetter
 
Java 8 Lambda Built-in Functional Interfaces
Java 8 Lambda Built-in Functional InterfacesJava 8 Lambda Built-in Functional Interfaces
Java 8 Lambda Built-in Functional InterfacesGanesh Samarthyam
 

What's hot (20)

cs8251 unit 1 ppt
cs8251 unit 1 pptcs8251 unit 1 ppt
cs8251 unit 1 ppt
 
ZIO-Direct - Functional Scala 2022
ZIO-Direct - Functional Scala 2022ZIO-Direct - Functional Scala 2022
ZIO-Direct - Functional Scala 2022
 
Php oop presentation
Php   oop presentationPhp   oop presentation
Php oop presentation
 
OPERATOR OVERLOADING IN C++
OPERATOR OVERLOADING IN C++OPERATOR OVERLOADING IN C++
OPERATOR OVERLOADING IN C++
 
The Art of Unit Testing - Towards a Testable Design
The Art of Unit Testing - Towards a Testable DesignThe Art of Unit Testing - Towards a Testable Design
The Art of Unit Testing - Towards a Testable Design
 
OOP in C++
OOP in C++OOP in C++
OOP in C++
 
Java Generics - by Example
Java Generics - by ExampleJava Generics - by Example
Java Generics - by Example
 
Clean code and Code Smells
Clean code and Code SmellsClean code and Code Smells
Clean code and Code Smells
 
Python Interview Questions And Answers
Python Interview Questions And AnswersPython Interview Questions And Answers
Python Interview Questions And Answers
 
Memory Management C++ (Peeling operator new() and delete())
Memory Management C++ (Peeling operator new() and delete())Memory Management C++ (Peeling operator new() and delete())
Memory Management C++ (Peeling operator new() and delete())
 
Java interfaces
Java interfacesJava interfaces
Java interfaces
 
Clean Lambdas & Streams in Java8
Clean Lambdas & Streams in Java8Clean Lambdas & Streams in Java8
Clean Lambdas & Streams in Java8
 
rx-java-presentation
rx-java-presentationrx-java-presentation
rx-java-presentation
 
C++ Interview Questions
C++ Interview QuestionsC++ Interview Questions
C++ Interview Questions
 
Spring boot jpa
Spring boot jpaSpring boot jpa
Spring boot jpa
 
Dependency Injection
Dependency InjectionDependency Injection
Dependency Injection
 
React Hooks
React HooksReact Hooks
React Hooks
 
Windows Debugging with WinDbg
Windows Debugging with WinDbgWindows Debugging with WinDbg
Windows Debugging with WinDbg
 
Pointer to function 1
Pointer to function 1Pointer to function 1
Pointer to function 1
 
Java 8 Lambda Built-in Functional Interfaces
Java 8 Lambda Built-in Functional InterfacesJava 8 Lambda Built-in Functional Interfaces
Java 8 Lambda Built-in Functional Interfaces
 

Viewers also liked

C++ questions and answers
C++ questions and answersC++ questions and answers
C++ questions and answersDeepak Singh
 
C++ questions And Answer
C++ questions And AnswerC++ questions And Answer
C++ questions And Answerlavparmar007
 
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 2013srikanthreddy004
 
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 QuestionsGradeup
 
Geometry formula sheet
Geometry formula sheetGeometry formula sheet
Geometry formula sheetsidraqasim99
 
C programming interview questions
C programming interview questionsC programming interview questions
C programming interview questionsadarshynl
 
Geometry formula-sheet
Geometry formula-sheetGeometry formula-sheet
Geometry formula-sheetadheera dra
 
Probability Formula sheet
Probability Formula sheetProbability Formula sheet
Probability Formula sheetHaris Hassan
 
Notes and-formulae-mathematics
Notes and-formulae-mathematicsNotes and-formulae-mathematics
Notes and-formulae-mathematicsRagulan Dev
 
Top C Language Interview Questions and Answer
Top C Language Interview Questions and AnswerTop C Language Interview Questions and Answer
Top C Language Interview Questions and AnswerVineet Kumar Saini
 
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 - JavaTpointJavaTpoint.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 Answersiimjobs 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
 

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
 
Top C Language Interview Questions and Answer
Top C Language Interview Questions and AnswerTop C Language Interview Questions and Answer
Top C Language Interview Questions and Answer
 
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 ...
 

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-answersAkash Gawali
 
C++ Interview Question And Answer
C++ Interview Question And AnswerC++ Interview Question And Answer
C++ Interview Question And AnswerJagan 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.docabdulhaq467432
 
cbybalaguruswami-e-180803051831.pptx
cbybalaguruswami-e-180803051831.pptxcbybalaguruswami-e-180803051831.pptx
cbybalaguruswami-e-180803051831.pptxSRamadossbiher
 
cbybalaguruswami-e-180803051831.pptx
cbybalaguruswami-e-180803051831.pptxcbybalaguruswami-e-180803051831.pptx
cbybalaguruswami-e-180803051831.pptxSRamadossbiher
 
Tcs NQTExam technical questions
Tcs NQTExam technical questionsTcs NQTExam technical questions
Tcs NQTExam technical questionsAniketBhandare2
 
C questions
C questionsC questions
C questionsparm112
 
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 kellaManoj Kumar kothagulla
 
Introduction to C++ Programming
Introduction to C++ ProgrammingIntroduction to C++ Programming
Introduction to C++ ProgrammingPreeti 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
 
Technical_Interview_Questions.pdf
Technical_Interview_Questions.pdfTechnical_Interview_Questions.pdf
Technical_Interview_Questions.pdfadityashukla939020
 
C interview questions
C interview questionsC interview questions
C interview questionsSoba Arjun
 

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 RoundReKruiTIn.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 NegotiationReKruiTIn.com
 
Tips on Group Discussion
Tips on Group DiscussionTips on Group Discussion
Tips on Group DiscussionReKruiTIn.com
 
Importance of Cover Letter
Importance of Cover LetterImportance of Cover Letter
Importance of Cover LetterReKruiTIn.com
 
Mistakes to avoid in Job Interview
Mistakes to avoid in  Job InterviewMistakes to avoid in  Job Interview
Mistakes to avoid in Job InterviewReKruiTIn.com
 
DB2 Interview Questions - Part 1
DB2 Interview Questions - Part 1DB2 Interview Questions - Part 1
DB2 Interview Questions - Part 1ReKruiTIn.com
 
Sap Interview Questions - Part 1
Sap Interview Questions - Part 1Sap Interview Questions - Part 1
Sap Interview Questions - Part 1ReKruiTIn.com
 
Dot Net Interview Questions - Part 1
Dot Net Interview Questions - Part 1Dot Net Interview Questions - Part 1
Dot Net Interview Questions - Part 1ReKruiTIn.com
 
PeopleSoft Interview Questions - Part 1
PeopleSoft Interview Questions - Part 1PeopleSoft Interview Questions - Part 1
PeopleSoft Interview Questions - Part 1ReKruiTIn.com
 
Resume Writing Skills
Resume Writing SkillsResume Writing Skills
Resume Writing SkillsReKruiTIn.com
 
Basic Interview Questions
Basic Interview QuestionsBasic Interview Questions
Basic Interview QuestionsReKruiTIn.com
 
Career Development Tips
Career Development TipsCareer Development Tips
Career Development TipsReKruiTIn.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

Escort Service Andheri WhatsApp:+91-9833363713
Escort Service Andheri WhatsApp:+91-9833363713Escort Service Andheri WhatsApp:+91-9833363713
Escort Service Andheri WhatsApp:+91-9833363713Riya Pathan
 
Abanoub Ghobrial, Planning Team Leader.pdf
Abanoub Ghobrial, Planning Team Leader.pdfAbanoub Ghobrial, Planning Team Leader.pdf
Abanoub Ghobrial, Planning Team Leader.pdfAbanoubGhobrial1
 
LinkedIn Strategic Guidelines April 2024
LinkedIn Strategic Guidelines April 2024LinkedIn Strategic Guidelines April 2024
LinkedIn Strategic Guidelines April 2024Bruce Bennett
 
Protection of Children in context of IHL and Counter Terrorism
Protection of Children in context of IHL and  Counter TerrorismProtection of Children in context of IHL and  Counter Terrorism
Protection of Children in context of IHL and Counter TerrorismNilendra Kumar
 
Thomas Calculus 12th Edition Textbook and helping material
Thomas Calculus 12th Edition Textbook and helping materialThomas Calculus 12th Edition Textbook and helping material
Thomas Calculus 12th Edition Textbook and helping materialsafdarhussainbhutta4
 
Crack JAG. Guidance program for entry to JAG Dept. & SSB interview
Crack JAG. Guidance program for entry to JAG Dept. & SSB interviewCrack JAG. Guidance program for entry to JAG Dept. & SSB interview
Crack JAG. Guidance program for entry to JAG Dept. & SSB interviewNilendra Kumar
 
办理哈珀亚当斯大学学院毕业证书文凭学位证书
办理哈珀亚当斯大学学院毕业证书文凭学位证书办理哈珀亚当斯大学学院毕业证书文凭学位证书
办理哈珀亚当斯大学学院毕业证书文凭学位证书saphesg8
 
The Next Things To Immediately Do About Mating Press
The Next Things To Immediately Do About Mating PressThe Next Things To Immediately Do About Mating Press
The Next Things To Immediately Do About Mating Pressmatingpress170
 
AICTE PPT slide of Engineering college kr pete
AICTE PPT slide of Engineering college kr peteAICTE PPT slide of Engineering college kr pete
AICTE PPT slide of Engineering college kr peteshivubhavv
 
Storytelling, Ethics and Workflow in Documentary Photography
Storytelling, Ethics and Workflow in Documentary PhotographyStorytelling, Ethics and Workflow in Documentary Photography
Storytelling, Ethics and Workflow in Documentary PhotographyOrtega Alikwe
 
格里菲斯大学毕业证(Griffith毕业证)#文凭成绩单#真实留信学历认证永久存档
格里菲斯大学毕业证(Griffith毕业证)#文凭成绩单#真实留信学历认证永久存档格里菲斯大学毕业证(Griffith毕业证)#文凭成绩单#真实留信学历认证永久存档
格里菲斯大学毕业证(Griffith毕业证)#文凭成绩单#真实留信学历认证永久存档208367051
 
Career-Orientation-for-Grade-9-and-10.pptx
Career-Orientation-for-Grade-9-and-10.pptxCareer-Orientation-for-Grade-9-and-10.pptx
Career-Orientation-for-Grade-9-and-10.pptxGachaFluffy
 
办理老道明大学毕业证成绩单|购买美国ODU文凭证书
办理老道明大学毕业证成绩单|购买美国ODU文凭证书办理老道明大学毕业证成绩单|购买美国ODU文凭证书
办理老道明大学毕业证成绩单|购买美国ODU文凭证书saphesg8
 
办澳洲詹姆斯库克大学毕业证成绩单pdf电子版制作修改
办澳洲詹姆斯库克大学毕业证成绩单pdf电子版制作修改办澳洲詹姆斯库克大学毕业证成绩单pdf电子版制作修改
办澳洲詹姆斯库克大学毕业证成绩单pdf电子版制作修改yuu sss
 
Human Rights are notes and helping material
Human Rights are notes and helping materialHuman Rights are notes and helping material
Human Rights are notes and helping materialnadeemcollege26
 
Pharmacoepidemiology... Pharmacovigilan e
Pharmacoepidemiology... Pharmacovigilan ePharmacoepidemiology... Pharmacovigilan e
Pharmacoepidemiology... Pharmacovigilan esonalinghatmal
 
定制(SCU毕业证书)南十字星大学毕业证成绩单原版一比一
定制(SCU毕业证书)南十字星大学毕业证成绩单原版一比一定制(SCU毕业证书)南十字星大学毕业证成绩单原版一比一
定制(SCU毕业证书)南十字星大学毕业证成绩单原版一比一z xss
 
401799841-Increasing-Crimes-and-Suicides-Among-Youth.pptx
401799841-Increasing-Crimes-and-Suicides-Among-Youth.pptx401799841-Increasing-Crimes-and-Suicides-Among-Youth.pptx
401799841-Increasing-Crimes-and-Suicides-Among-Youth.pptxwaghmare9860lavin
 
原版快速办理MQU毕业证麦考瑞大学毕业证成绩单留信学历认证
原版快速办理MQU毕业证麦考瑞大学毕业证成绩单留信学历认证原版快速办理MQU毕业证麦考瑞大学毕业证成绩单留信学历认证
原版快速办理MQU毕业证麦考瑞大学毕业证成绩单留信学历认证nhjeo1gg
 
Back on Track: Navigating the Return to Work after Parental Leave
Back on Track: Navigating the Return to Work after Parental LeaveBack on Track: Navigating the Return to Work after Parental Leave
Back on Track: Navigating the Return to Work after Parental LeaveMarharyta Nedzelska
 

Recently uploaded (20)

Escort Service Andheri WhatsApp:+91-9833363713
Escort Service Andheri WhatsApp:+91-9833363713Escort Service Andheri WhatsApp:+91-9833363713
Escort Service Andheri WhatsApp:+91-9833363713
 
Abanoub Ghobrial, Planning Team Leader.pdf
Abanoub Ghobrial, Planning Team Leader.pdfAbanoub Ghobrial, Planning Team Leader.pdf
Abanoub Ghobrial, Planning Team Leader.pdf
 
LinkedIn Strategic Guidelines April 2024
LinkedIn Strategic Guidelines April 2024LinkedIn Strategic Guidelines April 2024
LinkedIn Strategic Guidelines April 2024
 
Protection of Children in context of IHL and Counter Terrorism
Protection of Children in context of IHL and  Counter TerrorismProtection of Children in context of IHL and  Counter Terrorism
Protection of Children in context of IHL and Counter Terrorism
 
Thomas Calculus 12th Edition Textbook and helping material
Thomas Calculus 12th Edition Textbook and helping materialThomas Calculus 12th Edition Textbook and helping material
Thomas Calculus 12th Edition Textbook and helping material
 
Crack JAG. Guidance program for entry to JAG Dept. & SSB interview
Crack JAG. Guidance program for entry to JAG Dept. & SSB interviewCrack JAG. Guidance program for entry to JAG Dept. & SSB interview
Crack JAG. Guidance program for entry to JAG Dept. & SSB interview
 
办理哈珀亚当斯大学学院毕业证书文凭学位证书
办理哈珀亚当斯大学学院毕业证书文凭学位证书办理哈珀亚当斯大学学院毕业证书文凭学位证书
办理哈珀亚当斯大学学院毕业证书文凭学位证书
 
The Next Things To Immediately Do About Mating Press
The Next Things To Immediately Do About Mating PressThe Next Things To Immediately Do About Mating Press
The Next Things To Immediately Do About Mating Press
 
AICTE PPT slide of Engineering college kr pete
AICTE PPT slide of Engineering college kr peteAICTE PPT slide of Engineering college kr pete
AICTE PPT slide of Engineering college kr pete
 
Storytelling, Ethics and Workflow in Documentary Photography
Storytelling, Ethics and Workflow in Documentary PhotographyStorytelling, Ethics and Workflow in Documentary Photography
Storytelling, Ethics and Workflow in Documentary Photography
 
格里菲斯大学毕业证(Griffith毕业证)#文凭成绩单#真实留信学历认证永久存档
格里菲斯大学毕业证(Griffith毕业证)#文凭成绩单#真实留信学历认证永久存档格里菲斯大学毕业证(Griffith毕业证)#文凭成绩单#真实留信学历认证永久存档
格里菲斯大学毕业证(Griffith毕业证)#文凭成绩单#真实留信学历认证永久存档
 
Career-Orientation-for-Grade-9-and-10.pptx
Career-Orientation-for-Grade-9-and-10.pptxCareer-Orientation-for-Grade-9-and-10.pptx
Career-Orientation-for-Grade-9-and-10.pptx
 
办理老道明大学毕业证成绩单|购买美国ODU文凭证书
办理老道明大学毕业证成绩单|购买美国ODU文凭证书办理老道明大学毕业证成绩单|购买美国ODU文凭证书
办理老道明大学毕业证成绩单|购买美国ODU文凭证书
 
办澳洲詹姆斯库克大学毕业证成绩单pdf电子版制作修改
办澳洲詹姆斯库克大学毕业证成绩单pdf电子版制作修改办澳洲詹姆斯库克大学毕业证成绩单pdf电子版制作修改
办澳洲詹姆斯库克大学毕业证成绩单pdf电子版制作修改
 
Human Rights are notes and helping material
Human Rights are notes and helping materialHuman Rights are notes and helping material
Human Rights are notes and helping material
 
Pharmacoepidemiology... Pharmacovigilan e
Pharmacoepidemiology... Pharmacovigilan ePharmacoepidemiology... Pharmacovigilan e
Pharmacoepidemiology... Pharmacovigilan e
 
定制(SCU毕业证书)南十字星大学毕业证成绩单原版一比一
定制(SCU毕业证书)南十字星大学毕业证成绩单原版一比一定制(SCU毕业证书)南十字星大学毕业证成绩单原版一比一
定制(SCU毕业证书)南十字星大学毕业证成绩单原版一比一
 
401799841-Increasing-Crimes-and-Suicides-Among-Youth.pptx
401799841-Increasing-Crimes-and-Suicides-Among-Youth.pptx401799841-Increasing-Crimes-and-Suicides-Among-Youth.pptx
401799841-Increasing-Crimes-and-Suicides-Among-Youth.pptx
 
原版快速办理MQU毕业证麦考瑞大学毕业证成绩单留信学历认证
原版快速办理MQU毕业证麦考瑞大学毕业证成绩单留信学历认证原版快速办理MQU毕业证麦考瑞大学毕业证成绩单留信学历认证
原版快速办理MQU毕业证麦考瑞大学毕业证成绩单留信学历认证
 
Back on Track: Navigating the Return to Work after Parental Leave
Back on Track: Navigating the Return to Work after Parental LeaveBack on Track: Navigating the Return to Work after Parental Leave
Back on Track: Navigating the Return to Work after Parental Leave
 

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: