3 ms·
He was interviewing for a tech-writer position. I'm somewhat amazed that he could answer it even to the extent he did. Most tech writers I've worked with do n
by brk 18y ago
He was interviewing for a tech-writer position.
I'm somewhat amazed that he could answer it even to the extent he did. Most tech writers I've worked with do not have the (apparent) level of technical knowledge this guy has.
- Retric 18y agoHe prattled on at lenght when he had little real understanding of the toppic at hand. He ignored cleaning up the data and assumed you needed a complex hash for words when you could just the digtits of the word for the same thing. (((A * 27) + B) * 27)+C) then a datastructure for count and the next Hash table if needed. Use this recursivly and you can handel just about any word and get there with (Length/3) looks at main memory. And you can still alocate all that memory in a few large chunks so that's still fast. Then optomize for speed or memory as need. (If you don't mind sacrificing space you use 32bits per letter and then bit shift etc.)
- biohacker42 18y agoYeah that's what struck me about this, who drills tech writers on hash algorithm? There's tough interview questions, and there's stuff that's hardly relevant. The grand parent is right, this is a horrible programming solution but the author is not a programmer!
- deleted 18y ago[deleted]
- dagobart 18y agobecause of that a shortcut answer would have been to delegate the issue to the CS department as sorting words is not a task for a tech writer. Nice that he identified the question as being off-topic. Poor that he didn't dismiss it because of that.