c interview

D

dis_is_eagle

hi....i am preparing for interview...where can i get helpful c
interview questions and tips...also,can anybody provide me with a soft
copy of the c-faq book...thanx and regards..

eric
 
K

Keith Thompson

hi....i am preparing for interview...where can i get helpful c
interview questions and tips...also,can anybody provide me with a soft
copy of the c-faq book...thanx and regards..

<http://www.c-faq.com/>

I'm not sure whether it contains everything that's in the book.
 
C

Christopher Benson-Manica

See if these puzzles are of any help to you:
http://www.gowrikumar.com/c/index.html

IMHO, most of these questions are reflective of the silly "gotcha"
questions that often pass as interview questions - not *your* fault,
of course. However, regular readers of comp.lang.c will find a number of
things to nitpick about that you (and many employers) have either
failed to account for or are simply unaware of. To cite possibly the
most obvious example, the return value of malloc() is always cast in
your sample questions; a quick Google search of this group's archives
will reveal that the experts' consensus is that this is a bad idea, an
opinion shared by the FAQ:

http://c-faq.com/malloc/cast.html
http://c-faq.com/malloc/mallocnocast.html

I believe a thorough reading of the FAQ will help you improve both
your quiz and your practical knowledge of C.
 
G

gkumar007

Hi Benson,
Glad to see your reply.
However, regular readers of comp.lang.c will find a number of
things to nitpick about that you (and many employers) have either
failed to account for or are simply unaware of.
Firstly, I'm not an expert in C programming and I'm still learning.
It's an effort I'm making to share the little knowledge I have gained
with others and also to learn more in the process
I would be grateful, if you/anyone here can point out all the mistakes
and provide the suggestions to make it better.
To cite possibly the
most obvious example, the return value of malloc() is always cast in
your sample questions; a quick Google search of this group's archives
will reveal that the experts' consensus is that this is a bad idea, an
opinion shared by the FAQ:

http://c-faq.com/malloc/cast.html
http://c-faq.com/malloc/mallocnocast.html
I would modify the sources appropriately.
I believe a thorough reading of the FAQ will help you improve both
your quiz and your practical knowledge of C.
Thanks for the suggestion. I will do that soon.

Also, if anyone has else has feedback on the questions, please feel
free to send them across to me.

Have a terrific day!!!

Regards,
Gowri Kumar
 
J

J. J. Farrell

Christopher said:
IMHO, most of these questions are reflective of the silly "gotcha"
questions that often pass as interview questions - not *your* fault,
of course. However, regular readers of comp.lang.c will find a number of
things to nitpick about that you (and many employers) have either
failed to account for or are simply unaware of. To cite possibly the
most obvious example, the return value of malloc() is always cast in
your sample questions;

To be fair though, in one of them at least that's part of the point of
the example - the lack of a proper declaration of malloc() is the cause
of the problem, and the cast hides it (sometimes). It is a shame that
having started off with a good example of why it's bad to cast
malloc(), the rest of the examples do so!

The site reminds me of a classic FAQ list I came across once; answers
and explanations would be helpful.
 
D

dis_is_eagle

hi GK...u rocks...ur questions too!!!....thanx for the materials...i am
also learning c and found ur reference to be very interesting....hav u
got ny soft-copy of the book programming pearls...i would like to hav
it....bye..regards...eric
 
S

Sjouke Burry

hi GK...u rocks...ur questions too!!!....thanx for the materials...i am
also learning c and found ur reference to be very interesting....hav u
got ny soft-copy of the book programming pearls...i would like to hav
it....bye..regards...eric
Well boy, keep emitting this shitty language and
I am sure you will join the dole.
 
K

Keith Thompson

hi GK...u rocks...ur questions too!!!....thanx for the materials...i am
also learning c and found ur reference to be very interesting....hav u
got ny soft-copy of the book programming pearls...i would like to hav
it....bye..regards...eric

*Please* don't use silly abbreviations when you post here. Take the
time to spell out words: "you", "your", "have", "any", etc.
Capitalize the word "I" and the first word of each sentence. A
sentence ends with a single ".", not an ellipsis "...".

We're here to communicate. If you're not interested in doing so, try
somewhere else.

I'm familiar with the book "Programming Pearls". As far as I know,
there is no legally obtainable soft copy (and we will not help you
obtain an illegal one).

A good introduction to this newsgroup is at
<http://clc-wiki.net/wiki/Introduction_to_comp.lang.c>.
 
G

gkumar007

Hi Benson,
I would modify the sources appropriately.
Done.
I have modified the sources (except one) using malloc to not to cast.

Anything else needs to be corrected?

Regards,
Gowri Kumar
 
J

jaysome

hi....i am preparing for interview...where can i get helpful c
interview questions and tips

