# c Interview Questions

interview questions shared by candidates

## c Interview Questions

Given a linked list, write a function that will print the list in reverse. |

Implement int value bit counting. |

Given a point a, a distance d, and a large set of points, write a program that efficiently finds all of the points in the set that are less than the distance d from point a. A point consists of an x-coordinate and a y-coordinate. |

Given a binary tree, how would you write program for getting mirror image of tree in O(n) time? Is it possible ? Assume you have no constraints on space. |

2. what is virtual function? |

Implement memcpy. |

Write and aligned malloc() that gets memory size needed and an alignment mask as its arguements. Write a free() function to go with the aligned malloc that takes only the pointer to the allocated chunk of memory. |

Write a macro to which you can pass a name of a structure and a name of one of its fields and get a relative offset of this field within the structure. |

If you had 5 red balls that contained 4 red balls and those red balls contained the original 5 red balls, then how many sets of sets of balls would I take to have a double set of red balls of varying sizes inside each next largest red ball? |

Describe to me in C how to take the word "FOX" and rearrange the words backwords to spell "XOF" using only a stack and one variable. |

**31**–

**40**of

**271**Interview Questions