Interview Questions

J

Jatinder

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?
Q2 . What is the use of array of pointers?
Q3 . What is the use of pointer to function ?
Q4 . How to print through serial port? What is Flow Control(Xon,Xoff)
?
Q5 . What is IOCTL Explain .
Q6 . How to create an interrupt service routine in C?
Q7 . What are the internals of a schedular ?
Q8 . The static variables are declared in heap or stack ?
 
R

Ron Natalie

Jatinder said:
Q1 . What is the use of pointer to an array?
Q2 . What is the use of array of pointers?
Q3 . What is the use of pointer to function ?

These are almost topical, but if you can't answer them, you need to go back and read
a C text book.
Q4 . How to print through serial port? What is Flow Control(Xon,Xoff)
Q5 . What is IOCTL Explain .

Highly system dependent and off-topic. Ask im comp.programming.unix or whatever
target system you're dealing with.
Q6 . How to create an interrupt service routine in C?
Ditto.

Q7 . What are the internals of a schedular ?

What scheduler? Did they mention what OS (and just saying UNIX doesn't cut it)
they want to know about the scheduler internals of?
Q8 . The static variables are declared in heap or stack ?

Neither.
 
T

Thomas Matthews

Jatinder said:
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
 
X

Xenos

Jatinder said:
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?
Q2 . What is the use of array of pointers?
Q3 . What is the use of pointer to function ?
Q4 . How to print through serial port? What is Flow Control(Xon,Xoff)
?
Q5 . What is IOCTL Explain .
Q6 . How to create an interrupt service routine in C?
Q7 . What are the internals of a schedular ?
Q8 . The static variables are declared in heap or stack ?

I find it alarming that this trend of giving ridiculous quizzes and tests to
interviewee is increasing. When I was young and looking for a job,
companies that did this were few. I immediately walked out of any interview
were I was asked to take such a test. Regurgitation of facts does not prove
knowledge or wisdom, and is certainly no indication of skill. For someone
with an encyclopedic memory of the C or C++ standards, I would hire for a
one-time fee of $18--the amount I would need to just purchase a copy of the
standard (or whatever it currently costs).

This topic has come up before, and I think I said pretty much the something.
Someone replied with, "So how do you know they can do the job?" Well, there
are no guarantees, but you could try *talking* to them. I never minded
being asked questions in interviews. Isn't that a major part of the
process? Ask about college courses taken and projects done. If you are
interviewing an experienced professional, ask about previous work done. How
about what problems were encountered and how they were overcome. DON'T try
and sitting me in a room with 50 other nameless applicants and presume to
give me a test. That's a company interested in bodies and tests scores, not
cultivating good people. I'm also turned off by companies that call you up
and ask for college transcripts. Unless they have taken the time to
interview me and show an interest in hiring me, I always refused.

As a result, I love the company I work for. They treat me very well, and
there is always very smart, experienced people to learn from.

DrX
 
D

Derek

Xenos said:
I find it alarming that this trend of giving ridiculous
quizzes and tests to interviewee is increasing. When I
was young and looking for a job, companies that did this
were few. I immediately walked out of any interview were
I was asked to take such a test. Regurgitation of facts
does not prove knowledge or wisdom, and is certainly no
indication of skill. For someone with an encyclopedic
memory of the C or C++ standards, I would hire for a
one-time fee of $18--the amount I would need to just
purchase a copy of the standard (or whatever it currently
costs).

In general I agree with you. However, the questions
mentioned by the original poster may not be the whole
of the interview. For all you know they are just a
pre-screening and the answers should be no-brainers for
qualified applicants. My current employer took a lot of
time to get to know me, but only after I took a couple of
short written tests to make sure I was a C++ developer and
not a Perl hacker looking to learn C++ on the job.

When the economy isn't so hot there may be many applicants
for each position and some form of pre-selection may be
justified.
 
V

Victor Bazarov

Derek said:
In general I agree with you. However, the questions
mentioned by the original poster may not be the whole
of the interview. For all you know they are just a
pre-screening and the answers should be no-brainers for
qualified applicants. My current employer took a lot of
time to get to know me, but only after I took a couple of
short written tests to make sure I was a C++ developer and
not a Perl hacker looking to learn C++ on the job.

Shouldn't that be obvious from the resume? When employers are
being picky about whom to interview, they should put more
emphasis on reading the application documents and doing phone
screenings. Well, just MHO, of course. All OT, BTW. :)

