C Interview Questions

Last Updated: Nov 10, 2023

Table Of Contents

C Interview Questions For Freshers

What is the difference between 'while' and 'do-while' loop in C?

Summary:

Detailed Answer:

What is the purpose of 'enum' in C? Give an example.

Summary:

Detailed Answer:

Explain the concept of 'bitwise operators' in C.

Summary:

Detailed Answer:

Explain the concept of 'recursion' in C with an example.

Summary:

Detailed Answer:

What is a 'file' in C? How can you open and close a file in C?

Summary:

Detailed Answer:

What is the purpose of 'switch' statement in C? Give an example.

Summary:

Detailed Answer:

How are 'strings' represented in C? Give an example.

Summary:

Detailed Answer:

What is 'typedef' in C and how is it used?

Summary:

Detailed Answer:

What is a 'structure' in C? Provide an example.

Summary:

Detailed Answer:

Explain the concept of 'pointers' in C.

Summary:

Detailed Answer:

What is the meaning of 'break' and 'continue' statements in C?

Summary:

Detailed Answer:

What is the difference between 'malloc' and 'calloc' functions in C?

Summary:

Detailed Answer:

How do you initialize a variable in C?

Summary:

Detailed Answer:

What is the purpose of 'if' statement in C? Give an example.

Summary:

Detailed Answer:

What is an 'array' in C? Provide an example.

Summary:

Detailed Answer:

What is a 'function' in C? Provide an example.

Summary:

Detailed Answer:

What is a 'loop' in C? Provide an example.

Summary:

Detailed Answer:

What is the difference between 'int' and 'float' data types in C?

Summary:

Detailed Answer:

What is 'sizeof' operator used for in C?

Summary:

Detailed Answer:

How are variables declared in C?

Summary:

Detailed Answer:

What is the purpose of the 'printf' function in C?

Summary:

Detailed Answer:

Explain the different data types in C.

Summary:

Detailed Answer:

What is the basic syntax of C?

Summary:

Detailed Answer:

Explain the concept of 'typecasting' in C with examples.

Summary:

Detailed Answer:

What are 'bit fields' in C? Give an example.

Summary:

Detailed Answer:

How do you declare and use 'global variables' in C?

Summary:

Detailed Answer:

What is 'scope' of a variable in C?

Summary:

Detailed Answer:

What is 'pass by value' and 'pass by reference' in C?

Summary:

Detailed Answer:

Explain the 'preprocessor directives' in C.

Summary:

Detailed Answer:

What is 'static' keyword used for in C?

Summary:

Detailed Answer:

How are 'constants' defined in C?

Summary:

Detailed Answer:

C Intermediate Interview Questions

What is 'memory leak' in C? How can it be prevented?

Summary:

Detailed Answer:

What is 'structure padding' in C? Why does it occur?

Summary:

Detailed Answer:

What is 'variable length argument' in C? How is it declared and used?

Summary:

Detailed Answer:

Explain the concept of 'bit fields' and their advantages in C.

Summary:

Detailed Answer:

What is 'const pointer' and 'pointer to const'? Explain how they differ.

Summary:

Detailed Answer:

Explain the 'ternary operator' in C with an example.

Summary:

Detailed Answer:

What is 'typecasting' in C? Explain the difference between implicit and explicit typecasting.

Summary:

Detailed Answer:

What are 'bitwise shift operators' in C? Provide examples of left and right shift.

Summary:

Detailed Answer:

What is 'function prototype' in C? How is it declared?

Summary:

Detailed Answer:

What is 'dynamic initialization' of objects in C? Give an example.

Summary:

Detailed Answer:

Explain the 'sizeof' operator and its usage in C.

Summary:

Detailed Answer:

What are 'multidimensional arrays' in C? How are they declared and accessed?

Summary:

Detailed Answer:

What is the difference between 'shallow copy' and 'deep copy'?

Summary:

Detailed Answer:

What is the purpose of 'extern' keyword in C?

Summary:

Detailed Answer:

Explain the concept of 'unions' in C with an example.

Summary:

Detailed Answer:

What are 'typedef struct' and 'struct' declarations used for in C? Give an example.

Summary:

