SlideShare a Scribd company logo
 
 
 
Visionard  
Humans + Technology = Great Combination 
Top interview questions in C 
Duration​ 1 Hour 
Difficulty Level​ Beginner 
   
 
Visionard, your learning partner 
 
1 
 
 
 
Question 1 
What are the features of C language? 
Answer 
C language has many inbuilt features such as 
● It combines features of assembly language and high level language. 
● Easy to program​ - C languages has data types and different operators, which makes 
easier to write complex program 
● Portable​ - Program written on C are portable, hence can be used in other computer with 
no modification 
● Easy to extends​ - You can easily create your own functions and libraries in C language. 
● Very fast​ - Program written in c are very fast to run with no delay 
● Rich set of libraries ​- C languages has rich set of libraries, which makes coding complex 
program easier. 
Question 2 
What is the difference between source code and object code? 
Answer 
Source code​ is the code which is written by the programmer, it consists of all the functions, 
conditional statements and libraries. Only a human being can read this code while computer 
cannot read this code.  
Source code ​extension ​in c language is ​.c 
Object code​ when you compile the source code, you get the object code. The format of the code 
is only computer readable.  
Object code ​extension ​in language is ​.obj 
 
 
Visionard, your learning partner 
 
2 
 
 
 
 
Question 3 
What is the difference between ​= ​and ​== ​? 
Answer 
= ​is also known as ​assignment operator​ which is used to assign a value to the variable 
== ​is also known as ​comparison operator ​which is used to compare two values in a conditional 
statement. 
Question 4 
What is a header file and why we need header file in C program? 
Answer  
A ​header file​ are also known as ​library​. They contain ​definition ​and ​prototype ​of the ​inbuilt 
functions. ​Header files have ​.h ​as their file extension. 
We need header files so, we can use functions which are inbuilt within the language. 
Example 
studio.h ​contains functions like ​printf() 
Question 5 
What is the difference between ​syntax error, run-time error ​and ​logical error? 
Answer 
Syntax error ​occurs when we make mistakes in the syntax of c program. This error is shown 
when we try to compile our program, so it is also known as ​compile time error.  
Example 
● A missing semicolon 
 
Visionard, your learning partner 
 
3 
 
 
 
Run-time error ​occurs during the execution of our program after successful compilation. A 
compiler cannot find them so they are very hard to find, as they only occur during the run time of 
the program. 
Example 
● Dividing a number with 0 
Logical Error ​occurs when you get different output based on the input. Major cause of this error 
is logic created by the programmer. They are again hard to find and cannot be detected by the 
compiler. 
Example 
● A sum of 2 number returning a negative value. 
Question 6 
Why C language is known as middle level language? 
OR 
What type of language is C language? Low level, middle level or high level? 
Answer 
C language is known as ​middle level language ​because it can access ​machine level(low level) 
features like accessing structure of the memory just like assembly language. 
But also acts as high level language in which you can use english language to write your 
program. 
 
 
 
 
 
Visionard, your learning partner 
 
4 
 
 
 
Question 7 
What is the difference between i++ and ++i? 
OR 
What is the difference between​ post increment operator​ and ​pre increment operator​? 
Answer 
Post increment operator or i++ 
In this, we first assign the value and then increment the value by one 
Pre increment operator or ++i 
In this, we first increment the value by one and then assign the value. 
Question 8 
What is the difference between ​actual parameters​ and ​formal parameters​? 
Answer 
Actual Parameters ​are passed when you call the function in your program. 
Formal Parameters​ are parameters which are given in the prototype and definition of the 
function. 
 
Visionard, your learning partner 
 
5 
 
 
 
Question 9 
What are different data types in C language? 
Answer 
There are 4 basic data types in c 
● Int - size 4 byte 
● char - size 1 byte 
● float - size 4 byte 
● double - size 4 byte 
Question 10 
What are pointers in C? 
Answer 
Pointers are types of variables which are used ​to store address of another variable. ​They can 
only ​store address of variables of ​similar data type 
Question 11 
What are modifiers in language c? Explain different types of modifiers? 
Answer 
Modifiers are used to ​increase or decrease​ the ​size in memory​ and ​range ​of a variable. They are 
prefixed ​before the data type of the variable. 
Different types of modifiers in language c are 
● short 
● long 
● signed 
● Unsigned 
 
