C-Language Interview Questions
1 .
What is typecasting in C?
It is a way to convert constant from one type to another type. If there is a value of float data type then you can typecast it into other data types.
 
There are two types of typecasting in C:
 
* Implicit conversion
* Explicit conversion

Example :
#include <stdio.h>
main() {
   int sum = 17, count = 5;
   double mean;
   mean = (double) sum / count;
   printf(“Value of mean : %f\n”, mean );
}
2 .
What are the disadvantages of void pointer?
Disadvantages of a void pointer :
 
* Pointer arithmetic is not defined for void pointer
* Void pointers can’t be dereferenced
3 .
What is the use of a ‘\0’ character?
It is referred to as a terminating null character, and is used primarily to show the end of a string value.
4 .
What is a linear search?
A linear search refers to the way a target key is being searched in a sequential data structure. Using this method, each element in the list is checked and compared against the target key, and is repeated until found or if the end of the list has been reached.
5 .
How do you insert a new item in a binary search tree?
Assuming that the data to be inserted is a unique value (that is, not an existing entry in the tree), check first if the tree is empty. If it’s empty, just insert the new item in the root node. If it’s not empty, refer to the new item’s key. If it’s smaller than the root’s key, insert it into the root’s left subtree, otherwise, insert it into the root’s right subtree.
6 .
What is a dequeue?
A dequeue is a double-ended queue. This is a structure wherein elements can be inserted or removed from either end.
7 .
What is a bubble sort and how do you perform it?
A bubble sort is one sorting technique that can be applied to data structures such as an array. It works by comparing adjacent elements and exchanges their values if they are out of order. This method lets the smaller values “bubble” to the top of the list, while the larger value sinks to the bottom.
8 .
What is an AVL tree?
An AVL (Adelson-Velskii and Landis) tree is a height balance tree. These trees are binary search trees in which the height of two siblings are not permitted to differ by more than one. i.e. [Height of the left subtree – Height of right subtree] <= 1 .
9 .
What is Huffman’s algorithm?
Huffman’s algorithm is associated in creating extended binary trees that has minimum weighted path lengths from the given weights. It makes use of a table that contains frequency of occurrence for each data element.
10 .
What is a sequential access file?
When writing programs that will store and retrieve data in a file, it is possible to designate that file into different forms.

A sequential access file is such that data are saved in sequential order: one data is placed into the file after another.

To access a particular data within the sequential access file, data has to be read one data at a time, until the right one is reached.