I don't necessarily know about any helpful C interview questions and
tips I can help you with, but for what it's worth, here's the
transcript of the start of an interview I could envision with someone
(denoted by "I", for the Interviewee):

Me: What you see on the white board is a sentence written with
improper capitalization and grammar ("i am preparing for interview.").
Go up there and write in the corrected sentence just below it.

I: That question has nothing to do with "C". Can you ask me a question
about "C"? ... sir? ... after all, I've prepared well to answer
questions about "C" ... sir ... isn't that what you want? ... sir? ...
please ... sir ... help me.

Me: Thank you Mr. I. Lilly is now here to escort you out the door.
...also,can anybody provide me with a soft
copy of the c-faq book...thanx and regards..

I hope the soft copy never comes out. Buy the hard copy. It was the
best money I ever spent, and your mileage shouldn't vary.
 
R

Richard Heathfield

(e-mail address removed) said:
Hi Benson,
Done.
I have modified the sources (except one) using malloc to not to cast.

Anything else needs to be corrected?

Yes. I'll get back to you when I have more time - hopefully later today. If
I haven't replied by, say, six hours from the time this arrives on your
server, reply to this message.
 
A

apoelstra

Hi Benson,
Done.
I have modified the sources (except one) using malloc to not to cast.

Anything else needs to be corrected?

I've lost the original message. Could you repost the link?
 
A

Ancient_Hacker

hi....i am preparing for interview...where can i get helpful c
interview questions and tips...also,can anybody provide me with a soft
copy of the c-faq book...thanx and regards..

eric

Just my opinion, but you probably don't want to try faking it at an
interview. I can think up a dozen questions that are only answerable
if you have real experience. Especially if you say you have xxx years
of experience with xxxx C. Questions like:

(1) If you've used this compiler more than 10 minutes, you've gotten
the message "Insincere declaration of fungible foggy entity". What
does this message really mean? (Most compilers have at least one very
opaque het always-poping up error message). You rarely can learn this
by reading a book.

(2) If you've ever compiled anything with this compiler, you've gotten
the run-time message "Seg Voil @ A0056" What do you do to find the
cause of the problem. (Generic FAQ's are not very helpful in learning
the quirks of a particular debugger).

(3) That compiler likes to emit lots of one particular relatively
harmless warning. How do you turn off just that warning (If you are a
good programmer, you've probably enabled FULL warnings, but you most
likely need to turn at least one of them off with a -NoWarn:C4996 )

..... and being found out to be a charlatan is a really good way to
free up the rest of your morning. No more tedious interviews for you!


On the other hand, if they lob softball questions at you, they're
probably not going to be of much help to you if you're hired. Watch
out for this too.
 
C

Christopher Benson-Manica

Ancient_Hacker said:
On the other hand, if they lob softball questions at you, they're
probably not going to be of much help to you if you're hired. Watch
out for this too.

This, at least, is true, as I've learned the hard way.
 
K

Kenneth Brody

Christopher said:
This, at least, is true, as I've learned the hard way.

I think every "C interview" should be mandated to include:

1) What is the expected output of this program?

void main()
{
int i = 10;
i = i++;
printf("%d",i);
}

This would allow both the interviewer and interviewee to determine
if they're well matched.

--
+-------------------------+--------------------+-----------------------+
| Kenneth J. Brody | www.hvcomputer.com | #include |
| kenbrody/at\spamcop.net | www.fptech.com | <std_disclaimer.h> |
+-------------------------+--------------------+-----------------------+
Don't e-mail me at: <mailto:[email protected]>
 
R

Richard Heathfield

Kenneth Brody said:
I think every "C interview" should be mandated to include:

1) What is the expected output of this program?

void main()
{
int i = 10;
i = i++;
printf("%d",i);
}

That one's easy. It will - or at least should - output: "Fire the author of
this code, and hire someone who knows the language instead." If it doesn't,
that's because of the famous "printf bug" in their compiler.
 
R

Richard Heathfield

(e-mail address removed) said:
Hi Benson,
Done.
I have modified the sources (except one) using malloc to not to cast.

Anything else needs to be corrected?

On looking at the page again, I decided not to prepare a list. The
superficial bugs - the ones the author put in deliberately (because that's
the puzzle, so to speak) - are sufficiently jumpy-outy that I can't easily
see past them to any underlying bugs (which might not even be there, after
all) without spending more time than I am prepared to devote to the task.
 
S

spibou

Hi eric,

See if these puzzles are of any help to you:
http://www.gowrikumar.com/c/index.html

That's quite a resource you got there Gowri. I especially
like the "programming interview questions". You don't
seem to have the one which asks how you can detect a
cycle in a link list. If I remember correctly van der Linden
says that they always ask that at Sun interviews.

You should put answers somewhere or at least hints. By
the way in question 65 are you allowed to flip discs ? In
75 I'm not clear what you're asking.

Spiros Bousbouras
 

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

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top