Visionard, your learning partner 
 
6 
 
 
 
 
Example 
● short int age = 5; 
● long int value = 10000; 
Question 12 
What are arrays? Why we need array? Explain different types of array! 
Answer 
An ​array ​are collection of similar data types. 
We need ​array​ for the following reason 
● Allocates contiguous block of memory 
● Makes our program efficient 
● Good to use when we have more than 1 variable of similar data types 
Types of array 
● Single dimension array or 1D array - they consists of just 1 row of similar data types 
● Multidimensional array consists of x rows and y columns of similar data types. 
Question 13 
What is the difference between call by value and call by reference? Explain with example! 
Answer 
Call by Value ​when you pass the ​copy of variable​ in the function call, it is known as call by 
value. In this method, any modification whatsoever are done in the duplicate copy of the 
variable. 
 
Visionard, your learning partner 
 
7 
 
 
 
Call by reference ​when you pass ​original value of the variable​ in the function call, it is also 
known as call by reference. In this method, any modification whatsoever are done in the ​original 
variable​ hence the changes are reflected in the original variable. 
 
 
Question 14 
What is stack? 
Answer 
Stack is a type of data structure which works on the principle of ​Last in first out(LIFO)​. Storing 
the data inside a stack is known as ​push​ while removing the data from stack is ​pop​. 
Question 15 
What is queue? 
Answer 
A ​queue​ is the type of data structure which works on the principle of ​First in first out(FIFO).​ The 
order of data insertion and deletions is on FIFO. 
Question 16 
What are linked list? 
Answer 
A linked list is type of data structure where current node is connected to the previous node. A 
basic linked list block consists of 2 part 
1) Previous address - this part contains the address of previous node 
2) Value - this part stores the value in the current node. 
Linked list are of 2 types 
 
Visionard, your learning partner 
 
8 
 
 
 
1. Singly Linked List 
2. Doubly Linked List 
Singly Linked list​ - It consists of only 2 part, previous address part to store address of previous 
block and data part to store the data. 
Doubly Linked List ​- It consists of 3 parts, previous address part to store address of previous 
block, data part to store the data and next address part to store the address of next block. 
Question 17 
What is dynamic memory allocation? 
Answer 
When you ​allocate memory​ during the ​run time​ of the program, it is known as ​dynamic memory 
allocation. ​There are 4 basic functions for dynamic memory allocation 
● malloc() 
● calloc() 
● free 
● Realloc 
These functions can be found in ​stdlib.h​ header file 
Question 18 
What is the difference between a ​structure ​and ​union​? 
Answer 
Union ​is user defined data type, which combines more than one data types as a single entity. 
The size of union is the size of the biggest data type inside that union 
Structure ​is a user defined data type, which combines more than one data types as a single 
entity. 
The size of ​structure ​is equal to the ​sum of all data types ​inside the structure. 
 
Visionard, your learning partner 
 
9 
 
 
 
Question 19 
Explain why c language is a case sensitive language with an example! 
Answer 
C language is a case sensitive language because variable names with different cases are 
different from each other. Example of different variables with same name but capital letter and 
small letters combination 
● Age ​is different from 
● aGE ​which is different from  
● AGe ​which is different from 
● agE ​which is different from 
● aGe ​which is different from  
● AgE ​which is different from 
● age ​which is different from ​AGE 
Question 20 
What is the difference between local variables and global variables? 
Answer 
Local variable ​are variables with ​scope limited to the block of code​, if a variable is declared 
inside the function, you can only access it inside the function. ​You cannot access​ local variables 
from outside the function.  
Global variable ​are variables with scope throughout the program. ​You can access​ the variable 
from any function or any block of code within the program. 
 
 
Visionard, your learning partner 
 
10 

More Related Content

