C Interview Questions

C interview questions test pointers, memory allocation, structures, file handling, and systems programming concepts central to embedded and low-level development. Interviewers use C to check whether you understand what the machine is actually doing, from memory layout to the risks of manual memory management. This page covers 40 real C interview questions with answers across four formats: multiple choice, written answers, spoken responses, and live coding challenges, the same mix used in modern technical interviews.

Practice each question in your browser with no signup required. Answers stay hidden until you attempt the question: type, speak, or code your response first, then compare it against the model answer. Questions range from fundamentals for your first developer job to scenario-based questions for senior roles, so you can find the gaps in your knowledge before the real interview.

40 questions with answersLast updated: Oct 19, 2026
Start a mock interview

How to practice

  1. Choose a question. Pick any of the 40 questions. They mix multiple choice, written, spoken, and coding, the same mix a real interviewer uses.
  2. Attempt your answer. Select a multiple-choice option, type your written response, record a spoken answer, or write code in the editor.
  3. Reveal the model answer. Once you have attempted the question, the model answer unlocks so you can compare it with yours.
  4. Move to the next question. Track how many questions you have attempted with the progress bar at the top of the page.
  5. Take a mock interview. When you are ready, try a full mock technical interview on Plaicer with AI-driven follow-up questions.

C Interview Questions and Answers

0 of 40 attempted
1Multiple choice

How would you characterize C as a programming language and its primary design philosophy?

Attempt the question first to reveal the answer.

2Written answer

Describe C's characteristics as a low-level, procedural language and its design goals for system programming

Attempt the question first to reveal the answer.

3Spoken answer

Walk through how you would debug a segmentation fault in a C program and identify the root cause

This browser cannot record audio. Answer the question out loud anyway, then compare yourself against the model answer below.

Attempt the question first to reveal the answer.

4Coding

Write a function that reverses a string in-place without using library functions

#include <string.h>

void reverse_string(char *str) {
    // Implement string reversal
}

Attempt the question first to reveal the answer.

5Multiple choice

What are the key benefits that make C suitable for systems programming and embedded development?

Attempt the question first to reveal the answer.

6Written answer

Explain pointer mechanics including declaration, dereferencing, and pointer arithmetic

Attempt the question first to reveal the answer.

7Spoken answer

Describe a situation where you used dynamic memory allocation and how you ensured proper cleanup

This browser cannot record audio. Answer the question out loud anyway, then compare yourself against the model answer below.

Attempt the question first to reveal the answer.

8Coding

Allocate a 2D array dynamically and implement functions to set and get values

#include <stdlib.h>

int** allocate_matrix(int rows, int cols) {
    // Allocate matrix
}

void free_matrix(int **matrix, int rows) {
    // Free allocated memory
}

Attempt the question first to reveal the answer.

9Multiple choice

Explain what a pointer is and how it stores memory addresses in C

Attempt the question first to reveal the answer.

10Written answer

Describe how malloc, calloc, and free manage memory at runtime and common pitfalls

Attempt the question first to reveal the answer.

11Spoken answer

Explain how you would implement a linked list data structure from scratch in C

This browser cannot record audio. Answer the question out loud anyway, then compare yourself against the model answer below.

Attempt the question first to reveal the answer.

12Coding

Write a program that reads a file and counts the number of lines

#include <stdio.h>

int count_lines(const char *filename) {
    // Count lines in file
}

Attempt the question first to reveal the answer.

13Multiple choice

How do declaration and definition differ when defining variables and functions in C?

Attempt the question first to reveal the answer.

14Written answer

Explain how structures organize heterogeneous data and how to access structure members

Attempt the question first to reveal the answer.

15Spoken answer

Talk about a time you optimized C code for performance and what techniques you applied

This browser cannot record audio. Answer the question out loud anyway, then compare yourself against the model answer below.

Attempt the question first to reveal the answer.

16Coding

Implement array operations using pointer arithmetic instead of array indexing

#include <stdio.h>

void print_array(int *arr, int size) {
    // Print array using pointer arithmetic
}

Attempt the question first to reveal the answer.

17Multiple choice

What characteristics does a static variable have regarding scope and lifetime?

Attempt the question first to reveal the answer.

18Written answer

Describe arrays, multi-dimensional arrays, and the relationship between arrays and pointers

Attempt the question first to reveal the answer.

19Spoken answer

Describe how you would read structured data from a binary file and parse it correctly

This browser cannot record audio. Answer the question out loud anyway, then compare yourself against the model answer below.

Attempt the question first to reveal the answer.

20Coding

Create a Person structure with name and age, and implement copy and display functions

#include <stdio.h>
#include <string.h>

typedef struct {
    char *name;
    int age;
} Person;

Person* create_person(const char *name, int age) {
    // Create and allocate person
}

Attempt the question first to reveal the answer.

21Multiple choice

How does typedef allow you to create aliases for existing data types?

Attempt the question first to reveal the answer.

22Written answer

Contrast pass-by-value with pass-by-reference using pointers and their implications

Attempt the question first to reveal the answer.

