News for hackers. Stuff that matters.
Re:Things I Learned from a Job Hunt for a Senior Engineering... by eanzenberg on Tuesday April 24, 2018 @12:49PM (#16914275)
How often do you need to write palindrome functions for your job?

Checking substring in a string is a 1 liner in languages like python.

I was at a final interview with FAANG. One question asked was to load a csv. I used pandas, it's a 1 liner. You could see the wretched face of the interviewer since he was expecting a

with open() as f: do_some_shit

and kept pushing me to write this on the board. I looked at him and said "Why? Why write your own method in a vanilla language? Give me a good reason."

Re:Things I Learned from a Job Hunt for a Senior Engineering... by cortesoft on Tuesday April 24, 2018 @01:10PM (#16914494)
So what is the interviewer supposed to do to find out if you can code? They want to give you a simple, straightforward task to see how you code. Of course, every simple, straightforward task is going to have an existing tool to do the job, but they aren't looking for a solution to parsing CSV, they are looking to see you code.

They can't ask you a complicated problem, because they don't have the time (nor do you) to solve a real problem that requires coding.

You are totally missing the point of what they are trying to ask you if you insist on using pandas for parsing CSV. Understanding the point of what you are being asked to do is critical to being a professional software developer.

Re:Things I Learned from a Job Hunt for a Senior Engineering... by eanzenberg on Tuesday April 24, 2018 @01:57PM (#16914922)
I think that is the point. If your business relies on importing csvs that cannot be imported with pandas then explain that, explain the edge cases where pandas has failed, and I will understand. If your business relies on having the best fucking palindrome product then that becomes super relevant.

They can definitely ask a complicated problem. On-sites are 4 hours long these days.

Re:Things I Learned from a Job Hunt for a Senior Engineering... by softawre on Tuesday April 24, 2018 @02:36PM (#16915344)
You sound like somebody who would derail all of the technical discussions and pat himself on the back for it because he was "technically correct" while still missing the point altogether.
Re:Things I Learned from a Job Hunt for a Senior Engineering... by tkxxx7 on Tuesday April 24, 2018 @03:02PM (#16915580)
I hear the opposite. They are stressing a technical opinion here, but for the sake of rationality and efficiency. These are usually not the same people that are overly concerned with "correctness" when communicating with others.
Re:Things I Learned from a Job Hunt for a Senior Engineering... by cortesoft on Tuesday April 24, 2018 @03:28PM (#16915762)
But it is only 'rational and efficient' if you are being obtuse... they aren't asking you to code a CSV parser because they actually need a CSV parser, they are asking because they want to see you code. The 'rational' thing to do is satisfy THAT requirement, which is the real one, not try to bypass the purpose by insisting on using a CSV library.

The ability to understand the underlying need behind a request is important to being a good employee. If a candidate fails completely to understand the purpose of a question during an interview, and in fact continues to argue against you as you explain it, they aren't a good candidate at all.

Re:Things I Learned from a Job Hunt for a Senior Engineering... by tkxxx7 on Tuesday April 24, 2018 @03:39PM (#16915870)
> The ability to understand the underlying need behind a request is important to being a good employee. If a candidate fails completely to understand the purpose of a question during an interview, and in fact continues to argue against you as you explain it, they aren't a good candidate at all.

I agree with everything you've said, but that still makes it a bad and equally obtuse question. If they don't actually need a CSV parser, they don't need to know that you can parse CSVs, either (if you can - which is the other point - you might be a pretty good programmer if you can quickly parse a CSV, but there are tons of excellent programmers who can't).

Re:Things I Learned from a Job Hunt for a Senior Engineering... by cableshaft on Tuesday April 24, 2018 @06:31PM (#16917229)
I recently couldn't use a built-in CSV parser and had to roll my own because one of our clients couldn't be arsed to send us consistently formatted CSV files so we had to include a bunch of edge cases in there to still correctly format the damn things. (sometimes pipe-delimited, other times comma delimited, sometimes fields surrounded by quotes, other times no quotes except one column (that has a LASTNAME, FIRSTNAME" in it), yet still other times has quotes in the data itself, fields usually have no commas, but sometimes this one field will have it in the middle of it, typos in header names, not including the end of file checksum that others include, etc). The built-in CSV reader you had to specify if the fields had surrounding quotes or not for the entire document, it didn't detect it on its own, for example.

And that was when I found out parsing something that should be as stupid simple as CSV file can actually be pretty complicated.

Re:Things I Learned from a Job Hunt for a Senior Engineering... by cortesoft on Wednesday April 25, 2018 @12:27PM (#16923152)
The ability to figure out actual requirements from poorly phrased requirements is also a very valuable skill to have as a software developer.
Re:Things I Learned from a Job Hunt for a Senior Engineering... by eanzenberg on Tuesday April 24, 2018 @04:18PM (#16916159)
I'll argue that a one-liner IS code. That's what I put into production systems.

I understood the "purpose" of the question and I self-selected myself out of a role I would've been bored, micromanaged at, and probably not challenged at.

Re:Things I Learned from a Job Hunt for a Senior Engineering... by cortesoft on Tuesday April 24, 2018 @03:24PM (#16915737)
The question on the interview isn't about the business, it is about showing your ability to design an algorithm. I is an exercise, not a purpose driven task.
Re:Things I Learned from a Job Hunt for a Senior Engineering... by gaius on Tuesday April 24, 2018 @01:45PM (#16914781)
So what is the interviewer supposed to do to find out if you can code?

I’ll take someone who gives an idiomatic answer over someone who reinvents the wheel anyday. Who is likely to be more productive on the job?

Re:Things I Learned from a Job Hunt for a Senior Engineering... by xyzzyz on Tuesday April 24, 2018 @01:56PM (#16914897)
Depends if the job can be done using one-liners from existing libraries.
Re:Things I Learned from a Job Hunt for a Senior Engineering... by kd5bjo on Tuesday April 24, 2018 @02:06PM (#16915012)
That depends on whether or not the job entails inventing new kinds of wheel.
Re:Things I Learned from a Job Hunt for a Senior Engineering... by gaius on Tuesday April 24, 2018 @03:40PM (#16915884)
Let's be honest: most commercial programming jobs don't. And the person with a thorough working knowledge of the standard libraries is in a better position to do it anyway.
Re:Things I Learned from a Job Hunt for a Senior Engineering... by rhizome on Tuesday April 24, 2018 @02:23PM (#16915193)
They want to give you a simple, straightforward task to see how you code.

Overgeneralized at best, LOLworthy at worst. Does this include palindrome questions for Ruby that require the use of linked lists? Because I had that from a CTO of a couple-hundred person company not two months ago.

Re:Things I Learned from a Job Hunt for a Senior Engineering... by cortesoft on Tuesday April 24, 2018 @03:30PM (#16915799)
What would make a good programming challenge for an in person interview?
Re:Things I Learned from a Job Hunt for a Senior Engineering... by calcifer on Tuesday April 24, 2018 @12:55PM (#16914343)
> How often do you need to write palindrome functions for your job?

That's like answering "how often do you need math?" to the question "what is 2+3?". It is an utterly, completely, stunningly trivial question that even a CS101 student on their first semester should be able to answer.

> used pandas, it's a 1 liner. You could see the wretched face of the interviewer since he was expecting a with open() as f: do_some_shit

I would be perfectly fine with the pandas answer, but my point is "csv parsing" wouldn't be my first question, I'd start with something much easier and if you managed that, I'd gladly accept pandas as a valid and then asked you to elaborate further (what does this pandas function do, how would you implement it yourself etc).

Re:Things I Learned from a Job Hunt for a Senior Engineering... by monksy on Tuesday April 24, 2018 @02:18PM (#16915133)
> (what does this pandas function do, how would you implement it yourself etc).

What are the downsides to using pandas? Is that worth brining in that large of a library for a matter like that.

Re:Things I Learned from a Job Hunt for a Senior Engineering... by eanzenberg on Tuesday April 24, 2018 @04:22PM (#16916180)
I don't consider palindromes equivalent to math. Unless you mean how to index lists? That would be a valid question since there's different ways in python.
Re:Things I Learned from a Job Hunt for a Senior Engineering... by always_good on Tuesday April 24, 2018 @02:00PM (#16914942)
Your refusal exposed you as someone with a hubris that's hard to work with. Who doubles down and refuses to budge.

That you couldn't yield on such a trivial, manufactured matter would make me wonder how you respond in a team environment on real matters in the face of adversity.

Re:Things I Learned from a Job Hunt for a Senior Engineering... by thomascgalvin on Tuesday April 24, 2018 @03:33PM (#16915823)
CSV is really fucking hard to parse. There's tons of edge cases. "I'd just use a well-known, well-tested library" is a very valid answer.

One of my go-to questions is "sort this array", and if the candidate types `Arrays.sort(input)` they get bonus points, because it shows they have useful knowledge of the language they'll be writing in.

Re:Things I Learned from a Job Hunt for a Senior Engineering... by always_good on Tuesday April 24, 2018 @07:41PM (#16917643)
Here's how their scenario would actually play out:

    > I took my sunglasses off, looked him dead in the eye,
    > and said "Why? Why write your own method in
    > a vanilla language? Give me a good reason."
Interviewer: "To see how you might approach it."

It's a synthetic interview question. Why does it suddenly need to be a production-ready CSV parser?

We don't have enough information to say whether these are bad interview questions, and it's really not the point.

Maybe the interviewer just wanted to see if you'd use good fd hygiene (`with open('file.txt') as f:`) and that you can stub out some toy parser code and speak of it intelligently. And that you wouldn't throw a fit when asked to write some code that a library like `npm install fizzbuzz` can already solve.

Re:Things I Learned from a Job Hunt for a Senior Engineering... by ascorbic on Thursday April 26, 2018 @02:13AM (#16929232)
That's a bit unfair. I agree that Array.sort is the best answer, but array sorting is such a classic interview puzzle that most candidates will expect that that's what you want. So instead of the bonus answer, they'll slog away trying to remember the algorithms that they learnt at uni years ago (or codecademy last month).
Re:Things I Learned from a Job Hunt for a Senior Engineering... by eanzenberg on Tuesday April 24, 2018 @02:17PM (#16915125)
When I see someone doing something wrong or poorly I speak up and I speak out. Loading csv using vanilla python is in that boat. Present a good reason why it should be done in vanilla. Otherwise, I won't maintain your code as-is and will refactor it.
Re:Things I Learned from a Job Hunt for a Senior Engineering... by always_good on Tuesday April 24, 2018 @02:32PM (#16915285)
Sounds like their interview worked and they dodged a bullet.
Re:Things I Learned from a Job Hunt for a Senior Engineering... by eanzenberg on Tuesday April 24, 2018 @03:05PM (#16915601)
Worked both ways, I dodged a bullet and am happier in my current position than can be :).
Re:Things I Learned from a Job Hunt for a Senior Engineering... by saltcured on Tuesday April 24, 2018 @03:07PM (#16915618)
At least you were given a programming problem. I would have played along a little bit and at least discussed how the layers work. Instead of pandas, use the csv module so he could see a loop iterating over header and data rows as tuples. If he pushed further, outline how you might code the csv reader yourself if it didn't exist. Move the discussion into the difficulties of correctly handling a file format like csv and real-world issues like malformed inputs, validation, and error-handling.

In my case about a decade ago, I became obstinate when given one of those silly math-trivia-puzzle problems like how many ping pong balls will fill an elevator or how long is a string. This was for a relatively senior track FAANG interview, where my background at the time was in HPC, distributed systems, and provisioning systems that were precursors to today's IaaS bread and butter. In my case, the interviewer was adamant that I derive some figures that depended on basic geometry and knowing the diameter of the earth and ratios of landmass to ocean surface. But, he wanted me to first SWAG these figures, after I told him I wasn't a geospatial geek and didn't memorize such facts.

I decided to be difficult. If I were somehow faced with such a task, I would first consult reference materials and even see if I could find the actual answer he wanted, since it sounded only one step removed from what you could find in the CIA World Fact Book or similar. Only if that failed, would I dig up source facts and try to derive an answer. I would focus on getting the answer, not on entertaining myself with a Martin Gardner puzzle at my employer's expense and risk. I would never have to make seat of the pants estimates and act on them rather than doing due diligence. I'd either have done homework, or if there was really no time (like some system availability crisis, if we pretend I was an ops person), I'd choose a pre-planned contingency action to make time.

They didn't go forward with an offer, and I felt a bit of relief at that.

Re:Things I Learned from a Job Hunt for a Senior Engineering... by hpcjoe on Tuesday April 24, 2018 @03:33PM (#16915821)
I got this CSV question at some nameless large company in the bay area.

I asked "Do you want me to do the simple thing, and use a library, or write code to do this?"

They preferred the latter. So I did.

As happy as it might make you to be snarky for the often silly questions you are asked, people are, if they are smart about it, looking to see your thought processes.

I recently got a question that I didn't know how to answer, so I started thinking through it aloud. I think they liked it, because they engaged with me during the process. Redirected my thought processes.

Again, good companies will do that. Look for every question, no matter how silly, as a way to show how you deal with situations, even ones you may not like. These are the moments for you to shine.

And after you get home, tell your SO/friends/etc. how wacky they are.

Re:Things I Learned from a Job Hunt for a Senior Engineering... by Bahamut on Tuesday April 24, 2018 @01:33PM (#16914685)
That seems like a fairly arrogant response on your part - it's obvious that an interview is meant to gauge your technical capabilities/knowledge. Even if something is trivialized, the ability to solve certain types of problems can translate to other problem domains where you have to use the same core skills to solve other problems - parsing a file does not seem like an other worldly type of skill (it could even be an unstructured/loosely structured text file for example).

I think to some degree, a suspension of disbelief is reasonable for an interview, and it's not worthwhile to get tunnel vision on a particular problem asked. It's ok to point out that something is trivial with a particular widely used library or whatever, but if it is asked to implement something via first principles or whatever, it is a perfectly reasonable expectation to just do it for interview purposes as a simple mental exercise.

Re:Things I Learned from a Job Hunt for a Senior Engineering... by eanzenberg on Tuesday April 24, 2018 @02:05PM (#16914997)
I respect your view but disagree. I use pandas everyday for my job. I use spark. I use keras. I use scikit. I use all these APIs everyday for my job. I can't think of the last time I loaded a file using vanilla python. If it's a requirement for the job (which it wasn't, they showed me pandas code later) then I completely understand and would not be qualified nor would I want the job.

There's a few things going on here. First, there's a frustration from the interviewer who is obviously looking for the cookie-cutter answer to move things along. Second, there's a culture misalignment because they are looking for cookie cutters to do the job while I am not that. Third, they, along with OP, are obviously not a palindrome company nor a load-everything-to-lists company yet this is what they're testing. So again, culture misalignment.

At the end of the day, you are right, I self-selected myself out because I would not be happy at a place like such who are looking for cookie-cutter employees.

Re:Things I Learned from a Job Hunt for a Senior Engineering... by GuB-42 on Tuesday April 24, 2018 @03:07PM (#16915613)
Why write your own method? Because it is sometimes better to write 10 lines of your own code rather than pull an entire library for some trivial task.

Creating a dependency to a library is not benign. Even if the library is easily available and mature doesn't mean that everyone has it, or that it will never change. Remember how "leftpad" broke npm?

Having that smug attitude towards the recruiter, assuming he is an experienced developers himself, should rise a red flag. Yes, sometimes projects have constraints (like "no pandas") that may seem stupid, and sometimes they are. But it is first important to understand the context.

So instead of asking "give me a good reason?" to the recruiter, give the reasons yourself. Invent a scenario where you actually need to rewrite that csv parser, bonus points if it is related to the company's business, and finally, write the damn code the recruiter wants you to write.

Re:Things I Learned from a Job Hunt for a Senior Engineering... by eanzenberg on Tuesday April 24, 2018 @04:23PM (#16916188)
I don't agree with this reasoning. Perhaps the details are important. The task required loading, filtering, and aggregating a csv. Sure, if all do is "load" a csv perhaps you don't need to import a huge library. But if you want to do anything with that data I'm sure the library becomes very useful :)
Re:Things I Learned from a Job Hunt for a Senior Engineering... by jameshart on Tuesday April 24, 2018 @10:28PM (#16918250)
Ah. Did I not mention that these CSV files I wanted you to parse... they're generated by an old mainframe system we can't modify the sourcecode to. It does have a few idiosyncracies - for fields like addresses which can contain commas, it uses a special escape sequence where the field just consists of three asterisks, then the value for that field is the content of the next line. Oh, and it uses just CR characters for linebreaks. In EBCDIC.

Can your pandas library handle that?

Re:Things I Learned from a Job Hunt for a Senior Engineering... by walshemj on Wednesday April 25, 2018 @06:50PM (#16927091)
So presumably the mainframe has code that can parse these non standard files? Just take that code and build "on the mainframe" a tool that converts their non standard csv to something more usable.
Re:Things I Learned from a Job Hunt for a Senior Engineering... by jameshart on Friday April 27, 2018 @09:23AM (#16940580)
Great. Can you show me on the whiteboard what the code for that tool might look like?
Re:Things I Learned from a Job Hunt for a Senior Engineering... by bradknowles on Wednesday April 25, 2018 @04:15AM (#16919491)
Okay, so the interviewer says: “And what if you can’t use pandas? What then?”

Your response is to flip the table and leave? If so, then good riddance.

Re:Things I Learned from a Job Hunt for a Senior Engineering... by walshemj on Tuesday April 24, 2018 @01:24PM (#16914615)
Testify !