Live data from Hacker News

How to win the coding interview

blog.devmastery.com

251–260 of 305 posts

Re: How to win the coding interview

#251

>> On this particular challenge, I am expecting many will use RegEx as a part of the solution. The regex needed for this is some of the most basic regex out there Woohooa, cowboy. The language of palindromes is a classic example of a context free language that is not possible to describe with a regular grammar, such as accepted by a regular automaton... in other words a regex. In Recruiter-Parseable English (RPE): yo…

He's not expecting the use of a regex to do the whole heavy lifting of checking for a palindrome, in the example he uses it for the replace functionality to remove non-alphanumeric characters. https://gist.github.com/anonymous/e8553707cd6162040e7d12b2a1... stringToTest = stringToTest.toLowerCase().replace(/[^a-z0–9]/ig, '');

Yep, should have read all the way through before posting.

But the example solution is so bad anyway.

Re: How to win the coding interview

#252

Earlier quoted context omitted.

Meaning a lot of places have shitty processes and architecture and try to compensate by hiring people that fit their broken system. Case in point: having an architecture so fragile that a bad push is capable of taking down all your servers.

Trivial to have a breaking DB change or a software push where the only part of the app that works is the little part that tells the load balancer, "yep, I'm alive and healthy; send some traffic my way". There are probably way more successful (100-million to couple billion dollar revenue) companies that can be brought offline with a bad push than can't.

Or a load balancer push that ignores the 'yep, I'm alive and healthy' bit and sends traffic anyways.

Re: How to win the coding interview

#253
post #36

I'm tired of companies asking me to code at their interviews. I have 10 years experience with references. I have code that I've built, deployed to production still running today. I have cultivated my own clients, gathered requirements and built something that delivers business value. Instead of a coding interview, I'll make a counter offer. Why not hire me on a 1 week contract to come and do some real world work. Wor…

This reminds me of "smart and gets things done". Your idea is to test whether people can get things done. An interview can test how smart they are. Both are important.

I've seen web developers with years of experience delivering successful projects who turned out to be terrible programmers. In this situation, it is nearly always because they're not smart enough or because they have an anti-intellectual outlook on life ("I found this on stack overflow, it works, I don't understand it in depth but it's good enough for me" or "why would I know that, I never needed it") or often both. They were ok churning out 4 month projects one after the other or maintaining some business web site for years, but when you have them working on difficult and complex problems, their abilities turn out to be lacking and the brilliant kid with much less experience turns out to be much more useful.

Re: How to win the coding interview

#254

> I guarantee you this, there will come a time when we are banging our heads against a problem and there is a deadline looming and we’re tired and people are pissed at us and money and jobs and reputations are all on the line. When that time comes, we’re going to have to get into a boardroom, hop on a whiteboard, and figure things out. Fast. False, that has never happened in decades of work in my experience. All "bre…

Exactly. High level architecture as well. I don't sit down and come up with one there and then. I get a rough idea of the problem early and think about it for a few days (while I am doing other things). Piece by piece I see what will work well and what won't.

Re: How to win the coding interview

#255

Why regexes combined with the pre-processing? First, it's not so clear in what sense "efficient" is actually a real requirement if this is a model answer. If the average input is very small then the cost of compiling/interpreting the regex is going to dominate any modest run-time improvement over even an extremely naive implementation. And if the inputs are very large then the probability of contradiction in the firs…

> And if the inputs are very large then the probability of contradiction in the first few characters even is extremely high, so all the upfront normalization is a huge waste.

You're hired! :D

Re: How to win the coding interview

#256

Earlier quoted context omitted.

Flowcharts are code. Pseudocode is a code.

No they aren't. They are a diagram of a process. Code is the instructions used to implement that process. You shouldn't be so smug either.

Yes they are. A formal language is a code. Any formal language. What is the difference between code and pseudocode in your opinion?

And given that on a whiteboard interview you're writing a pseudocode, it is not any different from a typical day at work where you also write pseudocode on a whiteboard, blackboard, sheet of paper or whatever. And if this is not your typical day at work, you're doing it wrong.

Re: How to win the coding interview

#257

Earlier quoted context omitted.

> The truth is that there are a lot of folks with 10+ years of experience who wouldn't even pass as junior devs at many places. Sure but this really has nothing to do with the parent's post. The parent said they have references and the experience and code in production. All of this is verifiable short of, say, DoD contract work. I doubt you have worked with folks with 10+ years of experience who wouldn't pass as juni…

>Sure but this really has nothing to do with the parent's post. The parent said they have references and the experience and code in production. All of this is verifiable short of, say, DoD contract work. It has everything to do with it. References are completely useless unless you happen to be lucky enough to know one of their references well. A random stranger saying "Bob knows X" is just as useless as Bob telling m…

References are all about verifiability otherwise it's just a random person saying something about another person; without context a reference is useless. You need to find a way to verify them which I'll admit is hard but without that they're completely useless.

Open source is usually the best indicator here as they can literally point you to code they worked on.

> Everyone has references, that is not something that is hard to acquire or meaningful in any way.

A literal reference without context isn't useful. That's why, in my original text I caveated it with verifiable code running in a production environment.

> Wordpress is running in production all over, I sure as hell wouldn't want to hire any of the people involved in it.

Ouch. It's not the greatest code but they made something, it worked and it's been scaled all over the place. Seems like they could have some solid people involved in it in my opinion.

Re: How to win the coding interview

#258
post #192

My problem is not the technical stuff -- I just can't seem to pass the 'culture fit' part of the interview outside of my industry (defense/aerospace). I've been trying to get out of the govt sector for 10 years now (going on interview binges every so often). I often pass the technical screening (usually screen-sharing or "homework") and make it to the final "onsite" interview stage but something about meeting me in p…

We share the same struggle :). I have been in multiple processes where all goes right until the onsite interview where everything blows. My gut feeling tells me is because i am a rather ugly guy and also somewhat of socially inept, so i should make a bad impression. Currently working in losing some weight and trying to improve my social skills.

Having interviewed a few people in the last year, my number one suggestion would be to show some enthusiasm for coding / tech / a particular language or framework that you have used. Tell the interviewer why you like it (or why you don't). Its really difficult to evaluate a candidate when they just give an answer to the question and no more.

Re: How to win the coding interview

#259
post #187
post #89

Solving that code test in a more effective manner? :) replace non alpha/spaces, lowercase it, then compare value.reverse() == value

Shorter yes, but reversing the whole string and comparing it with the input value is actually slower/less efficent than the algorithm shown in the article. Sorry for my nitpicking ;)

Clean, easy, maintainable. To me that is more valuable than an increase in performance. I would be very surprised to find a palindrome checker as the bottle nek in a system.

Re: How to win the coding interview

#260

Perhaps better named "How to win my coding interview." Author goes into the specifics he personally expects from an interview. Since he's not positing these as universal standards (and rightly not) I'm not sure if this is relevant to anybody other than the people who intend to interview at dev mastery.

If there is one thing that could possibly make tech recruiting even worse, it is this: "Did you review the study guide for our interviewing process?"

The problem is not that the job candidates are not sufficiently informed about the way specific employers conduct interviews. The problem is that employers have expectations regarding the tech jobs market that start at merely unrealistic and progress beyond a complete schizophrenic break with two extra hits of LSD.

We are not re-inventing the tech interview. We are, in the style of Thomas Edison searching for a better incandescent filament, discovering 10000 ways that are worse than the existing standard.

Post reply on HN