V
 
X

Xenos

Derek said:
In general I agree with you. However, the questions
mentioned by the original poster may not be the whole
of the interview. For all you know they are just a
pre-screening and the answers should be no-brainers for
qualified applicants. My current employer took a lot of
time to get to know me, but only after I took a couple of
short written tests to make sure I was a C++ developer and
not a Perl hacker looking to learn C++ on the job.
And that's fine. I wouldn't have minded that. But I have gone to
interviews where they didn't even interview you. *Every* applicant had the
same "interview" time. We were herded into a class room to take a length
test. No one every said "hello," and they only asked your name to check it
off a list. THAT is not a company I would have liked to work for. I left
and have never regretted it. Of course, in today economy I guess you may
have to swallow your pride a little more and suck it up. I feel sorry for
kids just out of college (and older folks out of work). In my day, lots of
good companies would fight over you.

DrX
 
B

bartek

And that's fine. I wouldn't have minded that. But I have gone to
interviews where they didn't even interview you. *Every* applicant
had the same "interview" time. We were herded into a class room to
take a length test. No one every said "hello," and they only asked
your name to check it off a list. THAT is not a company I would have
liked to work for. I left and have never regretted it. Of course, in
today economy I guess you may have to swallow your pride a little more
and suck it up. I feel sorry for kids just out of college (and older
folks out of work). In my day, lots of good companies would fight
over you.

It's the sign of the times, isn't it?
Companies that actually care about their workforce are getting pretty
rare. Now it's the quantity that counts, not quality. Quality is just
such a waste of resources, just go ask the marketing people.

I wouldn't be surprised, if they actually started charging entry fees for
interview sessions.

Sorry, I couldn't resist...
 
H

Howard

Anyone else notice something strange about this post? I see it comes
through San Diego State University's server (newshub.sdsu.edu). Also, the
OP has not responded in any way, with their own opinions, follow-up, or
whatever. And the OP claims to be a "professional", but asks some of the
most basic questions. Isn't anyone at least suspicious that this is really
just a student taking a test or doing homework, and trying to get free
answers to questions they're supposed to either know or research themselves?
This is at least the third time I've seen someone declare they were asking
"job interview" questions, yet it seemed suspiciously like schoolwork to me.
Am I just being paranoid, or what?

-Howard
 
V

Victor Bazarov

Howard said:
Anyone else notice something strange about this post? I see it comes
through San Diego State University's server (newshub.sdsu.edu). Also, the
OP has not responded in any way, with their own opinions, follow-up, or
whatever. And the OP claims to be a "professional", but asks some of the
most basic questions. Isn't anyone at least suspicious that this is really
just a student taking a test or doing homework, and trying to get free
answers to questions they're supposed to either know or research themselves?
This is at least the third time I've seen someone declare they were asking
"job interview" questions, yet it seemed suspiciously like schoolwork to me.
Am I just being paranoid, or what?

Yes
 
W

Walter

Victor Bazarov said:
Shouldn't that be obvious from the resume? When employers are
being picky about whom to interview, they should put more
emphasis on reading the application documents and doing phone
screenings. Well, just MHO, of course. All OT, BTW. :)

You can't tell much from a resume. Most resumes read like the applicant
walks on water. When they list 5 years of C experience, but can't answer a
few simple questions about C, it's an easy way to separate out the real
candidates from the charlatans.

One of the best ways to interview is ask them to bring in a sample of some
programming work they wrote that they're proud of. Then have them walk you
through it and explain it.
 
W

Walter

Howard said:
Anyone else notice something strange about this post? I see it comes
through San Diego State University's server (newshub.sdsu.edu). Also, the
OP has not responded in any way, with their own opinions, follow-up, or
whatever. And the OP claims to be a "professional", but asks some of the
most basic questions. Isn't anyone at least suspicious that this is really
just a student taking a test or doing homework, and trying to get free
answers to questions they're supposed to either know or research themselves?
This is at least the third time I've seen someone declare they were asking
"job interview" questions, yet it seemed suspiciously like schoolwork to me.
Am I just being paranoid, or what?

LOL! I recently saw a "Dateline" episode on college cheating, where students
would wirelessly access the internet during an exam to find answers to
questions.
 
