hello,
I was asked this question during a job interview, and didn't know the answer.
could someone please help me with that?
the question was: "Which files are more suitable for working in C, ascii or binary?"
10-x all,
Miki
|
|
0
|
|
|
|
Reply
|
mikimikiboom (1)
|
6/25/2004 8:47:20 AM |
|
mikimikiboom@yahoo.com (miki) wrote:
> I was asked this question during a job interview, and didn't know the answer.
> could someone please help me with that?
> the question was: "Which files are more suitable for working in C, ascii or binary?"
Get out of there. If they think that question even _has_ a simple
answer, you don't want to be working for them, it'll be a Dilbert
environment. Unless, of course, they know very well that the answer is
"both; which you use depends entirely on the application", and were
trying to trick you; in which case, ditto.
Richard
|
|
0
|
|
|
|
Reply
|
rlb (4118)
|
6/25/2004 10:02:12 AM
|
|
Richard Bos wrote:
> mikimikiboom@yahoo.com (miki) wrote:
>
>
>>I was asked this question during a job interview, and didn't know the answer.
>>could someone please help me with that?
>>the question was: "Which files are more suitable for working in C, ascii or binary?"
>
>
> Get out of there. If they think that question even _has_ a simple
> answer, you don't want to be working for them, it'll be a Dilbert
> environment. Unless, of course, they know very well that the answer is
> "both; which you use depends entirely on the application", and were
> trying to trick you; in which case, ditto.
One way to get an idea of someone's abilities is to
ask a superficially simple question of this sort and see
whether the respondent can peel a few layers from the onion.
C.f. Clifford Stoll's retelling (in "The Cuckoo's Egg") of
his oral examination for his PhD in something astronomical:
One of his examiners asked "Why is the sky blue?" Stoll says
he felt relieved to get such a simple question -- but the
relief soon vanished. The guy kept asking "Can you be more
specific?" and Stoll found himself filling blackboard after
blackboard with equations of quantum electrodynamics ...
It's a mistake to assume too much about an interviewer's
reasons for asking a question.
--
Eric.Sosman@sun.com
|
|
0
|
|
|
|
Reply
|
Eric.Sosman (4228)
|
6/25/2004 2:01:35 PM
|
|
In <40DC303F.3060809@sun.com> Eric Sosman <Eric.Sosman@sun.com> writes:
> One way to get an idea of someone's abilities is to
>ask a superficially simple question of this sort and see
>whether the respondent can peel a few layers from the onion.
>C.f. Clifford Stoll's retelling (in "The Cuckoo's Egg") of
>his oral examination for his PhD in something astronomical:
>One of his examiners asked "Why is the sky blue?" Stoll says
>he felt relieved to get such a simple question -- but the
>relief soon vanished. The guy kept asking "Can you be more
>specific?" and Stoll found himself filling blackboard after
>blackboard with equations of quantum electrodynamics ...
Probably a fake story. Or the guy was unable to provide a simple answer
to a simple question. Classical electrodynamics is enough for the
dispersion of electromagnetic radiation in air and the law governing
it is well known. Once you have invoked it and pointed out that,
according to it, higher frequencies are dispersed more than lower
frequencies (and that blue light is toward the high end of the visible
light frequency spectrum), you can't be more specific than that. Maybe
a little colorimetry is needed to explain why blue and not violet.
Dan
--
Dan Pop
DESY Zeuthen, RZ group
Email: Dan.Pop@ifh.de
|
|
0
|
|
|
|
Reply
|
Dan.Pop (3615)
|
6/25/2004 2:43:39 PM
|
|
On Fri, 25 Jun 2004, miki wrote:
> hello, I was asked this question during a job interview, and didn't know
> the answer. could someone please help me with that? the question was:
> "Which files are more suitable for working in C, ascii or binary?"
Why do you think there is ONE answer? My first thought is, why would
someone ask this question. I can come up with some theories. The
possibilities are endless though. It could be the interviewer wants
someone who asks questions. It could be they believe there is one answer
to this question. It could be the interview is bored, decided they don't
want to hire you and are just messing with you now.
The list can go on and on. I'd just tell him what I think is the right
answer. I might ask a few questions myself (never be afraid to ask for
clarification). In the end, I'd ask the interviewer what they were
expecting from that question.
--
Send e-mail to: darrell at cs dot toronto dot edu
Don't send e-mail to vice.president@whitehouse.gov
|
|
0
|
|
|
|
Reply
|
darrell13 (357)
|
6/25/2004 3:42:11 PM
|
|
"Richard Bos" <rlb@hoekstra-uitgeverij.nl> wrote in message
news:40dbf7bf.75536602@news.individual.net...
> mikimikiboom@yahoo.com (miki) wrote:
> > the question was: "Which files are more suitable for working in C, ascii
or binary?"
>
> Get out of there. If they think that question even _has_ a simple
> answer, you don't want to be working for them, it'll be a Dilbert
> environment. Unless, of course, they know very well that the answer is
> "both; which you use depends entirely on the application", and were
> trying to trick you; in which case, ditto.
It could be a trick question. In C you have no concept of ascii files. You
have text file and binary files.
Regards,
Martin
|
|
0
|
|
|
|
Reply
|
Martin
|
6/25/2004 7:28:58 PM
|
|
miki wrote:
>
> hello,
> I was asked this question during a job interview, and didn't know the answer.
> could someone please help me with that?
> the question was: "Which files are more suitable for working in C, ascii or binary?"
>
> 10-x all,
> Miki
Without knowing too much about the rest of your
interview, I speculate that the question may
represent a _bias_ against one or the other.
I worked at a company that did their
Middleware as binary but were unsuccessful.
The project managers' perception was that
binary was inherently bad. After a staff
replacement (no kidding), they switched to ASCII.
Even though the bandwidth was reduced significantly,
it was "better". It's difficult to understand
their viewpoint, but it wasn't based on
any sound judgment I'm aware of...
-
Stephen
|
|
0
|
|
|
|
Reply
|
sdlnospamar2 (11)
|
6/25/2004 8:27:13 PM
|
|
"Richard Bos" <rlb@hoekstra-uitgeverij.nl> wrote in message
>
> > "Which files are more suitable for working in C, ascii or
> > binary?"
>
> Get out of there. If they think that question even _has_ a simple
> answer, you don't want to be working for them, it'll be a Dilbert
> environment.
>
You just don't know. If they expect a one word "right" answer then I agree
that the job is probably not worth having. However if they expect you to
talk intelligently about the advantages of each (text is portable, and is
easy to examine by a human, however a binary file is usually portable enough
if specifed correctly, is usually easier to parse, and is more compact) then
I don't see anything wrong with the question.
|
|
0
|
|
|
|
Reply
|
Malcolm
|
6/25/2004 10:11:43 PM
|
|
"miki" <mikimikiboom@yahoo.com> wrote in message
news:e93cabb2.0406250047.795f902b@posting.google.com...
> hello,
> I was asked this question during a job interview, and didn't know the
answer.
> could someone please help me with that?
> the question was: "Which files are more suitable for working in C, ascii
or binary?"
>
> 10-x all,
> Miki
Interesting discussion indeed:
With standard C, one can store and retrieve even complex data structure (not
containing memory references) or array of these structures with single ANSI
C call. Assuming the same platform endianity, alingment and padding.
I guess somebody can say the same about ASCII files using printf() / scanf()
.... however, arbitrary size arrays will require more than single call.
Anyway, my answer to the question above would be binary.
Roman
|
|
0
|
|
|
|
Reply
|
roman1 (23)
|
6/26/2004 12:28:30 AM
|
|
miki wrote:
> hello,
> I was asked this question during a job interview, and didn't know the answer.
> could someone please help me with that?
> the question was: "Which files are more suitable for working in C, ascii or binary?"
>
> 10-x all,
> Miki
The answer is, the guy interviewing you does not know C. You have a %50/%50 shot of
getting the answer he wants to hear.
--
Samiam is Scott A. Moore
Personal web site: http:/www.moorecad.com/scott
My electronics engineering consulting site: http://www.moorecad.com
ISO 7185 Standard Pascal web site: http://www.moorecad.com/standardpascal
Classic Basic Games web site: http://www.moorecad.com/classicbasic
The IP Pascal web site, a high performance, highly portable ISO 7185 Pascal
compiler system: http://www.moorecad.com/ippas
Being right is more powerfull than large corporations or governments.
The right argument may not be pervasive, but the facts eventually are.
|
|
0
|
|
|
|
Reply
|
samiam2 (139)
|
6/26/2004 8:53:25 AM
|
|
miki wrote:
>
> hello,
> I was asked this question during a job interview, and didn't know the answer.
> could someone please help me with that?
> the question was: "Which files are more suitable for working in C, ascii or
> binary?"
"Both, and neither."
This cannot be answered without knowing what the files are to be used for.
Think of the C compiler itself, which is probably written in C. It takes
text source files and creates binary object files. (Though I suppose
that even this might be 'implementation dependent".) It doesn't make much
sense to use binary source files, and it makes even less sense to make
text object files. (Though again, this is a simplification, since the C
compilers I have used on *nix systems actually create text files of
assembler source code. Of course, this is then passed to the assembler
[probably written in C] which takes the text assembler source and then
creates the binary object file.)
Some files are naturally text format, and some are naturally binary, and
which type you use depends on the file's purpose, and not on C.
Are you sure you want to work for a place that thinks the question has an
answer? (Unless the question was meant to get you to thinking about the
concepts of text-vs-binary, and to give more than a simple answer. But,
what are the odss of that?)
--
+-------------------------+--------------------+-----------------------------+
| Kenneth J. Brody | www.hvcomputer.com | |
| kenbrody at spamcop.net | www.fptech.com | #include <std_disclaimer.h> |
+-------------------------+--------------------+-----------------------------+
|
|
0
|
|
|
|
Reply
|
kenbrody (1860)
|
6/26/2004 3:47:19 PM
|
|
Eric Sosman wrote:
[...]
> >>"Which files are more suitable for working in C, ascii or binary?"
> >
> >
> > Get out of there. If they think that question even _has_ a simple
> > answer, you don't want to be working for them, it'll be a Dilbert
> > environment. Unless, of course, they know very well that the answer is
> > "both; which you use depends entirely on the application", and were
> > trying to trick you; in which case, ditto.
>
> One way to get an idea of someone's abilities is to
> ask a superficially simple question of this sort and see
> whether the respondent can peel a few layers from the onion.
> C.f. Clifford Stoll's retelling (in "The Cuckoo's Egg") of
> his oral examination for his PhD in something astronomical:
> One of his examiners asked "Why is the sky blue?" Stoll says
> he felt relieved to get such a simple question -- but the
> relief soon vanished. The guy kept asking "Can you be more
> specific?" and Stoll found himself filling blackboard after
> blackboard with equations of quantum electrodynamics ...
>
> It's a mistake to assume too much about an interviewer's
> reasons for asking a question.
ObRemindsMeOfAStory:
Young boy asks his father "where did I come from?" Father goes through
the whole "birds and bees" story. Father asks son "do you have any more
questions?" Son says he does, and asks "Billy says he comes from New
Jersey, and I want to know where I came from."
--
+-------------------------+--------------------+-----------------------------+
| Kenneth J. Brody | www.hvcomputer.com | |
| kenbrody at spamcop.net | www.fptech.com | #include <std_disclaimer.h> |
+-------------------------+--------------------+-----------------------------+
|
|
0
|
|
|
|
Reply
|
kenbrody (1860)
|
6/26/2004 3:52:57 PM
|
|
Dan Pop wrote:
>
> In <40DC303F.3060809@sun.com> Eric Sosman <Eric.Sosman@sun.com> writes:
>
> > One way to get an idea of someone's abilities is to
> >ask a superficially simple question of this sort and see
> >whether the respondent can peel a few layers from the onion.
> >C.f. Clifford Stoll's retelling (in "The Cuckoo's Egg") of
> >his oral examination for his PhD in something astronomical:
> >One of his examiners asked "Why is the sky blue?" Stoll says
> >he felt relieved to get such a simple question -- but the
> >relief soon vanished. The guy kept asking "Can you be more
> >specific?" and Stoll found himself filling blackboard after
> >blackboard with equations of quantum electrodynamics ...
>
> Probably a fake story. Or the guy was unable to provide a simple answer
> to a simple question. Classical electrodynamics is enough for the
> dispersion of electromagnetic radiation in air and the law governing
> it is well known. Once you have invoked it and pointed out that,
> according to it, higher frequencies are dispersed more than lower
> frequencies (and that blue light is toward the high end of the visible
> light frequency spectrum), you can't be more specific than that. Maybe
> a little colorimetry is needed to explain why blue and not violet.
I thought everyone knew why the sky is blue: because if it were green,
we wouldn't know where to stop mowing.
--
+-------------------------+--------------------+-----------------------------+
| Kenneth J. Brody | www.hvcomputer.com | |
| kenbrody at spamcop.net | www.fptech.com | #include <std_disclaimer.h> |
+-------------------------+--------------------+-----------------------------+
|
|
0
|
|
|
|
Reply
|
kenbrody (1860)
|
6/26/2004 3:54:42 PM
|
|
On 25 Jun 2004 01:47:20 -0700, mikimikiboom@yahoo.com (miki) wrote:
>hello,
>I was asked this question during a job interview, and didn't know the answer.
>could someone please help me with that?
>the question was: "Which files are more suitable for working in C, ascii or binary?"
ascii
>10-x all,
>Miki
|
|
0
|
|
|
|
Reply
|
n7757 (175)
|
7/1/2004 4:13:47 PM
|
|
On 25 Jun 2004 14:43:39 GMT, Dan Pop <Dan.Pop@cern.ch> wrote:
> In <40DC303F.3060809@sun.com> Eric Sosman <Eric.Sosman@sun.com> writes:
>
>> One way to get an idea of someone's abilities is to
>>ask a superficially simple question of this sort and see
>>whether the respondent can peel a few layers from the onion.
>>C.f. Clifford Stoll's retelling (in "The Cuckoo's Egg") of
>>his oral examination for his PhD in something astronomical:
>>One of his examiners asked "Why is the sky blue?" Stoll says
>>he felt relieved to get such a simple question -- but the
>>relief soon vanished. The guy kept asking "Can you be more
>>specific?" and Stoll found himself filling blackboard after
>>blackboard with equations of quantum electrodynamics ...
>
> Probably a fake story. Or the guy was unable to provide a simple answer
> to a simple question. Classical electrodynamics is enough for the
> dispersion of electromagnetic radiation in air and the law governing
> it is well known. Once you have invoked it and pointed out that,
> according to it, higher frequencies are dispersed more than lower
> frequencies (and that blue light is toward the high end of the visible
> light frequency spectrum), you can't be more specific than that.
Examiner: "you've shown me what the response to scattering in air is.
But still, why is the sky *blue*?"
You need then to assert the Planck black body law for the photosphere
of the Sun (which requires quantum mechanics somewhere)---but then
probably also an examiner will ask you to justify certain assumptions
and pursue what happens if you want a more detailed calculation
(e.g. the QED formulation perhaps to justify the black body law, and
some physical reasoning about scattering lengths to justify the black
body).
A tougher followup on the classical end is to then ask, we know the
sky is blue but how will it look through polarized sunglasses?"
> Dan
> --
> Dan Pop
> DESY Zeuthen, RZ group
> Email: Dan.Pop@ifh.de
|
|
0
|
|
|
|
Reply
|
mbkennelSPAMBEGONE (260)
|
7/6/2004 4:15:19 AM
|
|
On Sat, 26 Jun 2004 08:53:25 GMT, Scott Moore <samiam@moorecad.com> wrote:
> miki wrote:
>
>> hello,
>> I was asked this question during a job interview, and didn't know the answer.
>> could someone please help me with that?
>> the question was: "Which files are more suitable for working in C, ascii or binary?"
>>
>> 10-x all,
>> Miki
>
> The answer is, the guy interviewing you does not know C. You have a %50/%50 shot of
> getting the answer he wants to hear.
Or it was a trick question to weed out bullshitters, and a good reply is
"neither, C has specific capability for stream-oriented I/O as opposed
to strictly record-oriented I/O, but makes little distinction between
ASCII or binary."
|
|
0
|
|
|
|
Reply
|
mbkennelSPAMBEGONE (260)
|
7/6/2004 4:18:31 AM
|
|
|
15 Replies
32 Views
(page loaded in 0.253 seconds)
Similiar Articles: write out large array to ascii file - comp.lang.fortranWhat is the reason you want ASCII for? Writing binary files would speed up the process. For post-processing/reading the output you can write separate routines ... Writing non ASCII text files - comp.lang.tclSorry Alex, but writing internal hold UTF-8 text binary to a file ... comp.lang.tcl how to ... os ... lang.awk The American Standard Code for Information Interchange ... Why do pointer values display as ASCII characters instead of HEX ...Ascii vs. Binary Files - Department of Computer Science... saved as characters, do you? Don't you know about the ASCII ... 0100 1001, instead of the ASCII code for '4 ... portability of integral types in C++ on UNIX - comp.unix ...... uint16_t int16_t uint32_t int32_t uint64_t int64_t Note, also, that the choice to use binary vs. ascii has been made; our users are going to show up with binary files ... Reading an unformatted file - comp.lang.fortranJust saying that "ASCII rules" sweeps a multitude of compatibility problems ... FORTRAN unformatted binary files in C/C++ Reading FORTRAN unformatted binary files in C ... comp.soft-sys.matlab - page 44ASCII vs. binary 3 4 (10/24/2003 5:29:18 PM) Hello, I have a large set of ASCII data (> 250Mb in size). ... 19:53 PM) Hi All: When I run the executable file ... gnuplot data.txt file with CR+LF - comp.graphics.apps.gnuplot ...Writing non ASCII text files - comp.lang.tcl... tcl script that aims to write text ... This must not be used on binary files. Usually binary files and text files ... sed: add newline if no eol? - comp.unix.solarissounds tricky in sed. is this an ascii file? binary? if it's ascii, a flex/lex program might be more straightforward. j. > >Thanks, >Phil > >$ uname -X >System = SunOS ... Matlab &Tecplot - comp.soft-sys.matlab... function to use to read tecplot files on Matlab. Those tecplot files are ASCII files ... Matlab import and export text binary text binary ... % load the *.plt is too ... Socket Programming using C++ in Matlab - comp.soft-sys.matlab ...Sending ASCII EOT signal ... I suspect that lsof may get you at least a decent ... Problem sending binary file via socket. - comp.unix.programmer ... How to send binary or ... ftp put file on windows using IDL - comp.lang.idl-pvwave ....PRN files vs. .CSV, .TXT, .XLS - comp.soft-sys ... bit windows ... to retreive data from binary file ... know if IDL 8.0 supports netCDF 4.0 file ... ... netcdf data to ascii in ... fread and float - comp.soft-sys.matlabDear all, I have a binary file where each record is 53 byte long. Starting from byte ... Conversion: double IEEE 754 => decimal ASCII-String - comp.lang ... fread and float ... binary format of 32-bit integer under Tcl 8.3 - comp.lang.tcl ...Answers Convert the 16-bit hexadecimal number 0x93EF to a binary bit pattern. ... Writing non ASCII text files - comp.lang.tcl Under Tcl, there is no 'b' suffix (at least it ... [comp.publish.cdrom] CD-Recordable FAQ, Part 1/4 - comp.publish ...Archive-name: cdrom/cd-recordable/part1 Posting-Frequency: monthly Last-modified: 2008/10/09 Version: 2.71 Send corrections and updates to And... AT&T to Intel Syntax Translation - comp.lang.asm.x86... way could be to assemble the source using GAS to an object file, then link this to a binary with ... GAS: ..intel_syntax noprefix ..data # section declaration msg: .ascii ... Ascii vs. Binary Files - Department of Computer ScienceIntroduction Most people classify files in two categories: binary files and ASCII (text) files. You've actually worked with both. Any program you write (C/C++/Perl ... Ascii vs Binary transfers - Free FTP client, secure file transfer ...Ascii vs Binary transfers . There are two common modes for transferring files via FTP, ascii and binary. Ascii mode transfers files as 'text'. Examples of ascii files ... 7/10/2012 12:26:42 AM
|