473,882 Members | 1,546 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

What type of questions can be asked in an technical interview of C

Frinds,

Hope everyone is doing fine.i feel pointers to be the most toughest
part in C. i have just completed learning pointers & arrays related
portions. I need to attend technical interview on C. wat type of
questions should be expected? Which part of C language do the staff
give more concern?
The interviewers have just mentioned that .. i will have interview on
C.
Also can anyone can help me with sites where i can go thru sample
programs in C?

Thanking you all...
Cherry
Nov 14 '05
56 4373

"Christian Bau" <ch***********@ cbau.freeserve. co.uk> a écrit dans le message
de news:ch******** *************** **********@slb-newsm1.svr.pol. co.uk...

Hi,
In article <c4**********@n ews-reader4.wanadoo .fr>,
"Régis Troadec" <re**@wanadoo.f r> wrote:
"Christian Bau" <ch***********@ cbau.freeserve. co.uk> a écrit dans le message de news:ch******** *************** **********@slb-newsm1.svr.pol. co.uk...
In article <c4**********@o ravannahka.hels inki.fi>,
Joona I Palaste <pa*****@cc.hel sinki.fi> wrote:

> Malcolm <ma*****@55bank .freeserve.co.u k> scribbled the following:
> > "Cherrish Vaidiyan" <un************ ***@yahoo.com> wrote in
> >> I need to attend technical interview on C. wat type of
> >> questions should be expected?
> >>
> > See if you can answer these.
>
> > What is wrong with
>
> > 3)
>
> > for(i=0;i<strle n(str);i++)
> > if(str[i] == 'a')
> > answer++;
>
> Am I blind or something? Other than doing more work than necessary (and > such slowing the program down) I can find nothing wrong with this.

If strlen (str) == 1000000, then this would be wrong enough to count as a serious bug.


I'm not sure that someone can say this code is wrong or not, since the type of i is unknown.
If i is declared as size_t, it should work.


You failed the interview.


I'm sorry but I don't think so. I agree with Malcolm's answer concerning the
problem of inefficiency but my opinion is this problem is as much a feature
of algorithm analysis and can occur in many other languages. Another point
is that you outlined a possible serious bug in your previous message when
strlen(str) == 1000000. Sure, It could be wrong enough and turn into an
infinite loop according to the type of i, if it's a short int for example,
wasn't that you meant?

Regis


Nov 14 '05 #41
In article <c4**********@n ews-reader5.wanadoo .fr>,
"Régis Troadec" <re**@wanadoo.f r> wrote:
I'm sorry but I don't think so. I agree with Malcolm's answer concerning the
problem of inefficiency but my opinion is this problem is as much a feature
of algorithm analysis and can occur in many other languages. Another point
is that you outlined a possible serious bug in your previous message when
strlen(str) == 1000000. Sure, It could be wrong enough and turn into an
infinite loop according to the type of i, if it's a short int for example,
wasn't that you meant?


How long does it take to make one million calls to strlen () when the
length of the string is one million? How likely is it that the user of
the program believes that the program just crashed and gives up? If this
program runs on a portable computer, will it finish with one battery?

Since this thread is about a job interview: How likely is it that
customers will complain and stop buying your software if the programmers
do nonsense like this?
Nov 14 '05 #42
In article <c4**********@n ews-reader5.wanadoo .fr>,
"Régis Troadec" <re**@wanadoo.f r> wrote:
I'm sorry but I don't think so. I agree with Malcolm's answer concerning the
problem of inefficiency but my opinion is this problem is as much a feature
of algorithm analysis and can occur in many other languages. Another point
is that you outlined a possible serious bug in your previous message when
strlen(str) == 1000000. Sure, It could be wrong enough and turn into an
infinite loop according to the type of i, if it's a short int for example,
wasn't that you meant?


How long does it take to make one million calls to strlen () when the
length of the string is one million? How likely is it that the user of
the program believes that the program just crashed and gives up? If this
program runs on a portable computer, will it finish with one battery?

Since this thread is about a job interview: How likely is it that
customers will complain and stop buying your software if the programmers
do nonsense like this?
Nov 14 '05 #43
"Régis Troadec" wrote:
"Christian Bau" <ch***********@ cbau.freeserve. co.uk> a écrit:

.... snip ...
> >
> > > What is wrong with
> >
> > > 3)
> >
> > > for(i=0;i<strle n(str);i++)
> > > if(str[i] == 'a')
> > > answer++;
> >
.... snip ...
You failed the interview.


I'm sorry but I don't think so. I agree with Malcolm's answer
concerning the problem of inefficiency but my opinion is this
problem is as much a feature of algorithm analysis and can occur
in many other languages. Another point is that you outlined a
possible serious bug in your previous message when strlen(str)
== 1000000. Sure, It could be wrong enough and turn into an
infinite loop according to the type of i, if it's a short int
for example, wasn't that you meant?


