

Ask HN:  Is this a bad interview question for an intern? - ilitirit

&gt; There&#x27;s a 50MB log file.  Each line starts with ERROR, INFO, WARN or DEBUG, indicating what type of message was being logged.  How would you figure out how many errors occurred?  The technology you use is not important.  We&#x27;re just interested in the technique you would use.<p>(This is a simplified version of the kind of stuff we deal with on a daily basis)<p>Only one out of 4 managed to answer the problem in a satisfactory way (&quot;count how many lines begin with the word ERROR&quot;).  The others seemed to be completely thrown by the fact that it was a 50MB log file.  Is this just a bad question?
======
Inception
I think it is an acceptable question. The size of the file is irrelevant and
in my opinion a logical thinker should be able to decipher what is useful and
irrelevant information in a given scenario.

------
arkestra
Perhaps people think the obvious answer is to count the lines, but because you
throw the size of the file in, that this is somehow not feasible - and then
they are trying to second-guess what you mean instead?

------
drKarl
I guess that most of your candidates aren't familiar with GNU tools.
Otherwise, they would trivially know to grep and wc -l.

~~~
zimpenfish
Presumably they'd also know the -c flag to grep?

