Q1) What's a spinlock ? How it is different from a mutex ?
spinlock is used to provide synchronization between two processors
and mutex is used for single processor environment.
Q2) What's volatile keyword in C? What does the compiler does when I declare
a variable volatile ?
When you declare a variable as volatile. You notify compiler to stop
optimization while accessing the variable declared as volatile. when you
declare a variable as volatile it will not store the variable in to some
register. Every time it access the variable from memory.
On Tue, Apr 12, 2011 at 1:30 PM, Decipher ankurseth...@gmail.com wrote:
Hey Guys, these questions were asked from me during Broadcom India
interview rounds in my college. I hope this would be useful for those
interested in this firm.
They wanted a person with good knowledge of C + Networking + Microprocessor
and project in any of these technologies would be beneficial for
the candidate.
Written test: C+ Networking + Linux Commands + Database.
Questions:
Q1) What's a spinlock ? How it is different from a mutex ?
Q2) What's volatile keyword in C? What does the compiler does when I
declare a variable volatile ?
Q3) How is NULL defined in C ? What's the difference between #define NULL
(void *)0 and #define NULL 0 .
Q4) How do you find given substring in a given string using only macros ?
Q5) How to find factorial of a no. using macros ?
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/algogeeks?hl=en.
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/algogeeks?hl=en.