Re: How many bytes per Italian character?
- From: Joseph M. Newcomer <newcomer@xxxxxxxxxxxx>
- Date: Sat, 07 Apr 2007 13:32:45 -0400
I tend to despise these kinds of questions in an interview. Either they require an "aha!"
insight or they are insultingly trivial or they require obscure knowledge.
I was once interviewed, and the interviewer said "what's the fastest way to allocate
memory?" and I said "malloc or new". He said, "No, come on. What's the fastest way to
allocate memory?" "malloc or new". We went around this several times, until he said
"VirtualAlloc! It's VirtualAlloc!" At which point I told him that it was a kernel API,
while malloc and new were entirely in user space, and the quickfit algorithm used by the
allocator meant that the allocation was very fast. He insisted it was "VirtualAlloc". How
a kernel call can be faster than entirely-in-user-space code escapes me. I not only used
to write storage allocators for a living, but I wrote a book with a whole chapter on how
to write high-performance, low-fragmentation allocators. He may have been confusing
WIndows with Unix (in Unix, it is faster to call the kernel, because the linear search of
the stock C allocator used in Unix in the 1980s through at least the 1990s causes massive
page faults when doing allocation)
A friend was interviewed by a major employer (not MS) and failed the exam because he
couldn't answer the questions about Java security. What annoyed him was that he'd spent
the previous several years writing Java-based apps, both client-side and server-side.
Includling dealing with security issues. "But I hadn't done it in a year, and I won't
waste time memorizing obscure Java facts when I have online docs and can look it up any
time I need to".
But someone at MS told me that her standard interview question is "here is a list in
sorted order. Write the code to insert a new element in sorted order" and of 27
interviewees, 26 failed to do it, and the only one who got it right was a PhD candidate,
and she struggled to get it. I can do it with both LRU optimization for lookup and
sublinear insert performance for large lists without thinking too hard about it. The real
secrets to success are not knowing obscure APIs or how to reverse strings, but how to
solve real-world problems by integrating data structures, algorithms, and components.
Anyone with a bachelor's degree or equivalent in Computer Science who doesn't know basic
data structures should be looking for work in another profession.
One of the better interview questions I've heard was one used by MS. "You have 64 bits.
Tell me about them. You have 10 minutes. Go." I tried it, and timed myself. I ran out
of things to say at 7 minutes. Those are the creative questions that test your knowledge.
joe
On Sat, 7 Apr 2007 02:00:48 -0700, "Nobody" <Nobody@xxxxxxxxx> wrote:
Just venting.Joseph M. Newcomer [MVP]
Here is a story about somebody who writes compilers I highly admire.
http://www.bearcave.com/random_hacks/permute.html
or just type "Calculating Permutations" in your favorite browser.
It should be the first link.
I was really happy when I stumbled across the web page, because I had a
similar incident.
I never applied to write a compiler. I just got the same type of question
from Microsoft.
The question was how to reverse a string using only 1 free character.
Change
Hello my name is nobody
Into
nobody is name my Hello
I didn't know how to answer that on my feet either. It was a phone
interview.
I then asked the interviewer a question he could not answer, so I told him
the answer.
He then told me the answer to his question.
If you want to, you can figure it out for yourself, or you can scroll down
to see the answer.
First, reverse the string.
ydobon si eman ym olleH
Now, reverse each word.
nobody is name my Hello
I don't know.
Maybe I am the only one who doesn't know how to do that off the top of my
head?
I have never seen that question arise in this newsgroup.
I am waiting....
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
.
- Follow-Ups:
- Re: How many bytes per Italian character?
- From: Daniel James
- Re: How many bytes per Italian character?
- From: Mihai N.
- Re: How many bytes per Italian character?
- From: David Ching
- Re: How many bytes per Italian character?
- From: MrAsm
- Re: How many bytes per Italian character?
- From: Nobody
- Re: How many bytes per Italian character?
- From: Alexander Grigoriev
- Re: How many bytes per Italian character?
- References:
- Re: How many bytes per Italian character?
- From: Joseph M . Newcomer
- Re: How many bytes per Italian character?
- From: MrAsm
- Re: How many bytes per Italian character?
- From: Joseph M . Newcomer
- Re: How many bytes per Italian character?
- From: Alexander Grigoriev
- Re: How many bytes per Italian character?
- From: Joseph M . Newcomer
- Re: How many bytes per Italian character?
- From: Nobody
- Re: How many bytes per Italian character?
- Prev by Date: Re: Access Violation using CCriticalSection in DLL
- Next by Date: Re: Vista WH_JOURNALPLAYBACK
- Previous by thread: Re: How many bytes per Italian character?
- Next by thread: Re: How many bytes per Italian character?
- Index(es):
Relevant Pages
|