G

Gary Labowitz

Walter said:
LOL! I recently saw a "Dateline" episode on college cheating, where students
would wirelessly access the internet during an exam to find answers to
questions.

In addition to it probably being a student, there is an issue of legality
and prudence with a potential employer using a test to qualify candidates.
The general thinking goes like this:
Are the questions on the test indicative of the type of work being done?
Would being able to answer the question determine that the candidate could
do the work that the opening is for? Can you prove that the questions are
normative, non-descriminatory with respect to ethnic and cultural
differences, sex, or race? How have you qulaified the test questions such
that they are predictive of success or failure of the candidate in
performance of the actual expected work?

If there is no indication of having proof of the applicability of the test
to the specific job, and proof that the questions are actually specific to
the position being screened for, the use of the test is illegal. In
addition, it must be shown (by actual job situations) that the information
required to answer the questions is necessary to be known without reference
to generally available materials expected to be in the workplace.

It is legal, for example, to require a doctor to pass exams that require the
candidate to know various medical terms, procedures, and techniques without
reference to books, notes, or collegues in order to be certified as a
surgeon. The elements of the exam must match what a surgeon must do in
performance of general surgery. It is not expected that a surgeon will know
everything (even if they all think they do!) and that reference may have to
be made prior to a specific surgery, or even during a surgery in special
cases.

In programming, it is highly unlikely that all aspects of each language that
might be encountered during any given project would be known without
references to any given programmer. That eliminates from qualifying test
such nonesence as "Which toolbar button do you use to change the display
icon in a project?" What might be more appropriate (but still a little
"dicey") would be to ask "Can the display icon for a project be changed?"
and "What is involved in changing it?"
It is one of the disgusting aspects of the Microsoft qualifying exams for
certification that many of their questions are of the extremely specific
type covering topics that most programmers would simply look up when needed.
(And I have been certified, so I know whereof I speak; MCP, MCT, MDSD, CTT.)

I tell my students "Never memorize what you can look up." What is important
is that they understand the principles, techniques, and what's available in,
say, a language so they know what can be done, various options, and reasons
for selecting one over another. What distresses me is co-workers I have had
who have no clear understanding of what a compiler does, how the language
they're using is structured, the differences in data types, etc. This is the
basic stuff I always wished we had a qualified test for before hiring them.

IBM used to use a "Programmer Apptitude Test" in the '60s which I believe
they dropped when they were faced with legal problems trying to justify it
as predictive of success or failure. I took it in 1961, thought it was dumb,
and got hired anyway.
 
W

Walter

Gary Labowitz said:
I tell my students "Never memorize what you can look up." What is important
is that they understand the principles, techniques, and what's available in,
say, a language so they know what can be done, various options, and reasons
for selecting one over another. What distresses me is co-workers I have had
who have no clear understanding of what a compiler does, how the language
they're using is structured, the differences in data types, etc. This is the
basic stuff I always wished we had a qualified test for before hiring
them.

I agree. An educated man is not someone who knows a lot of things, but one
who knows how to find out what he needs to know. Interestingly, where I
attended college, the typical exam was "open book, open note". You could use
any books or notes you'd made as reference material. The idea was that the
tests were not regurgitation of knowledge, but were designed to determine if
you'd mastered the concepts.

For example, in math we had a lecture where the prof derived the fourier
transform from basic principles. On the final exam, one of the problems was
to derive the hyperbolic transforms. If you "got" how the ft was done, doing
the hyperbolics was straightforward. If you'd memorized formulas without
understanding, you were going to fail. A "cheat sheet" was useless, as well.

I no longer remember how to do a fourier transform or a hyperbolic one - but
I came out of college with the confidence and knowledge of how to solve
complicated problems; the subject of the problems was not relevant. And that
ability has served me very well throughout my professional career. The
cheaters on "Dateline" who justified their cheating by saying that only 3%
of the knowledge learned in college is ever applied in their career have
totally missed the point of what a college education is.
 
M

Mabden

Xenos said:
No, you are probably on to something...

Well, enough time has passed. A student usually needs the info in a very
short time frame, so altho I won't do homework, I might post something a
couple of weeks later. Especially after the attention seekers have posted 10
different answers anyway.
<rant on>
It's a pity there isn't some restraint on the part of professionals in
regards to answering simple questions. I mean, how much glory is there in
being the first person to providing the solution to an easy homework
question, and helping someone cheat. These people are seriously in need of
friends. Go see a movie or something.
</rant>
 
