C Programming Interview Prep Questions 1
C Programming Interview Prep Questions 1
Basics Refresher
Datatypes
Qualifiers 1
Operators
Arithmetic Operators
What is the difference between pre and post increment? Show examples.
Logical Operators
Bitwise Operators
Ternary Operator
Usage and example.
WAP to find largest of 2 nos using ternary op
WAP to find largest of 3 nos using ternary op
Switch case
Explain switch case with an good example
Programs
Pattern program 1
5
54
543
5432
54321
Pattern program 2
*
* * *
* * * * *
* * * * * * *
* * * * * * * * *
Ref: https://www.programiz.com/c-programming/examples/pyramid-pattern
int main ()
{
int i = 1, j = 1;
for (--i && j++; i < 10; i += 2)
{
printf ("loop ");
}
return 0;
}
Typecasting
Overflow/Underflow
Pointer Basics
Note: Discuss more concepts including void pointer, NULL pointer, Dynamic memory allocation, Double
pointer, const pointer, Endianess etc in Part 2
Functions
What is the difference between pass by value and pass by reference. Show examples.
Arrays
Recursion
What is the use of extern keyword. Show usage of extern of variables and functions with simple
examples.
Q: What is a static function?
Strings
Overview of string
Why is scanf/gets not recommended to use. Why is fgets recommended. Usage of fgets
Pointers 2
WAP to allocate an integer array of size n. Store values in the array and find its sum.
Void Pointer
const pointer
More topics
2D Array
Basics of 2D arrays
Creation and access
How to pass 2D array to functions
How to Dynamically allocate 2D array of size m x n (Show only both dynamic method)