Live data from Hacker News

Ask HN: Code examples to find out if a person is addicted to “overengineering”

news.ycombinator.com

1–10 of 52 posts

Ask HN: Code examples to find out if a person is addicted to “overengineering”

#1
I know one person who creates as complex solutions as possible to any kind of programming problems. And it has bad impact on business and projects. So, I want to know if someone knows any kind of questions or tests or code examples which I can show to that person and see what decisions he will take.

Re: Ask HN: Code examples to find out if a person is addicted to “overengineering”

#2
If it's NodeJS the fastest way is to check how many dependencies they have in total, bad developers will find a way to include 100s or 1000s of dependencies, anonymous third-party blobs of code running within their application:

    $ npm install
Another indicator is how elaborate their build process to munge w/e they wrote into w/e a machine understands.

Re: Ask HN: Code examples to find out if a person is addicted to “overengineering”

#3
https://news.ycombinator.com/item?id=14397089

Here's a comment of mine, from a month ago, pertaining to interview coding exercises. My example accomplishes the goal you've described, however I'm not sure it's an exact fit for your situation, given the context you've provided. Perhaps some more information about your particular case would help identify good solutions.

Re: Ask HN: Code examples to find out if a person is addicted to “overengineering”

#4
Have them build "A framework for X", where X is some commonly-done problem most programmers in their field have worked on (webapps, CMSes, forums, build systems, big data, etc.), ideally related to your business. If you want to do this in an interview or take-home setup, you will likely need to use a cut-down version of this problem, although really, much of the point of it is to see just how much the problem expands.

An engineer who doesn't overengineer will first ask a lot of questions about why you need X, and then will build X, and then only after you have tweaked the problem requirements will generalize that into a framework. They are likely to think this is a bad interview question, which it is, and push back to get the actual concrete requirements. That's exactly what you want; overengineering happens when people guess at the requirements instead of making sure of them.

An engineer with a propensity toward overengineering will love this question, and immediately jump into all the features their framework will support. They'll carefully get lost in thought brainstorming new features that might be cool, but when it comes time to implementing it, they'll either completely fail to reconcile all the contradictions that have crept into the design, or they will come up with a very complicated mess that does everything but trades off unspoken requirements (like performance or simplicity) for them.

This mirrors how frameworks actually work in the real world: basically every framework that people actually use was extracted out of a working app that solved one problem well, while every framework designed from scratch is an overengineered mess.

Re: Ask HN: Code examples to find out if a person is addicted to “overengineering”

#7
Ask them how they would, on a Unix system, do some task that's trivially done via a standard POSIX shell command.

E.g. "how would you count the number of lines in a file?", "given a regex, please print lines in a file matching the regex", "given N lines, sort them by numeric value" etc.

The most egregious over-engineering I see is someone writing a 100 line Python script for something that could be at most a 100 character shell one-liner with a couple of pipes between different programs.

If they pass that ask them about a problem that would be trivially solved by resisting the urge to reinvent make, a HTTP server, or an SMTP server.

Edit: Re downthread: Yes obviously only in the context of someone expected to know *nix in the case of those examples. But the general approach is very transferable.

Ask the candidate about some trivial problem solvable in 1 minute with standard tooling they use every day, you'd be amazed at the architecture astronauts that come out of the woodworks keen to waste their time on some needlessly over-engineered solution.

Re: Ask HN: Code examples to find out if a person is addicted to “overengineering”

#8
When a candidate solves a programming problem, they typically don't do it with a minimum of abstraction or complication, because employers aren't interested in that. Instead, they'll try and pick something that they want to communicate through the medium of the exercise.

If they choose unit testing, the solution might be over-engineered to be testable at a much finer level than would be necessary in production code, and have more abstractions than usual.

Or the candidate might be trying to communicate some kind of design aesthetic, whether it's familiarity with functional programming, object orientation, design patterns, or some framework du jour that requires a lot of boilerplate. All these will smell a lot like over-engineering on typical toy problems seen in programming problems.

IMO it's very easy to get a mismatch in expectations and presentation in the solution to a programming problem, such that the company and the candidate aren't communicating on the same wavelength. Unambiguous, very simple problems with binary solutions may be better as a basic filter (e.g. Codility or something like it), followed up with pair programming in something more similar to a working environment, where pair communication and direction can get people on the same page.

Re: Ask HN: Code examples to find out if a person is addicted to “overengineering”

#9
I think with overengineerers you have to look at the actual problem they are trying to solve and compare it to the potential problems they are trying to solve.

I often do "cool" stuff only to realize that it was way too complex for the problem. But I make a point to trim it down later.

I would add a step towards the end of the project that focuses on deleting unused stuff and simplifying as much as possible. As always there is no hard type and you often can't predict at the start if something is a good idea or not.

On the flip side people that immediately cry "YAGNI" and never try anything can be a drag too.

Re: Ask HN: Code examples to find out if a person is addicted to “overengineering”

#10
post #7

Ask them how they would, on a Unix system, do some task that's trivially done via a standard POSIX shell command. E.g. "how would you count the number of lines in a file?", "given a regex, please print lines in a file matching the regex", "given N lines, sort them by numeric value" etc. The most egregious over-engineering I see is someone writing a 100 line Python script for something that could be at most a 100 char…

That's hard to do without some context. They may assume, since they are there for a development interview, that the interviewer wants to see code.
Post reply on HN