Detailed Answer:

What is 'inline function' in C? How is it different from a regular function?

Summary:

Detailed Answer:

What is 'static variable' and 'static function' in C? Give an example.

Summary:

Detailed Answer:

What is 'function overloading' in C? Is it supported?

Summary:

Detailed Answer:

Explain the 'scope resolution' operator in C with an example.

Summary:

Detailed Answer:

What are 'macros' and how are they defined in C? Give an example.

Summary:

Detailed Answer:

What are 'bit manipulation' and 'bitwise operators' used for in C? Provide examples.

Summary:

Detailed Answer:

What is 'volatile' keyword used for in C?

Summary:

Detailed Answer:

Explain the concept of 'pointer arithmetic' in C.

Summary:

Detailed Answer:

What is 'file handling' in C? Explain with an example.

Summary:

Detailed Answer:

What are 'recursion' and 'iteration'? Compare their advantages and disadvantages in C.

Summary:

Detailed Answer:

Explain the concept of 'dynamic memory allocation' in C.

Summary:

Detailed Answer:

What are 'function pointers' in C? Give an example.

Summary:

Detailed Answer:

C Interview Questions For Experienced

Explain the concept of 'function template' and 'class template' in C++.

Summary:

Detailed Answer:

What is 'threading' in C? How can it be implemented?

Summary:

Detailed Answer:

What is 'exception handling' in C? Is it supported?

Summary:

Detailed Answer:

Explain the 'unions inside structures' concept in C with an example.

Summary:

Detailed Answer:

What are 'linked lists' in C? How are they implemented?

Summary:

Detailed Answer:

What is 'passing functions as arguments' in C? Give an example.

Summary:

Detailed Answer:

Explain the concept of 'dynamic memory allocation' and 'garbage collection' in C.

Summary:

Detailed Answer:

What are 'function pointers' and 'function pointer arrays' in C? Provide examples.

Summary:

Detailed Answer:

What is 'operator overloading' in C? Give examples of different types of overloaded operators.

Summary:

Detailed Answer:

Explain the difference between 'references' and 'pointers' in C++.

Summary:

Detailed Answer:

Explain the 'copy elision' and 'move semantics' in C++.

Summary:

Detailed Answer:

What is 'compile-time polymorphism' and 'run-time polymorphism'? Compare and give examples.

Summary:

Detailed Answer:

What is 'lvalue' and 'rvalue' in C++? Explain their significance.

Summary:

Detailed Answer:

What is 'friend function' and 'friend class' in C++? How are they used?

Summary:

Detailed Answer:

Explain the 'scope resolution' operator and 'this' pointer in C++.

Summary:

Detailed Answer:

What are 'templates' and 'generic programming' in C++? Provide examples.

Summary:

Detailed Answer:

What is 'namespace' in C++? How does it help in avoiding naming conflicts?

Summary:

Detailed Answer:

Explain the concept of 'function overloading' and 'operator overloading' in C++.

Summary:

Detailed Answer:

What is 'operator precedence' and 'associativity' in C? Give examples.

Summary:

Detailed Answer:

What is 'RTTI' in C++? How is it used?

Summary:

Detailed Answer:

What are 'function objects' in C++? How are they implemented?

Summary:

Detailed Answer:

What is 'copy constructor' and 'copy assignment operator' in C++? Explain their usage.

Summary:

Detailed Answer:

Explain the concept of 'exceptions' and 'exception handling' in C++. How are exceptions caught and thrown?

Summary:

Detailed Answer:

What are 'file streams' in C++? How are they used for input/output?

Summary:

Detailed Answer:

What is 'template specialization' in C++? Give an example.

Summary:

Detailed Answer:

Explain the 'preprocessor macros' and 'conditional compilation' in C.

Summary:

Detailed Answer:

What is 'friend function' and 'friend class' in C? How are they used?

Summary:

Detailed Answer:

What are 'virtual functions' and 'pure virtual functions' in C++? Give examples.

Summary:

Detailed Answer:

Explain the concept of 'polymorphism' in C with examples.

Summary:

Detailed Answer:

What is 'multiple inheritance' in C? How does it work?

Summary:

Detailed Answer: