|
Scaevolus posted:Fizzshedding: dozens of replies arguing about implementations of a trivial interview question. Reminder that if you do not produce the 100% most optimal solution to any problem in 30 minutes on a whiteboard you are a gibbering idiot who is unfit to clean the toilets much less do meaningful contributions to any project.
|
# ? Feb 3, 2014 02:21 |
|
|
# ? May 14, 2024 14:53 |
|
We haven't even started arguing about what encoding we're assuming yet (it's UTF-16).
|
# ? Feb 3, 2014 02:29 |
|
coffeetable posted:Reverse and compare is safest/easiest.
|
# ? Feb 3, 2014 02:37 |
|
Are you skilled enough to be able to dodge fencepost errors while re-implementing trivial, easily-available library code under time pressure in an environment where you can't test anything?
|
# ? Feb 3, 2014 03:13 |
|
I like how interviewing is an almost totally separate skillset from actually programming on the job. Why not just go from this subtle meta-game to full on noh plays and tea ceremonies? They're really asking "Do you have enough interviews/time spent preparing for interviews to answer this well?" at this point.
|
# ? Feb 3, 2014 03:16 |
|
GrumpyDoctor posted:Are you skilled enough to be able to dodge fencepost errors while re-implementing trivial, easily-available library code under time pressure in an environment where you can't test anything?
|
# ? Feb 3, 2014 03:19 |
|
Gazpacho posted:all you want, this is unironically what interviewees should expect and prepare for. Yes, I must learn how to interview instead of learn how to program and expect to be tested accordingly! Otherwise how would we have people who interview well but can't code that well to have the usual content of this thread?
|
# ? Feb 3, 2014 03:20 |
|
Although I am quite sympathetic to the pressures of interviewing, it's a poor excuse for not even setting the goal of being able to present efficient solutions in person.
|
# ? Feb 3, 2014 03:32 |
|
GrumpyDoctor posted:Are you skilled enough to be able to dodge fencepost errors while re-implementing trivial, easily-available library code under time pressure in an environment where you can't test anything? This is an actual skill, and it maps over to so-called actual programming. Making yourself worry about substring indices and the like unnecessarily is a bad thing, and as you get better at development, your search algorithm for implementation strategies gets better at finding and selecting harder-to-mess-up solutions. Steve French posted:Is it? Can you show an elegant tail recursive solution? I just spent like 15 minutes trying to find good HP 48 documentation so I could create an elegent UserRPL solution which I thought would look something like this: code:
code:
|
# ? Feb 3, 2014 03:34 |
|
Gazpacho posted:Although I am quite sympathetic to the pressures of interviewing, it's a poor excuse for not even setting the goal of being able to present efficient solutions in person. Wait, are quick fast "can you figure this out and show you can solve problems" questions suddenly now "you are either pretty amazing and can actually figure out something optimal in 2-5 minutes"? Or is it "lol do you remember this?" Nobody is against setting the goal of presenting efficient solutions. The issue is realistic expectations based on the time allotted to do anything. I just expect that people expect something based on the time spent and resources available, not lord bullshit. If you want that, give them the resources they'd use on the job, and give them a reasonable amount of time to do it, dammit. I've had interviews go like that - hey, use the internet, books, and hell the computer itself to write some code! And guess what, it wasn't nearly as stressful, and I got to actually think about different ways of doing things, and arrive at something that was efficient, instead of just "did I do this before and remember it." People who can't actually program won't be able to slip through that, and people who haven't memorized the standard interview repertoire aren't skipped over, they're allowed to solve an actual problem.
|
# ? Feb 3, 2014 03:45 |
|
My first comment was only to point out that low-level algorithm questions do exist in interviews, and the interviewers are then looking for an algorithm solution. It has not been that long ago that I got an algorithm question as part of a timed screen, and ended up giving a brute-force solution. So I get it. Still, there is a theoretical framework developed mainly by Hoare and Dijkstra that can, with enough practice, be used to approach such problems while catching and correcting the common errors. Gazpacho fucked around with this message at 04:11 on Feb 3, 2014 |
# ? Feb 3, 2014 03:59 |
|
What you said is reasonable; I'll shut up.
|
# ? Feb 3, 2014 04:13 |
|
A little while ago a guy I know, for whatever reason, wanted to remove all instances of ./ and ../ from a string (e.g. "./../../foo/bar.txt") and decided to use regular expressions to do it. This is the pattern that he came up with to match the ./ and ../ parts:code:
Incidentally another dude posted in the same thread as the guy above about how he wanted to match text that is formatted like >foo = >hello world or >foo = "hello world" (I don't know why he wanted both) and came up with this gem: code:
|
# ? Feb 3, 2014 04:28 |
|
what are you talking about those both own
|
# ? Feb 3, 2014 04:40 |
|
Steve French posted:Is it? Can you show an elegant tail recursive solution? Deus Rex posted:this would be cool in a language that uses structural sharing for strings, I guess. Steve French posted:Allocating n/2 extra strings is cooler than allocating 1 extra string plebs and your languages without pointers. C code:
|
# ? Feb 3, 2014 07:13 |
|
Damiya posted:Really? I don't know that I agree with that. I produce good code as an employee but if you give me a problem that I can tell is going to be well solved, many times before me, gently caress yea I'm gonna go to Google to see if there's an implementation jump off point. There's a lot to be said for reusing existing, working, already-debugged solutions; but if your bar for build versus borrow doing so is as low as writing a simple string reverse, that says a lot. It's literally faster to just write it yourself than it is to open up your browser, search for it, find, and vet a copy/paste solution -- at least once you're at a certain level of skill.
|
# ? Feb 3, 2014 07:16 |
|
biznatchio posted:There's a lot to be said for reusing existing, working, already-debugged solutions; but if your bar for build versus borrow doing so is as low as writing a simple string reverse, that says a lot. It's literally faster to just write it yourself than it is to open up your browser, search for it, find, and vet a copy/paste solution -- at least once you're at a certain level of skill. Knowledge of the language is important too, obviously. code:
|
# ? Feb 3, 2014 09:04 |
|
Gazpacho posted:Not inherently. It's a matter of skill. A lot of interview algorithm questions are testing whether your impulse is always "go talk to Mr. Library" vs. being able to do, if necessary, the things that library code does. In this case, reverse and compare is the safest/easiest answer because it's the simplest, clearest answer. There are worse habits than writing complex code without a good reason, but not many.
|
# ? Feb 3, 2014 09:19 |
|
Ephphatha posted:We haven't even started arguing about what encoding we're assuming yet (it's UTF-16). Reversing a Unicode string is highly nontrivial what with combining characters. All of the above works fine as long as you're in ASCII, or taking "string" to mean "sequence of bytes", but that's about it.
|
# ? Feb 3, 2014 10:57 |
|
qntm posted:Reversing a Unicode string is highly nontrivial what with combining characters. All of the above works fine as long as you're in ASCII, or taking "string" to mean "sequence of bytes", but that's about it. In reference to the guy that said "rolling your own code" would be preferable to "using a function from a library,"... this right here is a good example of why using library functions for something is preferable to rolling your own bullshit untested nonsense because you can't be bothered to Google the contents of the standard library of the language you're using. Library functions tend to have been tested, have documentation, and be robust enough to handle things you weren't thinking about when you were rolling your own code instead of using that library function. The interview test question of, "walk us through the logic of how you would replicate this standard library function" is perfectly sound, but sounds like a pretty huge horror in any kind of real work environment that's supposed to be sane. ErIog fucked around with this message at 16:05 on Feb 3, 2014 |
# ? Feb 3, 2014 11:33 |
|
It's stupid to ding someone in an interview for making syntax errors or generally pseudocoding the question. I've written a decent amount of C#, but without Intellisense I'd be sunk as gently caress. It's more important that talent can reason out the problem than remember the specific syntax for calling a static method or memorizing method signatures. Anyway, that level of pedantry is what email tests should be for. Do a pre-screen for anyone you're interested in bringing in for an interview. The goal should be that they produce testable, well-reasoned code that compiles and spits out the right answer. Then ask more process oriented questions in the interview.
|
# ? Feb 3, 2014 14:45 |
|
ErIog posted:rolling your own bullshit untested nonsense The purpose of asking someone to reverse an array is to see if they can solve a trivial problem using an algorithm, because they might have to write code that isn't implemented in a library.
|
# ? Feb 3, 2014 15:05 |
|
return0 posted:The purpose of asking someone to reverse an array is to see if they can solve a trivial problem using an algorithm,
|
# ? Feb 3, 2014 15:13 |
|
coffeetable posted:No, that'd be the purpose of asking someone to reverse an array without using library functions. Okay, so imagine that as a result of asking that question you discover they can't reverse an array without a library function - is this useful information to you, as the interviewer, which you didn't have before? If so it's a worthwhile question, right?
|
# ? Feb 3, 2014 16:08 |
|
return0 posted:Okay, so imagine that as a result of asking that question you discover they can't reverse an array without a library function - is this useful information to you, as the interviewer, which you didn't have before? If so it's a worthwhile question, right? It's a useful question both with the library function qualifier and without it. Without that qualifier though, the candidate can't assume that the question is intended to divine whether they can write an algorithm. It may well be intended to divine "does this candidate try ready-made solutions before inventing her own?"
|
# ? Feb 3, 2014 16:14 |
|
Ah okay, I understand what you are saying now, I thought you were insane and suggesting the question itself had no value rather than just ambiguous to the interviewee.
|
# ? Feb 3, 2014 16:40 |
|
What could possibly go wrong.
|
# ? Feb 3, 2014 17:56 |
|
Those are some precious bits they're saving! I can't imagine the debug that roots that out. Auto-dialer stuck emitting a bunch of 9's?
|
# ? Feb 3, 2014 18:01 |
|
evensevenone posted:plebs and your languages without pointers. If you're going to build a shed with pointers, C code:
|
# ? Feb 3, 2014 18:56 |
|
I believe at this point the mouse was given a cookie a year ago.
|
# ? Feb 3, 2014 19:05 |
|
Apart from the brief foray into unicode discussion, the palindrome testing requirements have gotten more lax as the implementations have gotten more clever.
|
# ? Feb 3, 2014 19:15 |
|
JawnV6 posted:Those are some precious bits they're saving! I can't imagine the debug that roots that out. Auto-dialer stuck emitting a bunch of 9's? Assuming they normalize to just the digits (although I'm not sure that's always valid to do), it'll be an integer, which shouldn't have fractional rounding problems. However, a CGFloat is in fact a float on 32-bit platforms (it being 64 bits on 64-bit platforms is also a hilarious horror, by the way), and a float gives you slightly less than 7 decimal digits of precision, so... It would need to be a uint64_t to reliably express even a ten-digit U.S. phone number. But I assume that all clients want it as a string, so it's not really an optimization at all unless you're keeping a ton of these in memory at once.
|
# ? Feb 3, 2014 19:48 |
|
You also lose information about leading zeroes, or formatting information like spaces, braces, or hyphens. It's a terrible idea to store a phone number as an actual number.
|
# ? Feb 3, 2014 19:52 |
|
Admiral H. Curtiss posted:You also lose information about leading zeroes, or formatting information like spaces, braces, or hyphens. It's a terrible idea to store a phone number as an actual number. A good point about leading zeroes, and I'm certainly not saying storing it as a number isn't awful, but when would you really care about formatting information? I guess it could be useful to distinguish between phone numbers in different areas of the world that might have the same number/sequence of digits. But presumably some normalization to complete numbers with country codes would solve all of the above issues.
|
# ? Feb 3, 2014 19:59 |
Does it make sense to do arithmetic on it? No? Then it isn't a number, even if it's numeric. A really basic rule of thumb, but I have no idea where you should be teaching it. Maybe it would be smarter for society to stop using numbers for non-scalars.
|
|
# ? Feb 3, 2014 20:04 |
|
But you can use the decimal places for country codes!
|
# ? Feb 3, 2014 20:09 |
|
Polygon did a feature about Street Fighter 2. Related tidbit is about bugs in the game called "handcuffs" where Guile can lock the player to him for the rest of the game, and the "air throw" where Guile could throw a player from anywhere on the screen. Imagine being responsible for a bug on one of your company's best selling arcade games. http://www.polygon.com/a/street-fighter-2-oral-history/chapter-3 MOTOHIDE ESHIRO (PROGRAMMER, GUILE): posted:
His boss seemed cool with it AKIRA NISHITANI: posted:I remember Mr. Eshiro coming to me, yeah. He was new to the company at that time and there were processes he was supposed to take, but I don't think he went through all those, which led to the bugs. So because of that, he felt really responsible and came to me, but I didn't take it that seriously. I was like, "Oh, what are you talking about?" I never seriously considered letting him quit. Motohide Eshiro later became producer for the Ace Attorney games.
|
# ? Feb 3, 2014 20:45 |
|
NFX posted:But you can use the decimal places for country codes! And we'll store the version ID in the mantissa!!
|
# ? Feb 3, 2014 20:50 |
I've been given an assignment to create an XSL that will insert the appropriate RTF tags to format XML to a client's liking. You heard right, RTF. I'm going to manually insert these tags all over an XSL file so that XML goes in one end and a pretty doc (with an RTF extension) comes out the other. Will post trip report if my brain does not melt out one of my ears before I'm done. bonus round: One of the items on the client list is a watermark Polio Vax Scene fucked around with this message at 21:41 on Feb 3, 2014 |
|
# ? Feb 3, 2014 21:38 |
|
|
# ? May 14, 2024 14:53 |
|
Might as well save some time and annoyance and just kill yourself now.
|
# ? Feb 3, 2014 22:20 |