C Pointers Interview Questions 2026: 30 Q&A With Code

What changed in 2026 drives
Mass-recruiter offer letters are flatter for 2026 batch - the 4-5 LPA ASE band has barely budged in three years while inflation eats real wages. Premium tracks (Digital, Pro, Elite, Specialist) are still where the differential lives, and they are entirely test-driven. If you are aiming higher than the default offer, the coding round is not optional pageantry - it is the entire interview.
What I'd actually study for this
- 01Two solid coding-round answers (1 medium-hard DSA each, with edge-case discussion) > five half-baked ones
- 02One real project you can defend end-to-end - file paths, design decisions, and what you would change
- 03One DBMS schema you actually built (not a textbook ER diagram), with at least 3 join-heavy queries written from memory
- 04Three behavioural STAR stories: failure recovered, conflict handled, ownership taken
Where most candidates trip up
The single biggest mistake is treating company-specific guides as primary prep and DSA as secondary. It is the opposite. Mass recruiters use the test as a filter, but premium tracks at every IT services company use coding to allocate offer band. Spend 70% of prep time on DSA + system fundamentals, 20% on company-specific patterns, 10% on HR rehearsal. Reverse that ratio and you collect the default offer.
Editorial commentary by Aditya Sharma · written for PapersAdda · not generated, not aggregated.
Last Updated: June 2026 | Level: Freshers to Mid-Level | Read Time: ~16 min
In C, pointers are everything: arrays, strings, dynamic memory, and callbacks all run through them. Candidates report that pointer arithmetic, the array-pointer relationship, and malloc/free are guaranteed for embedded and core-CS interviews. This guide covers 30 C pointer questions with full answers and predict-the-output traps. Behaviour reflects the official C language references; confirm any memory semantics on the standard.
Pair this with C Programming Placement Questions and C Output Prediction Questions 2026.
Table of Contents
- Pointer Basics (Q1 to Q9)
- Arrays and Strings (Q10 to Q18)
- Dynamic Memory (Q19 to Q24)
- Function Pointers and Advanced (Q25 to Q30)
- Predict the Output
- Quick Revision Table
- Frequently Asked Questions
Pointer Basics
Q1. What is a pointer in C? Easy
int x = 10;
int *p = &x;
printf("%d", *p); // 10
Q2. What is the size of a pointer? Medium
Q3. What is a null pointer? Easy
Q4. What is a dangling pointer? Medium
Q5. What is a wild pointer? Easy
Q6. What is pointer arithmetic? Medium
Q7. What is a void pointer and its limitation? Medium
Q8. What is the difference between *p++ and (*p)++? Hard
Q9. What is a double pointer? Medium
Arrays and Strings
Q10. What is the relationship between arrays and pointers? Medium
Q11. Why is sizeof(array) different from sizeof(pointer)? Hard
Q12. How are strings represented in C? Easy
Q13. What is the difference between char arr[] and char *p for strings? Hard
Q14. How do you pass an array to a function? Medium
void print(int *a, int n) {
for (int i = 0; i < n; i++) printf("%d ", a[i]);
}
Q15. What is pointer to an array vs array of pointers? Hard
Q16. How do you iterate a string using pointers? Medium
char *s = "abc";
while (*s) { putchar(*s); s++; }
Q17. What does the array name evaluate to? Medium
Q18. Can you change where an array name points? Easy
Dynamic Memory
Q19. What are malloc, calloc, realloc, and free? Medium
Q20. What is the difference between malloc and calloc? Medium
Q21. What happens if you free the same pointer twice? Hard
Q22. What is a memory leak in C? Easy
Q23. Should you cast the result of malloc? Hard
Q24. What does realloc return on failure? Medium
Function Pointers and Advanced
Q25. What is a function pointer? Medium
int add(int a, int b) { return a + b; }
int (*fp)(int, int) = add;
printf("%d", fp(2, 3)); // 5
Q26. How is qsort implemented with function pointers? Hard
Q27. What is a pointer to a const vs a const pointer? Hard
Q28. What is the difference between pass by value and pass by pointer? Medium
Q29. How do you swap two integers using pointers? Medium
void swap(int *a, int *b) {
int t = *a; *a = *b; *b = t;
}
Q30. What is the difference between stack and heap memory? Medium
Predict the Output
Snippet 1
int a[] = {1, 2, 3};
int *p = a;
printf("%d %d", *(p + 1), *p + 1);
Output:
2 2
Why: *(p+1) is the second element (2). *p + 1 is the first element (1) plus 1, also 2 here. Precedence trap that interviewers vary.
Snippet 2
char *s = "hello";
printf("%c", *(s + 1));
printf("%lu", sizeof(s));
Output:
e8
Why: *(s+1) is 'e'. sizeof(s) is the pointer size (8 on 64-bit), not the string length.
Snippet 3
int x = 5, *p = &x, **pp = &p;
**pp = 20;
printf("%d", x);
Output:
20
Why: Double dereference writes through pp to p to x, setting it to 20.
Quick Revision Table
| Concept | Key takeaway |
|---|---|
| array decays | name becomes pointer in expressions |
| sizeof array vs pointer | full size vs pointer size |
| char[] vs char* literal | modifiable vs read-only |
| malloc vs calloc | garbage vs zeroed |
| double free | undefined, set NULL after free |
| const placement | read right to left |
| pass by pointer | enables modifying caller's variable |
Frequently Asked Questions
What C pointer topic is asked most in 2026?
Candidates report that pointer arithmetic, the relationship between arrays and pointers, and dynamic memory with malloc and free are the most repeated C pointer questions for embedded and core-CS roles.
Why are pointers so heavily tested in C interviews?
Because C has no references or smart pointers, so pointers are the only indirection mechanism. Understanding them is essential for arrays, strings, dynamic memory, and function callbacks.
What is the most common C pointer bug?
Dereferencing a dangling or uninitialised pointer, followed by memory leaks from forgetting free and buffer overruns from bad pointer arithmetic. Interviewers test all three.
What is the difference between char arr[] and char *p for a string?
char arr[] copies the literal into a modifiable array, while char *p points to a read-only string literal whose modification is undefined behaviour. Use the array form when you need to edit the string.
Why should I assign realloc to a temporary first?
Because realloc returns NULL on failure while leaving the original block valid. Assigning directly to the same pointer would overwrite it with NULL on failure and leak the original allocation.
Related Articles
- C Programming Placement Questions, the master set
- C Output Prediction Questions 2026, tricky snippets
- C++ Pointers Interview Questions 2026, pointers in C++
- Data Structures Interview Questions 2026, pointer-based structures
Confirm any pointer or memory semantics on the official C language references before your interview. This guide reflects candidate-reported patterns and public preparation resources as of June 2026.
Methodology applied to this articlelast verified 8 Jun 2026
- No fabricated salary numbers or success rates. If we quote a range, it's sourced.
- No noun-substituted templates. This article was not generated by swapping company names in a stock prompt.
- No paid placements, sponsored coaching links, or affiliate-shilled course pushes.
Explore this topic cluster
More resources in Interview Questions
Use the category hub to browse similar questions, exam patterns, salary guides, and preparation resources related to this topic.
Paid contributor programme
Sat this this year? Share your story, earn ₹500.
First-person experience reports help future candidates prep smarter. We pay verified contributors ₹500 via UPI per accepted story - with byline.
Submit your story →Ready to practice?
Take a free timed mock test
Put what you learned into practice. Our mock tests match the 2026 pattern with timer, navigator, reveal, and score breakdown. No signup.
Start Free Mock Test →Related Articles
Airbnb Interview Questions 2026: Top Tech, HR & Behavioural Q&As for Freshers
Clearing Airbnb's fresher loop in 2026 comes down to preparing for the exact mix of questions across technical, behavioural,...
Airtel Interview Questions 2026: Top Tech, HR & Behavioural Q&As for Freshers
Clearing Airtel's fresher loop in 2026 comes down to preparing for the exact mix of questions across technical, behavioural,...
AMD Interview Questions 2026: Top Tech, HR & Behavioural Q&As for Freshers
Clearing AMD's fresher loop in 2026 comes down to preparing for the exact mix of questions across technical, behavioural,...
Atlassian Interview Questions 2026: Top Tech, HR & Behavioural Q&As for Freshers
Clearing Atlassian's fresher loop in 2026 comes down to preparing for the exact mix of questions across technical,...
Barclays Interview Questions 2026
_Last verified by [Aditya Sharma](/author/aditya-sharma/) · cross-checked against PapersAdda Hiring Pulse and...
More from PapersAdda
Accenture Interview Process 2026: Rounds & Prep
Accenture Interview Questions 2026 (with Answers for Freshers)
Adobe Interview Process 2026: Rounds, OA & Aptitude
Amazon Interview Process 2026: Full Loop + Bar Raiser