Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.
I hate to dredge it up, but there's a closed form expression for the nth Fibonacci number so recursion or iteration are clearly the wrong thing to use.

Adbot
ADBOT LOVES YOU

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

PT6A posted:

Instead of deriving the closed-form solution, I just calculated the first four numbers in the sequence and noted that they were all perfect squares. You don't need to be some insane mathematician to do that, frankly.

A solution assuming a very small finite set matches a much wider pattern without a proof is itself a horror.

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

ToxicSlurpee posted:

If you can write C++ you can write C#; if you have provable experience with C++ moving to C# is pretty easy.

Going the other way is...a different story.

I've heard of people who had provable senior-level experience failing FizzBuzz. How is a mystery to me but apparently (from what I've heard, anyway) it doesn't matter what level you're interviewing at; half of people being interviewed can't write FizzBuzz.

The theory I usually hear about senior people with known experience is that they've essentially become managers and haven't written new code for a few years. At some point, I would expect most people who no longer interact with code to lose their abilities, much the same way you forget the specifics of advanced mathematics unless you keep up studies.

Not sure why they wouldn't interview for managerial positions if that were the case though. :iiam:

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

Centripetal Horse posted:

I am also questioning where companies are finding so many candidates who can't at least sketch out a reasonable approximation of something like FizzBuzz. This sounds more like, "putting people on the spot to code useless poo poo is a bad test of their actual abilities."

Tbf, fizz buzz can be solved with a loop and the modulo operator; not exactly bleeding edge stuff there. My favorite solution is the one that crashes the compiler and makes it vomit the answer in the error log though.

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

Centripetal Horse posted:

Heh, that sounds like a pretty great solution.