23Spoken answer

Explain how you would handle errors when file operations fail in a production system

This browser cannot record audio. Answer the question out loud anyway, then compare yourself against the model answer below.

Attempt the question first to reveal the answer.

24Coding

Implement a safe string copy function that avoids buffer overflow

#include <string.h>

char* safe_string_copy(const char *source, size_t max_length) {
    // Implement safe copy
}

Attempt the question first to reveal the answer.

25Multiple choice

Explain how structures enable grouping related data of different types together

Attempt the question first to reveal the answer.

26Written answer

Explain variable scope (local, global, static) and their visibility and lifetime

Attempt the question first to reveal the answer.

27Spoken answer

Walk through how you would pass data structures safely between functions using pointers

This browser cannot record audio. Answer the question out loud anyway, then compare yourself against the model answer below.

Attempt the question first to reveal the answer.

28Coding

Implement a comparison callback function for sorting integers

#include <stdlib.h>

int compare_integers(const void *a, const void *b) {
    // Implement comparison
}

Attempt the question first to reveal the answer.

29Multiple choice

How does dynamic memory allocation allow runtime memory requests in C?

Attempt the question first to reveal the answer.

30Written answer

Describe how to read from and write to files, and the importance of closing file handles

Attempt the question first to reveal the answer.

31Spoken answer

Describe how you would implement a generic sorting function using function pointers

This browser cannot record audio. Answer the question out loud anyway, then compare yourself against the model answer below.

Attempt the question first to reveal the answer.

32Coding

Write a wrapper function for malloc that checks for allocation failure

#include <stdlib.h>
#include <stdio.h>

void* safe_malloc(size_t size) {
    // Allocate with error checking
}

Attempt the question first to reveal the answer.

33Multiple choice

What are the differences between malloc and calloc in terms of initialization and usage?

Attempt the question first to reveal the answer.

34Written answer

Explain how macros, conditional compilation, and includes work during preprocessing

Attempt the question first to reveal the answer.

35Spoken answer

Talk about memory alignment and padding in structures and why it matters

This browser cannot record audio. Answer the question out loud anyway, then compare yourself against the model answer below.

Attempt the question first to reveal the answer.

36Coding

Read binary data from a file into a structure array

#include <stdio.h>
#include <stdlib.h>

typedef struct {
    int id;
    float value;
} Record;

Record* read_records(const char *filename, int *count) {
    // Read binary records
}

Attempt the question first to reveal the answer.

37Multiple choice

What role do preprocessor directives like #include and #define play before compilation?

Attempt the question first to reveal the answer.

38Written answer

Discuss why manual memory management requires careful attention to avoid leaks and corruption

Attempt the question first to reveal the answer.

39Spoken answer

Explain how you would debug a memory leak using tools like valgrind

This browser cannot record audio. Answer the question out loud anyway, then compare yourself against the model answer below.

Attempt the question first to reveal the answer.

40Coding

Create a macro that safely swaps two values without a temporary variable

#define SWAP(a, b) \
    // Implement safe swap macro

Attempt the question first to reveal the answer.

Topics covered

  • C fundamentals: design philosophy, declaration vs definition, typedef
  • Pointers: dereferencing, pointer arithmetic, pass-by-pointer
  • Function pointers and callbacks
  • Arrays and strings: multi-dimensional arrays, the array-pointer relationship
  • Dynamic memory: malloc, calloc, free, and common pitfalls
  • Structures: member access, alignment, padding
  • Scope and storage: local, global, static, extern
  • The preprocessor: macros, includes, conditional compilation
  • File I/O: text and binary files, error handling
  • Debugging: segmentation faults, memory leaks, valgrind

Frequently asked questions

How many C interview questions are on this page?
40 real C interview questions across four formats: multiple choice (10), written answer (10), spoken answer (10), and coding (10).
Do I need to sign up to practice?
No. All 40 questions and model answers are free with no signup. You attempt each question first, and the model answer unlocks once you have engaged.
Who are these C interview questions for?
Developers preparing for C technical interviews at any level, from first job to senior engineer roles. Questions cover fundamentals through real-world scenarios.
What topics do the C questions cover?
The questions cover pointers, function pointers, arrays, and strings. They also test dynamic memory allocation, structures, and padding. Other topics include the preprocessor, file I/O, and debugging segmentation faults and memory leaks.
Can I practice coding questions in the browser?
Yes. Coding questions include starter code in an in-browser editor, so you can write your solution without installing anything.
How often are the questions updated?
The question bank is reviewed regularly and updated to reflect current C interview patterns.
Can I take a full mock interview?
Yes. Plaicer's mock technical interview walks you through a realistic 30 to 45 minute interview with AI-driven follow-up questions.
Are these questions useful for embedded systems interviews?
Yes. Topics like pointers, manual memory management, struct padding, and binary file handling come up often in embedded and firmware interviews.

Pick your language

View all programming interview questions

Need to run some C code first?

Online C Compiler

Reading answers is not the same as giving them. Sit a full mock interview and get scored on how you actually explain them.

Try a mock interview