Re: Interview Questions
From: Thomas Matthews (Thomas_MatthewsSpitsOnSpamBots_at_sbcglobal.net)
Date: 05/14/04
- Next message: Victor Bazarov: "Re: Freelance C++ Projects"
- Previous message: David Harmon: "Re: Function Pointers"
- In reply to: Jatinder: "Interview Questions"
- Next in thread: Xenos: "Re: Interview Questions"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 14 May 2004 14:49:47 GMT
Jatinder wrote:
> I 'm a professional looking for the job.In interview these questions
> were asked with some others which I answered.But some of them left
> unanswered.Plz help.
>
> Here are some questions on C/C++, OS internals?
> Q1 . What is the use of pointer to an array?
One can iterate through the array using a pointer.
One can pass the location of an element by just passing the pointer.
The array can be allocated during run-time, especially when the
size is unknown at run-time.
> Q2 . What is the use of array of pointers?
Multi-dimensional array.
Allows polymorphism for families of classes.
A convenient container for objects allocated during run-time.
> Q3 . What is the use of pointer to function ?
One can have an object associated with a function to process
that object, such as factories.
Another use is to map menu items with functions to process the
selection.
Allows for more generic algorithms, such as qsort (which allows
a pointer to a comparison function).
> Q4 . How to print through serial port? What is Flow Control(Xon,Xoff)
> ?
This depends on the platform and maybe the Operating System.
The "best" way to print through a serial port is to use operating
system functions.
The Flow Control characters, Xon and Xoff, are one method to turn
on (resume) or pause (stop) transmission across the serial channel.
See also ETX, STX, Request To Send (RTS) and DTS.
> Q5 . What is IOCTL Explain .
I believe this is a platform specific structure containing details
about an I/O device.
> Q6 . How to create an interrupt service routine in C?
This requires notifying your compiler that a function is an
ISR.
> Q7 . What are the internals of a schedular ?
Depends on the platform and operating system. Fundamentally,
a schedular dispatches processes according to a given scheme,
schedule or algorithm.
> Q8 . The static variables are declared in heap or stack ?
Neither, as the _standard_ C language does not require an
implementation to have a stack or heap. On many implementations
that use a heap and stack, static variables are not declared
on the stack or heap. They are allocated in the same area
as global variables. But this depends on the implementation.
--
Thomas Matthews
C++ newsgroup welcome message:
http://www.slack.net/~shiva/welcome.txt
C++ Faq: http://www.parashift.com/c++-faq-lite
C Faq: http://www.eskimo.com/~scs/c-faq/top.html
alt.comp.lang.learn.c-c++ faq:
http://www.raos.demon.uk/acllc-c++/faq.html
Other sites:
http://www.josuttis.com -- C++ STL Library book
- Next message: Victor Bazarov: "Re: Freelance C++ Projects"
- Previous message: David Harmon: "Re: Function Pointers"
- In reply to: Jatinder: "Interview Questions"
- Next in thread: Xenos: "Re: Interview Questions"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|