C Programming Study Notes
Interview Questions Overview
C programming interview questions are crucial for candidates to
demonstrate their knowledge in programming skills, covering basic to
advanced topics 1.
Basic Concepts
Features of C:
o Simple and portable
o Mid-level language
o Modularity
o Rich in libraries
o Procedural language
o Built-in operations
o Memory management 2.
Data Types:
o Basic: int, char, float, double
o Derived: Arrays, Pointers
o User-defined: enum, struct, union 3.
Memory Management
Dynamic Memory Allocation Functions:
o malloc: Allocates a block of memory.
o calloc: Allocates multiple blocks of memory initialized to zero.
o realloc: Changes the size of previously allocated memory.
o free: Deallocates memory 4.
Variable Scope
Local Variables: Declared inside functions, accessible only within that
function.
Global Variables: Declared outside functions, accessible by any
function 5.
Pointers
A pointer holds the address of another variable, allowing for efficient
memory access and manipulation. A dangling pointer occurs when a
pointer still points to a memory location after it has been freed 6.
Control Statements
Break Statement: Used to terminate loops or switch statements 7.
Functions
Predefined Functions: Built-in functions like printf and scanf for
output and input 8.
Arrays
An array is a collection of elements of the same data type stored in
contiguous memory locations. Types include one-dimensional, two-
dimensional, and multi-dimensional arrays 9.
Storage Classes
Four types: Automatic, Register, Static, and External 10.
Advanced Topics
Recursion: A function that calls itself 11.
Unions: Special data types that hold different data types at the same
memory location 12.
File Operations: Creating, writing, reading, and deleting files 13.
Sorting Algorithms
Quick Sort: A divide-and-conquer algorithm that sorts elements by
partitioning 14.
Common Programs
Factorial Calculation: Using recursion to compute the factorial of a
number 15.
Fibonacci Series: Generating Fibonacci numbers using loops 16.
Prime Number Check: Checking if a number is prime 17.
String Reversal: Reversing a string using pointers 18.
Removing Duplicates in Array: Deleting duplicate elements from a
sorted array 19.
Linked Lists
Insertion at beginning, end, and specified positions 20.
This summary encapsulates key concepts, definitions, and examples from C
programming, useful for exam preparation and interviews