Nobody seems to have bothered to point out that str itself may be
volatile and is being dynamically modified, in which case those
who want to store the entry value of strlen(str) are introducing
bugs. As a matter of fact, there is no need to EVER call strlen
for this:

for (p = str; *p; p++)
if ('a' == *p) answer++;

The original code is inefficient, not wrong. Bubblesort is also
inefficient, not wrong.

The thing that is *wrong* with the original code is the lack of
blanks in the source.

--
A: Because it fouls the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
Nov 14 '05 #44
"Régis Troadec" wrote:
"Christian Bau" <ch***********@ cbau.freeserve. co.uk> a écrit:

.... snip ...
> >
> > > What is wrong with
> >
> > > 3)
> >
> > > for(i=0;i<strle n(str);i++)
> > > if(str[i] == 'a')
> > > answer++;
> >
.... snip ...
You failed the interview.


I'm sorry but I don't think so. I agree with Malcolm's answer
concerning the problem of inefficiency but my opinion is this
problem is as much a feature of algorithm analysis and can occur
in many other languages. Another point is that you outlined a
possible serious bug in your previous message when strlen(str)
== 1000000. Sure, It could be wrong enough and turn into an
infinite loop according to the type of i, if it's a short int
for example, wasn't that you meant?


Nobody seems to have bothered to point out that str itself may be
volatile and is being dynamically modified, in which case those
who want to store the entry value of strlen(str) are introducing
bugs. As a matter of fact, there is no need to EVER call strlen
for this:

for (p = str; *p; p++)
if ('a' == *p) answer++;

The original code is inefficient, not wrong. Bubblesort is also
inefficient, not wrong.

The thing that is *wrong* with the original code is the lack of
blanks in the source.

--
A: Because it fouls the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
Nov 14 '05 #45
In article <40************ ***@yahoo.com>,
CBFalconer <cb********@yah oo.com> wrote:
Nobody seems to have bothered to point out that str itself may be
volatile and is being dynamically modified, in which case those
who want to store the entry value of strlen(str) are introducing
bugs. As a matter of fact, there is no need to EVER call strlen
for this:

for (p = str; *p; p++)
if ('a' == *p) answer++;
You mean str points to volatile data, not str is volatile, right? If the
string pointed to by str is dynamically modified, then your code is very
likely to fail: str[101] might be zero, but when p == &str [50], str
[101] is changed to nonzero and str [0] is set to zero.

The original code is inefficient, not wrong.
When the code becomes so inefficient that it cannot do what it is
supposed to do, that makes it wrong.

Bubblesort is also
inefficient, not wrong.

Nov 14 '05 #46
In article <40************ ***@yahoo.com>,
CBFalconer <cb********@yah oo.com> wrote:
Nobody seems to have bothered to point out that str itself may be
volatile and is being dynamically modified, in which case those
who want to store the entry value of strlen(str) are introducing
bugs. As a matter of fact, there is no need to EVER call strlen
for this:

for (p = str; *p; p++)
if ('a' == *p) answer++;
You mean str points to volatile data, not str is volatile, right? If the
string pointed to by str is dynamically modified, then your code is very
likely to fail: str[101] might be zero, but when p == &str [50], str
[101] is changed to nonzero and str [0] is set to zero.

The original code is inefficient, not wrong.
When the code becomes so inefficient that it cannot do what it is
supposed to do, that makes it wrong.

Bubblesort is also
inefficient, not wrong.

Nov 14 '05 #47

"Christian Bau" <ch***********@ cbau.freeserve. co.uk> wrote in message
news:ch******** *************** **********@slb-newsm1.svr.pol. co.uk...
In article <c4**********@n ews-reader4.wanadoo .fr>,
"Régis Troadec" <re**@wanadoo.f r> wrote:
"Christian Bau" <ch***********@ cbau.freeserve. co.uk> a écrit dans le message de news:ch******** *************** **********@slb-newsm1.svr.pol. co.uk...
In article <c4**********@o ravannahka.hels inki.fi>,
Joona I Palaste <pa*****@cc.hel sinki.fi> wrote:

> Malcolm <ma*****@55bank .freeserve.co.u k> scribbled the following:
> > "Cherrish Vaidiyan" <un************ ***@yahoo.com> wrote in
> >> I need to attend technical interview on C. wat type of
> >> questions should be expected?
> >>
> > See if you can answer these.
>
> > What is wrong with
>
> > 3)
>
> > for(i=0;i<strle n(str);i++)
> > if(str[i] == 'a')
> > answer++;
>
> Am I blind or something? Other than doing more work than necessary (and > such slowing the program down) I can find nothing wrong with this.

If strlen (str) == 1000000, then this would be wrong enough to count as a serious bug.


I'm not sure that someone can say this code is wrong or not, since the type of i is unknown.
If i is declared as size_t, it should work.


You failed the interview.