I've never actually been asked to do a FizzBuzz-type task. I am only familiar with it because I've read about it (I might have tried it, once; I don't recall.) It occurred to me that I might be a lovely programmer who can't do FizzBuzz, so I took a stab:
code:

for ($i = 1; $i <= 100; $i++) {
    echo (((($i%3)?null:"Fizz").(($i%5)?null:"Buzz"))?:$i)."\n";
}
It's not clever, and it's not particularly practical, and I could have shaved off a few parentheses. Is it a fail?

Too many \n if I read it correctly.

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

ultrafilter posted:

If none of the senior level developers you're interviewing are familiar with a topic, then you have to examine the possibility that it's just not that important in practice.

Confirmed. I know how to use bit wise operators, and understand their function; I've needed them maybe 1-2x in the past several years.

If you're hiring for a position where they would be necessary day to day, talk to HR about filtering better or types of specific experience you'd like to see.

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

PT6A posted:

You don't need to write super-optimized code to make a bit counter, you just need to know how to use & to determine whether a specific bit is set. It's no more involved than using | to create a bitmask, though I suppose if you have absolutely no idea what you're doing, one is more confusing than the other.

People are getting carried away with cleverness and optimization in here, which is fine, but in an interview situation, you can just write a basic bit counter with for loops or something.

std::bitset<5> foo;
foo[2] == true;

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.
I think the worst interview I attended was for a medical technology company. Their CEO went on this huge tangent about how they were very focused on technology/programming. Immediately after that their CTO asked what you could do with classes in c++ that you couldn't do with structs.

I said they were identical except default public/private, he told me I was wrong, then I pulled out the relevant section of the specification (which I keep on my iPad), and told him he was probably thinking of POD types, but that classes could also be POD types, and nothing stopped a struct from not being a POD.


I also had a few phone calls with games companies over typical algorithm stuff. One I provided an amortized O(1) solution with worst case O(N) and then I had to spend 10 minutes explaining amortization to the interviewer. Another couldn't grok an expanding/collapsing window to find some array element in O(N) using two iterators. Another got super confused when I provided a solution in big-theta(NlogN).


Hopefully I'm done dealing with terrible interviewers for a long while though. :unsmith:

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

genki posted:

To be fair to those interviewers, one of the major indicators for success within a company is attitude, and having someone that looks down on their peers because their peers may not be as knowledgeable as them is probably someone you don't want to hire into your team. It isn't clear from your statement that that's something that you did (I would make that assumption from saying "terrible interviewers" but maybe that was just a humor comment and not an condemnation of their ability to do their jobs), just something that it's important to note if someone ever gets rejected from an interview where they actually knew more than the interviewer (at least, so far as you know, making interviewees explain basic concepts really helps expose what it will be like to work with that person in a lot of ways, so it's a useful interview technique).

Of course, if the interviewers were simply not prepared to deal with the answers to their question, then yeah, that's on them... (though sharing knowledge of a new and different technique can be friendly and englightening for the interviewer and be a potential nice anecdote in the feedback!)

I don't doubt that those interviewers are perfectly able to do their day to day work (except for class/struct guy). Universally their response to relatively simple concepts was to say, "you're wrong"; the only valid response I know of being to provide a proof that the solution is correct. It's been my experience that if an interview gets to this point, it's very unlikely to move forward.

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

GeneralZod posted:

Did he tell you "the answer", in the end?

He got a little pale; the CEO was also in the room when I pulled out the spec and dropped the truth bomb. I then ended the interview.

I'm still fairly certain that he thought something being a struct enforced being a POD type.

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

Xarn posted:

No wonder he was confused, who the hell specifies big theta? :v:

If you're going through the trouble of proving the runtime of your algorithm, why not spend the extra 20 seconds to show a lower bound? :v:

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

Cast_No_Shadow posted:

Could also be an intentional thing. Coding nerds do not have a good reputation when it comes to explaining why someone else is wrong in constructive way. I might want to test if someone not only has the confidence to defend something they think is right in the face of 'power' saying its wrong but also to see of they do it in an educational way or a smug haha your dumb and I must prove Im right way.

Please don't be combative as an interviewer. It makes a very stressful situation much worse. If you want to make sure someone can explain things thoroughly, try, "I'm not sure I follow, .." over "No, the thing you said is wrong" /especially/ when the thing they said is not wrong. There is one company I have labeled as toxic for doing this both times I interviewed with them (right out of school, and the last time I was hunting); I will not pursue candidacy with them at any point in the future.

Basically, don't be smug yourself just to see if they're smug. You're being interviewed too.

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

Sex Bumbo posted:

Has anyone intereviewed using HackerRankX?

I'm not sure, but maybe? I think I did something through their site; where it was a 60-75 minute coding challenge with 3-4 problems that needed to be solved. Was basically a typical phone screen without the person on the other end. Except they just sent a link and asked me to do it at my leisure sometime in the next week.

If it's what I'm thinking of, anyway; though, there are several that are basically the same.

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

WINNINGHARD posted:

im interviewing people for a junior dev position this week. A guy came in with a resume stating 2 years of django experience, along with a bachelor's degree in CS.

Here was one of my questions:

given a table with 10 million rows defined by the following django model:

code:

class Sales(models.Model):
        date = models.CharField(max_length=25)
        amount = models.IntegerField(default=0)
what is the application killing mistake in this function?

code:

def find_dupes():
        dupes = []
        for i in Sales.objects.all():
                if Sales.objects.filter(date=i.date).count() > 1:
                        dupes.append(i)
        return dupes

He was stumped. Is this an unreasonable question to ask? I don't think it's unreasonable - this is a simplified version of what I ran into on this job in my first week. This is my first job, btw.

Been a few years since I did real Python stuff.. I'm going to assume that xxx.all() and xxx.filter() are both generators, but who gives a poo poo because your iterating over 10MM objects. And then you're allocating 10MM objects, which also seems bad. I'm not sure if counting the objects would expand the generator(probably does?), but that's bad too. I feel like that's more than one mistake though.

Or to put it another way, assuming filter is a generator, just return the filter and you're done in O(1) because actually iterating over that mess is someone else's job. Oh and congrats on 10MM sales.

E: misread and thought it was simpler. Assuming all() is a generator that returns things sorted by date (or has arguments to do so), you could still write a generator to return all duplicates without actually iterating over everything or allocating millions of dumb garbage. Marginally more complicated than just calling filter (though not by much).

leper khan fucked around with this message at 04:04 on Jul 15, 2016

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

WINNINGHARD posted:

Not quite, it's a django specific thing. Sales.objects.filter()... etc are django ORM calls and those methods return an object that looks and acts like a list.

It's iterating over the entire table with Sales.objects.all() [SELECT * FROM sales], and then for every row it's doing another query that roughly translates to SELECT COUNT(date) FROM sales where date = $CURRRENT_ELEMENT_DATE; and checking if the count's greater than one.

It's doing 10 million count queries in other words. The piece of code I grabbed it from was an API call that grabbed a 500k row CSV and loaded it into a DB... and took 11 hours to do so... I guess that one's for the coding horrors thread though.

Here was another whopper, from a guy with a CS degree from a UC. I didn't ask him the ORM question because i didn't think it'd be fair to test him on something he didn't claim to know.:

Instructions: remove all of the duplicate values from the following list:

code:

my_list = [1,2,1,2,1,1,4,5,6,7,3,4,2,3]

This guy's answer?
code:

for i in my_list:
        if i == i:
                my_list.delete(i)
        else:
                pass

The amazing thing with this is that there are 4 bugs in 2 lines.

After this question, btw, he said "I thought this was an entry level position?"

I asked a grand total of one question out of 30 or so that I didn't know when I took this job 10 months ago. Is it really easy to cheat at some schools?

If you want to cheat, yes, it is that easy. That people do is hilarious, because very few people care about your grades in college (as opposed to high school/SAT/ACT).

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

ToxicSlurpee posted:

The funniest things I saw were companies asking for those words or equally ridiculous ones while offering absolute beans for pay. I really want to know what goes through somebody's head when they demand top talent but offer like $45k. Programmers aren't cheap, especially if you want the best ones.

That or places with like 30 openings, none of which were entry level and none of which paid more than $39k. I'm like well, good luck with that.

I've taken jobs below market. Granted I've not stopped looking for work when doing that, but I'd rather get my expenses covered than drain my savings.

I'd probably play poker full time instead of working for peon wages though. The hourly is better, if it's a bit boring.

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

The_Franz posted:

"Top Tier University" seems to be a popular buzzphrase too which seems especially ridiculous when they pair it with positions that demand a decade of experience.

"Well sir, your years of experience in the R&D departments of companies X, Y and Z is very impressive..."
*snickers*
"Wait, you went to a state school 25 years ago!? Get lost scrub."

Hey man, my state school is a top university (in CS).

And I didn't graduate with debt. :getin:

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

Hughlander posted:

Actually it's just HR speak for "You were in school 25 years ago? You're not exploitable enough, pass"

I know someone who has been a tech director for years and was dropped late in the interview process because the CEO found out he never went to college.

Literal years of experience doing the job listed doesn't matter as much to some people as what you did 30 years ago.

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

UnfurledSails posted:

I hate it when interviewers waste my time. I'm given a question, so I briefly talk about the simplest, slowest solution before saying "But I think I can do better than that. Let's see what we can do here..." I've had multiple interviews where I was stopped at this point and forced to code the brute force solution and explain it in painstaking detail. Then we just ran out of time when it came to solving the problem in a nontrivial manner. I could have used those extra 5-10 minutes!

Bonus points if you get an RJ for being slow/not finishing.

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

Cuntpunch posted:

Am I wildly crazy to imagine that someone applying for a senior developer position with nearly 20 years of experience should probably be able to code, from scratch, on a whiteboard, a basic 'count the number of times each letter occurs in a string' method - that works and is functional?

Are you taking off for missing a semicolon or w/e? Because I'm prone to that on a whiteboard.

Not that anyone shouldn't be able to come up with this in like 5 minutes..
code:

def char_occurances(some_string, acc_dict):
    if (some_string is ""):
        return acc_dict
    acc_dict[some_string[0]] = 1 if some_string[0] not in acc_dict else acc_dict[some_string[0]] + 1
    return char_occurances(some_string[1:], acc_dict)

So no, you're not wildly crazy. The people that are applying for the position very well may be though.

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

MrMoo posted:

I guess they liked it as they are lining up another interview :lol: Another company said I "crushed it", giving a JavaScript answer of all things.

Today I had a pretty quick 30 minute interview which was a weird set of fast questions on C++11 including "what is the most misfortunate feature of C++11?" idk :wtf:

I was interviewed on C++11 by a vendor of the company I am actually applying to and which are a Java house and the interviewer in question is a networking engineer :derp:

Question is so easy if you're familiar with C++11. Just spitballing what you like or don't about it. I should read what's all in 17 now you mention it.

Do you have C++ on your resume?

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

MrMoo posted:

3 × interviews in Philly, 1 included CSS questions of all things and coding in Java, another included a dynamic programming problem in C++, and another a complex dynamic programming algorithm for image analysis on a whiteboard. So I asked the CSS interviewer questions about cheesesteak :derp:

If it doesn't have whiz it's not authentic.

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

ultrafilter posted:

Not a believer in provie wit?

Whiz wit out or :frogout:

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

sarehu posted:

Notably the standard also implies when describing exception unwinding that the object isn't "initialized" until after the constructor body has finished. I didn't find a place that explicitly said that, but I didn't look exhaustively.

Imagine what happens if you call delete this in a constructor and then throw an exception after that.

Is the answer that you'll need to find a new job?

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

hobbesmaster posted:

A struct is a class. Full stop.

Take a look at the C++14 standard starting on page 226. You may be surprised at the keywords they use when describing class declarations.

I have walked out of interviews because the :airquote:lead engineer/CTO:airquote: interviewing me tried to argue that there were significant differences between class and struct in C++11 other than default public/private.

Because that's the only difference.

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

Tomahawk posted:

And this thread is making me glad that I'm not a C++ programmer

lol if you think Java is better than C++.
I wish Java had half the niceties of C++, also why am I writing Java I did not sign up for this.

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

fritz posted:

I've been trying to learn myself a scala and have been repeatedly pleasantly surprised at how much useful stuff's floating around out there in the jvm ecosystem, and in particular how nice it is to have a maven for managing dependencies instead of the c++'s world "good luck" policy.
Can't argue that there isn't a lot of existing Java code. :v:

ExcessBLarg! posted:

But is your average C++ codebase "better" than your average Java codebase? How much C++ do you encounter in the wild that's modern C++11?
Among projects started in the past five years a fair amount..? Both languages have some issues with legacy.
I feel like C++ allows for a wider range on the "better" spectrum, ranging from horrifying to pleasant. Java seems to condense the range around annoying. I'd rather work with tools that can be nice, rather than tools that prevent me from losing limbs but remain generally unpleasant.

Adbot
ADBOT LOVES YOU

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

TopherCStone posted:

Arbeit makefile is as close as I can get

free free macht Arbeit?

  • Locked thread