C Interview
questions
1. Difference between arrays
and pointers?
2. What is the purpose of
realloc( )?
3. What is static memory
allocation and dynamic memory allocation?
4. How are pointer variables
initialized?
5. Are pointers integers?
6. What is a pointer
variable?
7. What is a pointer value
and address?
8. What is a method?
9. What are the advantages
of the functions?
10.
What is the purpose of main( ) function?
11.
What is an argument? differentiate between formal
arguments and actual arguments?
12.
What is a function and built-in function?
13.
What is modular programming?
14.
When does the compiler not implicitly generate the
address of the first element of an array?
15.
What are the characteristics of arrays in C?
16.
Differentiate between a linker and linkage?
17.
What are advantages and disadvantages of external storage
class?
18.
Diffenentiate between an internal static and external
static variable?
19.
What are the advantages of auto variables?
20.
What is storage class and what are storage variable?
21.
Which expression always return true? Which always return
false?
22.
Write the equivalent expression for x%8?
23.
Why n++ executes faster than n+1?
24.
What is a modulus operator? What are the restrictions of
a modulus operator?
25.
What is the difference between a string and an array?
26.
Is it better to use a pointer to navigate an array of
values,or is it better to use a subscripted array name?
27.
Can the sizeof operator be used to tell the size of an
array passed to a function?
28.
Is using exit() the same as using return?
29.
Is it possible to execute code even after the program
exits the main() function?
30.
What is a static function?
31.
Why should I prototype a function?
32.
How do you print an address?
33.
Can math operations be performed on a void pointer?
34.
How can you determine the size of an allocated portion of
memory?
35.
What is a “null pointer assignment” error? What are bus
errors, memory faults, and core dumps?
36.
What is the difference between NULL and NUL?
37.
What is the heap?
38.
Can the size of an array be declared at runtime?
39.
What is the stack?
40.
When should a far pointer be used?
41.
What is the difference between far and near?
42.
Is it better to use malloc() or calloc()?
43.
Why should we assign NULL to the elements (pointer) after
freeing them?
44.
When would you use a pointer to a function?
45.
How do you use a pointer to a function?
46.
Can you add pointers together? Why would you?
47.
What does it mean when a pointer is used in an if
statement?
48.
Is NULL always defined as 0?
49.
What is a void pointer?
50.
What is a null pointer?
51.
How many levels of pointers can you have?
52.
What is indirection?
53.
How do you print only part of a string?
54.
How can I convert a string to a number?
55.
How can I convert a number to a string?
56.
What is the difference between a string copy (strcpy) and
a memory copy (memcpy)? When should each be used?
57.
How can you check to see whether a symbol is defined?
58.
How do you override a defined macro?
59.
What is #line used for?
60.
What is a pragma?
61.
What are the standard predefined macros?
62.
How can type-insensitive macros be created?
63.
How many levels deep can include files be nested?
64.
Can include files be nested?
65.
Can you define which header file to include at compile
time?
66.
What is the difference between #include and #include
“file”?
67.
Is it better to use a macro or a function?
68.
How are portions of a program disabled in demo versions?
69.
What is the benefit of using an enum rather than a #define
constant?
70.
What is the benefit of using #define to declare a
constant?
71.
Can a file other than a .h file be included with
#include?
72.
How can you avoid including a header more than once?
73.
What will the preprocessor do for a program?
74.
What is a macro, and how do you use it?
75.
What is Preprocessor?
76.
How can I make sure that my program is the only one
accessing a file?
77.
How can I open a file so that other programs can update
it at the same time?
78.
How do you determine whether to use a stream function or
a low-level function?
79.
What is the difference between text and binary modes?
80.
How can you restore a redirected standard stream?
81.
How do you redirect a standard stream?
82.
How can I search for data in a linked list?
83.
How can I sort a linked list?
84.
What is hashing?
85.
What is the quickest searching method to use?
86.
What is the easiest searching method to use?
87.
How can I sort things that are too large to bring into
memory?
88.
What is the quickest sorting method to use?
89.
What is the easiest sorting method to use?
90.
What is the benefit of using const for declaring
constants?
91.
Can static variables be declared in a header file?
92.
What is the difference between declaring a variable and
defining a variable?
93.
Is it acceptable to declare/define a variable in a C
header?
94.
When should a type cast not be used?
95.
When should a type cast be used?
96.
How can you determine the maximum value that a numeric
variable can hold?
97.
How reliable are floating-point comparisons?
98.
Can a variable be both const and volatile?
99.
When should the volatile modifier be used?
100.
When should the register modifier be used? Does it really
help?
Networking interview questions
- What are 10Base2, 10Base5 and 10BaseT
Ethernet LANs ?
- What is the difference between an unspecified
passive open and a fully specified passive open
- Explain the function of Transmission Control
Block
- What is a Management Information Base (MIB)
- What is anonymous FTP and why would you use
it?
- What is a pseudo tty?
- What is REX?
- What does the Mount protocol do ?
- What is External Data Representation?
- What is the Network Time Protocol?
- What is a DNS resource record?
- What protocol is used by DNS name servers?
- What is the difference between interior and
exterior neighbor gateways?
- What is the HELLO protocol used for?
- What are the advantages and disadvantages of
the three types of routing tables?
- What is source route?
- What is RIP (Routing Information Protocol)?
- What is SLIP (Serial Line Interface
Protocol)?
- What is Proxy ARP?
- What is OSPF?
- What is Kerberos?
- What is a Multi-homed Host?
- What is NVT (Network Virtual Terminal)?
- What is Gateway-to-Gateway protocol?
- What is BGP (Border Gateway Protocol)?
- What is autonomous system?
- What is EGP (Exterior Gateway Protocol)?
- What is IGP (Interior Gateway Protocol)?
- What is Mail Gateway?
- What is wide-mouth frog?
- What are Digrams and Trigrams?
- What is silly window syndrome?
- What is region?
- What is multicast routing?
- What is traffic shaping?
- What is packet filter?
- What is virtual path?
- What is virtual channel?
- What is logical link control?
- Why should you care about the OSI Reference
Model?
- What is the difference between routable and
non- routable protocols?
- What is MAU?
- Explain 5-4-3 rule.
- What is the difference between TFTP and FTP
application layer protocols?
- What is the range of addresses in the classes
of internet addresses?
- What is the minimum and maximum length of the
header in the TCP segment and IP datagram?
- What is difference between ARP and RARP?
- What is ICMP?
- What are the data units at different layers
of the TCP / IP protocol suite?
- What is Project 802?
- What is Bandwidth?
- Difference between bit rate and baud rate?
- What is MAC address?
- What is attenuation?
- What is cladding?
- What is RAID?
- What is NETBIOS and NETBEUI?
- What is redirector?
- What is Beaconing?
- What is terminal emulation, in which layer it
comes?
- What is frame relay, in which layer it comes?
- What do you meant by “triple X” in Networks?
- What is SAP?
- What is subnet?
- What is Brouter?
- How Gateway is different from Routers?
- What are the different type of networking /
internetworking devices?
- What is mesh network?
- What is passive topology?
- What are the important topologies for
networks?
- What are major types of networks and explain?
- What is Protocol Data Unit?
- What is difference between baseband and
broadband transmission?
- What are the possible ways of data exchange?
- What are the types of Transmission media?
- What are the types of Transmission media?
- What is point-to-point protocol?
- What are the two types of transmission
technology available?
- Difference between the communication and
transmission?
- What is a different between switch and Hub?
- What are the Advantages and Disadvantages of
DHCP?
- What is Recovery Console?
- What is ERD(Emergency Repair Disk)?
- What is the difference between POP3 and IMAP
Mail Server?
- what is .ost file?
- Whatz the difference between DNS and WINS?
- How can we create VPN to connect to branch
office of the same office.what would be the priliminary requirment?
- Why should we care about the OSI Reference
Model ? What is the main purpose for creating this osi model? why it is a
layered model?
- What is layer-3 switch?
- What is an email client? what is differnce
between email client and web mail?
- what is the vlan ? how it is work?
- Name three network tools used to determine
where a network connectivity is lost between two sites A&B.
- Which protocol is used for retrieving mails?
- What is piggy backing?
- What is the default subnet mask for an ipv6
address ?
- What is fragmentation of a packet ?
- What is MTU of a link ?
- Name any field of IP header that can prevent
a packet to loop infinitely ?
- Under what situations a packet can go into
infinite loop in a network ?
- Describe a 3-way TCP/IP Handshake.
8085 Microprocessor questions
- What are the various
registers in 8085? - Accumulator register, Temporary register,
Instruction register, Stack Pointer, Program Counter are the various
registers in 8085 .
- In 8085 name the 16 bit
registers? - Stack pointer and Program counter all have 16 bits.
- What are the various flags
used in 8085? - Sign flag, Zero flag, Auxillary flag, Parity flag,
Carry flag.
- What is Stack Pointer? -
Stack pointer is a special purpose 16-bit register in the Microprocessor,
which holds the address of the top of the stack.
- What is Program counter? -
Program counter holds the address of either the first byte of the next
instruction to be fetched for execution or the address of the next byte of
a multi byte instruction, which has not been completely fetched. In both
the cases it gets incremented automatically one by one as the instruction
bytes get fetched. Also Program register keeps the address of the next
instruction.
- Which Stack is used in
8085? - LIFO (Last In First Out) stack is used in 8085.In this type of
Stack the last stored information can be retrieved first.
- What happens when HLT
instruction is executed in processor? - The Micro Processor enters
into Halt-State and the buses are tri-stated.
- What is meant by a bus? -
A bus is a group of conducting lines that carriers data, address, &
control signals.
- What is Tri-state logic? -
Three Logic Levels are used and they are High, Low, High impedance state.
The high and low are normal logic levels & high impedance state is
electrical open circuit conditions. Tri-state logic has a third line
called enable line.
- Give an example of one
address microprocessor? - 8085 is a one address microprocessor.
- In what way interrupts are
classified in 8085? - In 8085 the interrupts are classified as
Hardware and Software interrupts.
- What are Hardware
interrupts? - TRAP, RST7.5, RST6.5, RST5.5, INTR.
- What are Software interrupts?
- RST0, RST1, RST2, RST3, RST4, RST5, RST6, RST7.
- Which interrupt has the
highest priority? - TRAP has the highest priority.
- Name 5 different
addressing modes? - Immediate, Direct, Register, Register indirect,
Implied addressing modes.
- How many interrupts are
there in 8085? - There are 12 interrupts in 8085.
- What is clock frequency
for 8085? - 3 MHz is the maximum clock frequency for 8085.
- What is the RST for the
TRAP? - RST 4.5 is called as TRAP.
- In 8085 which is called as
High order / Low order Register? - Flag is called as Low order
register & Accumulator is called as High order Register.
- What are input &
output devices? - Keyboards, Floppy disk are the examples of input
devices. Printer, LED / LCD display, CRT Monitor are the examples of output
devices.
- Can an RC circuit be used
as clock source for 8085? - Yes, it can be used, if an accurate clock
frequency is not required. Also, the component cost is low compared to LC
or Crystal.
- Why crystal is a preferred
clock source? - Because of high stability, large Q (Quality Factor)
& the frequency that doesn’t drift with aging. Crystal is used as a clock source most
of the times.
- Which interrupt is not
level-sensitive in 8085? - RST 7.5 is a raising edge-triggering
interrupt.
- What does Quality factor
mean? - The Quality factor is also defined, as Q. So it is a number,
which reflects the lossness of a circuit. Higher the Q, the lower are the
losses.
- What are level-triggering
interrupt? - RST 6.5 & RST 5.5 are level-triggering interrupts.