PPTX
BERT introduction
PDF
Object oriented concepts ppt
PPTX
NLP State of the Art | BERT
PPTX
Summer Training Project On Python Programming
PDF
Python brochure (2)
PDF
An Efficient Approach to Produce Source Code by Interpreting Algorithm
BERT introduction
Object oriented concepts ppt
NLP State of the Art | BERT
Summer Training Project On Python Programming
Python brochure (2)
An Efficient Approach to Produce Source Code by Interpreting Algorithm

What's hot (20)

PPT
Overview of c#
PDF
C datatypes
PDF
C program structure
PDF
BERT Finetuning Webinar Presentation
PDF
Doppl development iteration #6
PPTX
Python Interview questions 2020
PPT
C, C++ Interview Questions Part - 1
PPTX
Latest trends in NLP - Exploring BERT
PPT
C++ OOP Implementation
PDF
2013 bookmatter learn_javaforandroiddevelopment
PDF
7. Trevor Cohn (usfd) Statistical Machine Translation
DOCX
Mca 4030 programming in java
PDF
6. Khalil Sima'an (UVA) Statistical Machine Translation
PPTX
C++ Object Oriented Programming
PPT
C Course Material0209
PDF
Turbo prolog 2.0 basics
PPT
9781439035665 ppt ch03
DOCX
Mca 4030 programming in java
PDF
5. manuel arcedillo & juanjo arevalillo (hermes) translation memories
PPTX
Python Tutorial for Beginner
Overview of c#
C datatypes
C program structure
BERT Finetuning Webinar Presentation
Doppl development iteration #6
Python Interview questions 2020
C, C++ Interview Questions Part - 1
Latest trends in NLP - Exploring BERT
C++ OOP Implementation
2013 bookmatter learn_javaforandroiddevelopment
7. Trevor Cohn (usfd) Statistical Machine Translation
Mca 4030 programming in java
6. Khalil Sima'an (UVA) Statistical Machine Translation
C++ Object Oriented Programming
C Course Material0209
Turbo prolog 2.0 basics
9781439035665 ppt ch03
Mca 4030 programming in java
5. manuel arcedillo & juanjo arevalillo (hermes) translation memories
Python Tutorial for Beginner
Ad

Similar to Top interview questions in c (20)

PPTX
Interview Questions For C Language .pptx
PDF
Interview Questions For C Language
PDF
C Language Interview Questions: Data Types, Pointers, Data Structures, Memory...
PDF
cprogramming questions for practice end term
PDF
C language 100 questions answers
PDF
C basic questions&ansrs by shiva kumar kella
DOCX
Computer programming questions
DOCX
Computer programming questions
PDF
C interview questions
PDF
Technical_Interview_Questions.pdf
PDF
Basic Information About C language PDF
PPTX
Top 40 C Programming Interview Questions
DOCX
Intervies
PDF
Top C Language Interview Questions and Answer
PDF
C question-bank-ebook
PDF
C Interview Questions PDF By Scholarhat.pdf
PPT
C material
PPTX
C programming tutorial for Beginner
PDF
Tcs NQTExam technical questions
PDF
C question-answer-bank
Interview Questions For C Language .pptx
Interview Questions For C Language
C Language Interview Questions: Data Types, Pointers, Data Structures, Memory...
cprogramming questions for practice end term
C language 100 questions answers
C basic questions&ansrs by shiva kumar kella
Computer programming questions
Computer programming questions
C interview questions
Technical_Interview_Questions.pdf
Basic Information About C language PDF
Top 40 C Programming Interview Questions
Intervies
Top C Language Interview Questions and Answer
C question-bank-ebook
C Interview Questions PDF By Scholarhat.pdf
C material
C programming tutorial for Beginner
Tcs NQTExam technical questions
C question-answer-bank
Ad

Recently uploaded (20)

PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PDF
RMMM.pdf make it easy to upload and study
PDF
O7-L3 Supply Chain Operations - ICLT Program
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PPTX
master seminar digital applications in india
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
Anesthesia in Laparoscopic Surgery in India
PPTX
Institutional Correction lecture only . . .
PDF
Pre independence Education in Inndia.pdf
PDF
Insiders guide to clinical Medicine.pdf
PDF
Complications of Minimal Access Surgery at WLH
PDF
Sports Quiz easy sports quiz sports quiz
PDF
VCE English Exam - Section C Student Revision Booklet
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
Module 4: Burden of Disease Tutorial Slides S2 2025
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
RMMM.pdf make it easy to upload and study
O7-L3 Supply Chain Operations - ICLT Program
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
master seminar digital applications in india
Microbial diseases, their pathogenesis and prophylaxis
Final Presentation General Medicine 03-08-2024.pptx
Anesthesia in Laparoscopic Surgery in India
Institutional Correction lecture only . . .
Pre independence Education in Inndia.pdf
Insiders guide to clinical Medicine.pdf
Complications of Minimal Access Surgery at WLH
Sports Quiz easy sports quiz sports quiz
VCE English Exam - Section C Student Revision Booklet

Top interview questions in c

  • 1.       Visionard   Humans + Technology = Great Combination  Top interview questions in C  Duration​ 1 Hour  Difficulty Level​ Beginner        Visionard, your learning partner    1 
  • 2.       Question 1  What are the features of C language?  Answer  C language has many inbuilt features such as  ● It combines features of assembly language and high level language.  ● Easy to program​ - C languages has data types and different operators, which makes  easier to write complex program  ● Portable​ - Program written on C are portable, hence can be used in other computer with  no modification  ● Easy to extends​ - You can easily create your own functions and libraries in C language.  ● Very fast​ - Program written in c are very fast to run with no delay  ● Rich set of libraries ​- C languages has rich set of libraries, which makes coding complex  program easier.  Question 2  What is the difference between source code and object code?  Answer  Source code​ is the code which is written by the programmer, it consists of all the functions,  conditional statements and libraries. Only a human being can read this code while computer  cannot read this code.   Source code ​extension ​in c language is ​.c  Object code​ when you compile the source code, you get the object code. The format of the code  is only computer readable.   Object code ​extension ​in language is ​.obj      Visionard, your learning partner    2 
  • 3.         Question 3  What is the difference between ​= ​and ​== ​?  Answer  = ​is also known as ​assignment operator​ which is used to assign a value to the variable  == ​is also known as ​comparison operator ​which is used to compare two values in a conditional  statement.  Question 4  What is a header file and why we need header file in C program?  Answer   A ​header file​ are also known as ​library​. They contain ​definition ​and ​prototype ​of the ​inbuilt  functions. ​Header files have ​.h ​as their file extension.  We need header files so, we can use functions which are inbuilt within the language.  Example  studio.h ​contains functions like ​printf()  Question 5  What is the difference between ​syntax error, run-time error ​and ​logical error?  Answer  Syntax error ​occurs when we make mistakes in the syntax of c program. This error is shown  when we try to compile our program, so it is also known as ​compile time error.   Example  ● A missing semicolon    Visionard, your learning partner    3 
  • 4.       Run-time error ​occurs during the execution of our program after successful compilation. A  compiler cannot find them so they are very hard to find, as they only occur during the run time of  the program.  Example  ● Dividing a number with 0  Logical Error ​occurs when you get different output based on the input. Major cause of this error  is logic created by the programmer. They are again hard to find and cannot be detected by the  compiler.  Example  ● A sum of 2 number returning a negative value.  Question 6  Why C language is known as middle level language?  OR  What type of language is C language? Low level, middle level or high level?  Answer  C language is known as ​middle level language ​because it can access ​machine level(low level)  features like accessing structure of the memory just like assembly language.  But also acts as high level language in which you can use english language to write your  program.            Visionard, your learning partner    4 
  • 5.       Question 7  What is the difference between i++ and ++i?  OR  What is the difference between​ post increment operator​ and ​pre increment operator​?  Answer  Post increment operator or i++  In this, we first assign the value and then increment the value by one  Pre increment operator or ++i  In this, we first increment the value by one and then assign the value.  Question 8  What is the difference between ​actual parameters​ and ​formal parameters​?  Answer  Actual Parameters ​are passed when you call the function in your program.  Formal Parameters​ are parameters which are given in the prototype and definition of the  function.    Visionard, your learning partner    5 
  • 6.       Question 9  What are different data types in C language?  Answer  There are 4 basic data types in c  ● Int - size 4 byte  ● char - size 1 byte  ● float - size 4 byte  ● double - size 4 byte  Question 10  What are pointers in C?  Answer  Pointers are types of variables which are used ​to store address of another variable. ​They can  only ​store address of variables of ​similar data type  Question 11  What are modifiers in language c? Explain different types of modifiers?  Answer  Modifiers are used to ​increase or decrease​ the ​size in memory​ and ​range ​of a variable. They are  prefixed ​before the data type of the variable.  Different types of modifiers in language c are  ● short  ● long  ● signed  ● Unsigned    Visionard, your learning partner    6 
  • 7.         Example  ● short int age = 5;  ● long int value = 10000;  Question 12  What are arrays? Why we need array? Explain different types of array!  Answer  An ​array ​are collection of similar data types.  We need ​array​ for the following reason  ● Allocates contiguous block of memory  ● Makes our program efficient  ● Good to use when we have more than 1 variable of similar data types  Types of array  ● Single dimension array or 1D array - they consists of just 1 row of similar data types  ● Multidimensional array consists of x rows and y columns of similar data types.  Question 13  What is the difference between call by value and call by reference? Explain with example!  Answer  Call by Value ​when you pass the ​copy of variable​ in the function call, it is known as call by  value. In this method, any modification whatsoever are done in the duplicate copy of the  variable.    Visionard, your learning partner    7 
  • 8.       Call by reference ​when you pass ​original value of the variable​ in the function call, it is also  known as call by reference. In this method, any modification whatsoever are done in the ​original  variable​ hence the changes are reflected in the original variable.      Question 14  What is stack?  Answer  Stack is a type of data structure which works on the principle of ​Last in first out(LIFO)​. Storing  the data inside a stack is known as ​push​ while removing the data from stack is ​pop​.  Question 15  What is queue?  Answer  A ​queue​ is the type of data structure which works on the principle of ​First in first out(FIFO).​ The  order of data insertion and deletions is on FIFO.  Question 16  What are linked list?  Answer  A linked list is type of data structure where current node is connected to the previous node. A  basic linked list block consists of 2 part  1) Previous address - this part contains the address of previous node  2) Value - this part stores the value in the current node.  Linked list are of 2 types    Visionard, your learning partner    8 
  • 9.       1. Singly Linked List  2. Doubly Linked List  Singly Linked list​ - It consists of only 2 part, previous address part to store address of previous  block and data part to store the data.  Doubly Linked List ​- It consists of 3 parts, previous address part to store address of previous  block, data part to store the data and next address part to store the address of next block.  Question 17  What is dynamic memory allocation?  Answer  When you ​allocate memory​ during the ​run time​ of the program, it is known as ​dynamic memory  allocation. ​There are 4 basic functions for dynamic memory allocation  ● malloc()  ● calloc()  ● free  ● Realloc  These functions can be found in ​stdlib.h​ header file  Question 18  What is the difference between a ​structure ​and ​union​?  Answer  Union ​is user defined data type, which combines more than one data types as a single entity.  The size of union is the size of the biggest data type inside that union  Structure ​is a user defined data type, which combines more than one data types as a single  entity.  The size of ​structure ​is equal to the ​sum of all data types ​inside the structure.    Visionard, your learning partner    9 
  • 10.       Question 19  Explain why c language is a case sensitive language with an example!  Answer  C language is a case sensitive language because variable names with different cases are  different from each other. Example of different variables with same name but capital letter and  small letters combination  ● Age ​is different from  ● aGE ​which is different from   ● AGe ​which is different from  ● agE ​which is different from  ● aGe ​which is different from   ● AgE ​which is different from  ● age ​which is different from ​AGE  Question 20  What is the difference between local variables and global variables?  Answer  Local variable ​are variables with ​scope limited to the block of code​, if a variable is declared  inside the function, you can only access it inside the function. ​You cannot access​ local variables  from outside the function.   Global variable ​are variables with scope throughout the program. ​You can access​ the variable  from any function or any block of code within the program.      Visionard, your learning partner    10