C Interview Questions

Want to become an expert in cracking C interview questions?

Start with practicing the questions below. Whether a question involves multiple choice or live coding, we will give you hints as you go and tell you if your answers are correct or incorrect.

After that, take our timed public C Interview Questions Test.

To use our service for testing candidates, buy a pack of candidates.


1. Palindrome
C Strings Public

A palindrome is a word that reads the same backward or forward.

Write a function that checks if a given word is a palindrome. Character case should be ignored. If the given word is a palindrome, the function should return 1; otherwise it should return 0.

For example, is_palindrome("Deleveled") should return 1 as character case should be ignored resulting with "deleveled" which is a palindrome since it reads same backward and forward.

Easy  
10min
 


  •   Example case: Wrong answer
  •   Lowercase words: Wrong answer
  •   Various words: Wrong answer

2. Words
C Algorithmic thinking Sorting Public

Implement function sort_words that can sort an array of words which contain lowercase characters from english alphabet, in descending order.

For example, the array { "cherry", "orange", "apple" } should, after sorting, become { "orange", "cherry", "apple" }.

Easy 
10min
 


  •   Example case: Wrong answer
  •   Several words: Wrong answer
  •   Performance test on a dictionary: Wrong answer

3. Binary Search Tree
C Algorithmic thinking Data structures Public New

Binary search tree (BST) is a binary tree where the value of each node is larger or equal to the values iA three-node binary tree.n all the nodes in that node's left subtree and smaller than the values in all the nodes in that node's right subtree.

Write a function that returns 1 if a given binary search tree contains a given value, else 0.

For example, for the following tree:

  • n1 (Value: 1, Left: null, Right: null)
  • n2 (Value: 2, Left: n1, Right: n3)
  • n3 (Value: 3, Left: null, Right: null)

Call to contains(&n2, 3) should return 1 since a tree with root at n2 contains number 3.

Easy  
15min
 


  •   Example case: Wrong answer
  •   Correctness: Wrong answer
  •   Performance test on a large tree: Wrong answer

4. Inspect Bits
C Bit manipulation Public

Implement the inspect_bits function that checks if given number contains 2 or more consecutive ones in its binary representation. If it does, the function should return 1. Otherwise, it should return 0.

For example, inspect_bits(13) should return 1 as it contains 2 consecutive ones in its binary representation (1101).

Easy  
15min
 


  •   Example case: Wrong answer
  •   Various numbers: Wrong answer

If you feel ready, take one of our timed public C Interview Questions tests:
  • C Online Test (Easy)
Not exactly what you are looking for? Go to our For Jobseekers section.