Why? If the interviewer is looking at knowledge of the C language, then
this is an excellent answer and I would be pleased to get it. Given
certain assumptions about the types of i, str, and answer, there is
nothing "wrong" with this as an example of C code. Pointing out how the
code would go wrong with inappropriate types for these variables would
be a great answer about C itself.

Having got (or not got) that answer I would then go on to say "Is there
anything wrong with that code as a section of a real-world program?" and
I would expect to get the performance answer.

The moral is to think about all aspects of the question, and don't assume
that the questioner is really asking the question that his words make up.
Talk about all aspects of the question.

Nov 14 '05 #48

"Christian Bau" <ch***********@ cbau.freeserve. co.uk> wrote in message
news:ch******** *************** **********@slb-newsm1.svr.pol. co.uk...
In article <c4**********@n ews-reader4.wanadoo .fr>,
"Régis Troadec" <re**@wanadoo.f r> wrote:
"Christian Bau" <ch***********@ cbau.freeserve. co.uk> a écrit dans le message de news:ch******** *************** **********@slb-newsm1.svr.pol. co.uk...
In article <c4**********@o ravannahka.hels inki.fi>,
Joona I Palaste <pa*****@cc.hel sinki.fi> wrote:

> Malcolm <ma*****@55bank .freeserve.co.u k> scribbled the following:
> > "Cherrish Vaidiyan" <un************ ***@yahoo.com> wrote in
> >> I need to attend technical interview on C. wat type of
> >> questions should be expected?
> >>
> > See if you can answer these.
>
> > What is wrong with
>
> > 3)
>
> > for(i=0;i<strle n(str);i++)
> > if(str[i] == 'a')
> > answer++;
>
> Am I blind or something? Other than doing more work than necessary (and > such slowing the program down) I can find nothing wrong with this.

If strlen (str) == 1000000, then this would be wrong enough to count as a serious bug.


I'm not sure that someone can say this code is wrong or not, since the type of i is unknown.
If i is declared as size_t, it should work.


You failed the interview.


Why? If the interviewer is looking at knowledge of the C language, then
this is an excellent answer and I would be pleased to get it. Given
certain assumptions about the types of i, str, and answer, there is
nothing "wrong" with this as an example of C code. Pointing out how the
code would go wrong with inappropriate types for these variables would
be a great answer about C itself.

Having got (or not got) that answer I would then go on to say "Is there
anything wrong with that code as a section of a real-world program?" and
I would expect to get the performance answer.

The moral is to think about all aspects of the question, and don't assume
that the questioner is really asking the question that his words make up.
Talk about all aspects of the question.

Nov 14 '05 #49
In <f0************ **************@ posting.google. com> un************* **@yahoo.com (Cherrish Vaidiyan) writes:
Hope everyone is doing fine.i feel pointers to be the most toughest
part in C. i have just completed learning pointers & arrays related
portions. I need to attend technical interview on C. wat type of
questions should be expected? Which part of C language do the staff
give more concern?
The interviewers have just mentioned that .. i will have interview on
C.
Also can anyone can help me with sites where i can go thru sample
programs in C?


If you read (and understand) the FAQ, you should be well prepared for
an interview dealing with language technicalities.

Dan
--
Dan Pop
DESY Zeuthen, RZ group
Email: Da*****@ifh.de
Nov 14 '05 #50

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

35
404
by: Cherrish Vaidiyan | last post by:
Frinds, Hope everyone is doing fine.i feel pointers to be the most toughest part in C. i have just completed learning pointers & arrays related portions. I need to attend technical interview on C. wat type of questions should be expected? Which part of C language do the staff give more concern? The interviewers have just mentioned that .. i will have interview on C. Also can anyone can help me with sites where i can go thru sample
3
2033
by: Dougie | last post by:
Hi, I have an interview later in the week and I've been told that I'll be asked technical questions about ASP.NET. The job is for the position of .NET Web developer and I just wondered if any of you guys had any experience of technical interviews of this nature. Many thanks, Doug.
0
3438
by: reema | last post by:
EJB Interview Questions http://interviewdoor.com/technical/EJB-Interview-Questions.htm CSS Interview Questions http://interviewdoor.com/technical/CSS-Interview-Questions.htm C Interview Questions http://interviewdoor.com/technical/C-Interview-Questions.htm C# Interview Questions http://interviewdoor.com/technical/C-sharp-Interview-Questions.htm C++ Interview Questions http://interviewdoor.com/technical/C++-Interview-Questions.htm
0
2950
by: reema | last post by:
EJB Interview Questions http://interviewdoor.com/technical/EJB-Interview-Questions.htm CSS Interview Questions http://interviewdoor.com/technical/CSS-Interview-Questions.htm C Interview Questions http://interviewdoor.com/technical/C-Interview-Questions.htm C# Interview Questions http://interviewdoor.com/technical/C-sharp-Interview-Questions.htm C++ Interview Questions http://interviewdoor.com/technical/C++-Interview-Questions.htm
0
9931
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
10830
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9557
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
7113
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5781
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5978
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4601
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4198
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3226
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.