R

Robbie Hatley

Jatinder said:
I 'm a professional

I don't think so.
looking for the job.

That's "a job", not "the job".
In interview

That's "In an interview, ".
these questions were asked with some others which I answered.
But some of them left unanswered.

The questions got up and left?
Plz help.

Ok, I'll help you with your homework.
Q1 . What is the use of pointer to an array?

It points to it. (The name of an array is also a pointer to it.)
Q2 . What is the use of array of pointers?

It holds them. (std::vector is better in most cases, though.)
Useful for lists of pointers to polymorphic derived classes.
Q3 . What is the use of pointer to function ?

It points to it. (The name of a function is also a pointer to it.)
Great for passing one procedure to a second which runs the first,
esp. in recursive programs. Eg, this function accepts as an
argument a pointer to any void-void function:

int CursDirs (void Func(void)); // applies "Func" to each dir in tree

One can then pass a function to it by name:

void MyNiftyFunction(void) { /* do stuff */ }
result = CursDirs(MyNiftyFunction);
Q4 . How to print through serial port?

Most computers use parallel ports for that.
What is Flow Control(Xon,Xoff)

Not related to C++. Sounds like modem stuff.
Q5 . What is IOCTL Explain .

Dunno. Not related to C++, as far as I know.
Q6 . How to create an interrupt service routine in C?

In a text editor, same as with any function. But keep ISRs short, esp.
if doing firmware (which you probably are, if you're writing your own ISRs),
because while the ISR is running, the rest of your program has come
grinding to a screeching halt.
Q7. What are the internals of a scheduler?

The wire loops that hold the paper sheets.
Q8 . The static variables are declared in heap or stack ?

Definitely not the stack. Basically a static is the same as a global,
except that it is visible only to functions in the translation unit in which
it's defined.


--
Cheers,
Robbie Hatley
Tustin, CA, USA
email: lonewolfintj at pacbell dot net
(Include "[ciao]" in subject to bypass spam filters.)
web: home dot pacbell dot net slant earnur slant
 
J

John Harrison

It points to it. (The name of an array is also a pointer to it.)

No, the name of an array decays to a pointer to the first element of the
array. A pointer to an array and a pointer to the first element of an array
are not the same thing.

int a[10];
cout << &a + 1 << endl;
cout << a + 1 << endl;

The two statements print different pointer values, proving that a pointer to
an array (first case) and a pointer to the first element of an array (second
case) are not the same.

john
 
V

Victor Bazarov

Walter said:
You can't tell much from a resume. Most resumes read like the applicant
walks on water. When they list 5 years of C experience, but can't answer a
few simple questions about C, it's an easy way to separate out the real
candidates from the charlatans.

Yes, but to ask them a few simple questions about C one needn't invite
them for an interview. One should do it during a phone screening.
One of the best ways to interview is ask them to bring in a sample of some
programming work they wrote that they're proud of. Then have them walk you
through it and explain it.

That's often not possible. I have no samples of my work. They are all
copyrighted by my previous employers and I cannot simply spread them
around as I please. I can explain what I did and how, but no code will
be made available for a review. That, BTW, was precisely the point of
another poster -- talk to the interviewee, don't test them. An interview
is not for weeding out applicants. It's for in-depth research of the
remaining applicants' abilities.

Of course it all differs from company to company and mostly a moot point
anyway. Sorry to have dragged this pointless thread even further than
it was ever supposed to go.

V
 
W

Walter

Victor Bazarov said:
That's often not possible. I have no samples of my work. They are all
copyrighted by my previous employers and I cannot simply spread them
around as I please. I can explain what I did and how, but no code will
be made available for a review.

I understand and respect your wish to err on the side of caution with regard
to copyrights and trade secrets. But surely you'd have something to bring
in; an open source contribution, a hobby program written at home, even a
school project. Heck, stuff I've written runs the gamut from public domain
to super secret, from embarassing trash to novel things I should have
patented <g>.

Would you hire an architect to design a house for you without seeing any
examples of their work? Call me unreasonable, but I wouldn't.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,043
Latest member
CannalabsCBDReview

Latest Threads

Top