Live data from Hacker News

How to win the coding interview

blog.devmastery.com

301–305 of 305 posts

Re: How to win the coding interview

#301

Earlier quoted context omitted.

Nothing more complicated than this: is_a_palindrome(S) { assert is_a_string(S) if reverse(S) == S return true return false } A string is a palindrome if it's equal to itself reversed. The example "solution" in the article is dreadfully overengineered to death and back. Noone interviewing should be happy to see such a solution and noone being interviewed should expect to be required to give such a solution, to such a…

That solution would fail to catch several of the examples that were requested to be caught. Sometimes something that appears overengineered is built that way to meet the actual requirements a problem presents.

>> Sometimes something that appears overengineered is built that way to meet the actual requirements a problem presents.

That's poppycock. Here are the requirments:

>> Write the most efficient function you can that determines whether a given string is a palindrome.

A palindrome is a string that is equal to itself reversed. That's like, the mathematical definition of a palindrome (simplified, of course). What I gave you catches exactly that. If some of the test cases in the proposed solution don't agree with the commonly accepted definition that's a problem of the proposed solution, not mine.

Also, in terms of the "most efficient" solution, the guy's proposed solution is far from that- because he tries to be smart and reverse the string while he compares it, thinking that's faster than going the whole hog. But that's only going to save you some cycles a tiny amount of the time, because the vast majority of strings you can expect to encounter are unlikely to be palindromes. Reversing and comparing the string to itself is the neatest, quickest, most legible and prettiest thing you can do in this case, regardless of your use case or anything else.

And if you're a recruiter that expects anything else, that's because you have no idea what you're looking for, not because you are as smart as you think you are.

Re: How to win the coding interview

#302

Earlier quoted context omitted.

A mindless keyboard stomper is trying to say something about a "reality". Funny. Go, solve your "2+2" problems. Hope you have a high enough character-per-second typing rate for this.

Let it go, you're wrong. It's obvious that you know you're wrong, otherwise you would argue your position rather than throwing personal insults and a hissy fit. Pseudocode is not code. Flowcharts are not pseudocode. You also didn't describe your stack. I just see some fresh meat who desperately wants people to take him seriously, but he has a hard time with it because he's kinda childish, very defensive, and can't ar…

> Pseudocode is not code. Flowcharts are not pseudocode.

Pseudocode is code, no matter what uneducated pitiful code monkeys would say about it. Take any textbook on algorithms, and they would be most likely written in pseudocode.

Also, in your shameful incompetence you apparently ignored (more than once) my reference to DSLs, which are very closely related to the notion of pseudocode. But, since you know nothing about programming even this was cryptic for you.

> You also didn't describe your stack.

I already told you that I'm not going to even answer a question worded in such a disgusting hipstor argot. I told you everything that is relevant. This idiotic "stack" of yours does not matter. I worked for some blue chips, used a very wide variety of technologies, for domains ranging from hardware design and verification to CADs, database engines and compilers, and everyone I worked with did more or less the same - used either a whiteboard or paper most of the time, with very little time on actual coding / designing / soldering / prototyping / whatever.

Re: How to win the coding interview

#303

Earlier quoted context omitted.

That solution would fail to catch several of the examples that were requested to be caught. Sometimes something that appears overengineered is built that way to meet the actual requirements a problem presents.

>> Sometimes something that appears overengineered is built that way to meet the actual requirements a problem presents. That's poppycock. Here are the requirments: >> Write the most efficient function you can that determines whether a given string is a palindrome. A palindrome is a string that is equal to itself reversed. That's like, the mathematical definition of a palindrome (simplified, of course). What I gave y…

You omitted the bit just above your quote, which says:

>> A palindrome is a word, phrase, number, or other sequence of characters which reads the same backward or forward. Allowances may be made for adjustments to capital letters, punctuation, and word dividers. Examples in English include “A man, a plan, a canal, Panama!”, “Amor, Roma”, “race car”, “stack cats”, “step on no pets”, “taco cat”, “put it up”, “Was it a car or a cat I saw?” and “No ‘x’ in Nixon”.

Given the last sentence, doesn't that change the meaning of your sentence to directly refute your interpretation?

Re: How to win the coding interview

#304

Earlier quoted context omitted.

>Except now I have to jump through hoops with HR (let's just assume they'd be OK with this, which they almost certainly won't), get the contract in place, work with IT to get your environment set up, and bring you up to speed (so really I may get one full day of actual work)... just to realize that I don't want to hire you. There are two major reveals in that sentence. One, HR rules your hiring practice and therefore…

>Both are red flags No they're not; they describe 98% (made up number) of the industry, and I don't think that "soul-suckingly bureaucracy" is an inevitable outcome of implementing reasonable processes. We have IP that we have to protect. We have a company to protect (hence the HR involvement). Sure, you may be lucky enough to wing it in your little five man operation and get by, but you had better hope you don't run…

You are close minded. Instead of insulting people who dare to criticize your silly interview, maybe you should listen to them. Another red flag. You seem to think you are in a buyer's market. What does your company offer that is so compelling someone would put up with that silliness? Let me guess, market rates. I hope you at least inform applicants that you expect them to code on a whiteboard so you aren't wasting their time.
Post reply on HN