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
GeneralZod
May 28, 2003

Kneel before Zod!
Grimey Drawer

leper khan posted:

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.

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

Adbot
ADBOT LOVES YOU

Xarn
Jun 26, 2015

leper khan posted:

Another got super confused when I provided a solution in big-theta(NlogN).

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

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:

FamDav
Mar 29, 2008
I think the only time where I corrected an interviewer and it wasn't awful was telling him you can construct a heap from an arbitrary array in linear time after he said I was wrong. He was like really and I was like yeah and then I sketched it out and he was like oh cool good poo poo good poo poo.

genki
Nov 12, 2003

leper khan posted:

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.
Sorry, this was specifically about the followup phone interview notes. Maybe they all told you you were wrong? That does seem like they weren't properly prepared to accept answers. Being prepared definitely goes both ways.

Cast_No_Shadow
Jun 8, 2010

The Republic of Luna Equestria is a huge, socially progressive nation, notable for its punitive income tax rates. Its compassionate, cynical population of 714m are ruled with an iron fist by the dictatorship government, which ensures that no-one outside the party gets too rich.

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.

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.

Space Whale
Nov 6, 2014
I had a sorta horror a few hours ago.

Recruiter sends me to their client's old office - the sign is on the ground in the hallway, not on the wall, and the inside of the office is mostly "under construction." I immediately call the recruiter and they say "Oh keep knocking they're inside and just moved there."

They did move. Somewhere else. I get a text of the address from the contact at $maybeJob and drive a good 15 minutes there, and find that without incident.

The coding portion was "given an array (not a list?) of data points with state/city/datetime/low/high give me monthly averages by city." But, alas, the interviewer's laptop's Visual Studio license was either gone or VS just crashed instantly. Also the thing they told me to write before I came in couldn't launch because licensing and we didn't have time to get IIS(Express) or SqlServer running, so we just eyeballed the code in text editors.
:q:

They say treat it like whiteboarding so I just start stubbing out functions that would give me a list of lists by city and month, then I passed that to something that took the sub list and added everything up, got the count, divided by the count, boom, average high/low. But I kept hitting the touchpad with my palm and the cursor jumped all over the drat place. After I implement a few methods they're like "oh alright let's move on."

So we just sorta look at the project's code and go over a few decisions made, and at least we had an interesting discussion of if a sanity checking method of a class should be static or not, given that I don't need an instance of the class to know if it's a valid input given the logic of the class itself. I also found I had forgotten to call context.SaveChanges() in one of my methods before they did, hah.

Then I forget what CI means after they say "hey you've done plenty of CI" because I'm still frazzled from moving and dehydrated from altitude and we have a laugh and talk about Team City while I chug some ice water.

After that the actual director dude comes back and brags on how cool the office is, Wine Fridays, and the drone a product dude flies around, then tells me the office is mostly empty because half the company is in San Francisco.

All in all this could have been way worse, but given that everyone sorta rolled with the punches I suppose we indicated to each other we can handle poo poo and keep going.

Whee!

Edit: horror feedback!

"Groupby should have flown from his fingertips." They didn't say to just linq it up. They said whiteboard it so I made a method that GroupByShitForMe then they stopped me before implementation of it.

Then the recruiter calls back this morning: "So are you sure you're strong on C#?"

Should I tell them to gently caress off or do I have to explain that being strung out to begin with, still acclimating to living on the moon, sent to the wrong place, then sprung on with something despite bringing a project with me, then having their own environment they wanted me to use not work might have thrown me for a loop?

Then they say I should have used an enum for the grains or hops in my stupid beer app. Because I'm a developer, a brewer, and it's somehow obvious that I should just have a domain model for grains for a toy website.

poo poo like this makes me want to kick things.

Space Whale fucked around with this message at 21:46 on Jun 24, 2016

Sex Bumbo
Aug 14, 2004
They could have just asked why you didn't use linq when you were there? Sounds silly on their part.

Space Whale
Nov 6, 2014
I got another doozie.

Indeed will do recorded screenings where you answer poo poo like:

quote:

Please tell us a little bit about your background and experience.
Please tell us why you are interested in this position and how you can make a difference.
Please tell us about a past accomplishment that you are especially proud of and why.
Please describe a difficult situation you encountered in a previous job and how you resolved it.

TO A loving RECORDING SERVICE, then maybe you'll get a response back from a hiring manager.

For gently caress's sake, it's much harder than speaking to a person, I feel pretty insulted in more than one way, and I can't believe anyone would actually do this.

I wonder how many people pass on the job due to hiring practices like this.

I almost regret doing it.

csammis
Aug 26, 2003

Mental Institution
That almost seems a bit more personable than having to type up answers to those same questions in to every automated HR screener that exists. At least this way there isn't an opportunity for a lovely applicant to just pound in those those answers canned from some "ACE UR INTERVIEW!" site. Close your eyes and imagine you're talking to a Real Human and go nuts on it.

Meaning no offense, from the last several posts it sounds like you're having a stressful time with interviews in general. Have you tried doing a mock interview and getting feedback from that? It can help when you get practice in a situation where there isn't something riding on it.

Space Whale
Nov 6, 2014
It's more the subtle bs that lurks under all interviews that I have a problem with.

You're always playing a rock paper scissors game of "what do they actually want?" while also trying to be honest, while also balancing how much you sell yourself because you're expected to oversell.

The add the odd numbers interview was fine in person, at least. When I'm in person, I almost always have a good experience. I don't think one bad interview when I'm exhausted and one screen with a robot is that big of a deal.

That said I'm probably the odd goon/developer here in that I like interacting with people instead of just running off to the cave to program.

Zaodai
May 23, 2009

Death before dishonor?
Your terms are accepted.


Space Whale posted:

It's more the subtle bs that lurks under all interviews that I have a problem with.

You're always playing a rock paper scissors game of "what do they actually want?" while also trying to be honest, while also balancing how much you sell yourself because you're expected to oversell.

The add the odd numbers interview was fine in person, at least. When I'm in person, I almost always have a good experience. I don't think one bad interview when I'm exhausted and one screen with a robot is that big of a deal.

That said I'm probably the odd goon/developer here in that I like interacting with people instead of just running off to the cave to program.

Making broad assumptions about your peers regarding how superior you are to them may mean you aren't as good with people as you think. You might be, I don't know you. All I'm saying is consider that other people might not see you the way you think they do.

Having to play "the game" is the worst part of most corporate environments.

qntm
Jun 17, 2009
Suggestion: the more you need to play that game, the less you want the job, so be yourself?

ToxicSlurpee
Nov 5, 2003

-=SEND HELP=-


Pillbug

Space Whale posted:

I got another doozie.

Indeed will do recorded screenings where you answer poo poo like:


TO A loving RECORDING SERVICE, then maybe you'll get a response back from a hiring manager.

For gently caress's sake, it's much harder than speaking to a person, I feel pretty insulted in more than one way, and I can't believe anyone would actually do this.

I wonder how many people pass on the job due to hiring practices like this.

I almost regret doing it.

I had two interviews that told me to record responses to recorded videos. I didn't get either job but later decided to work for neither company ever. Both of them sent me tasks with literally zero indication of what I'd need to know but were unrelated to what I had on my resume. It felt like a wholly automated, impersonal system that was terrible, terrible, terrible.

It screamed incompetence from start to finish. One was an AI sort of thing that gave me 30 minutes to write a pretty hard thing in jquery. It was also entry level and I had jquery nowhere on my resume. The lady recording the videos that told me what to talk about very obviously just plain didn't want to be doing it and didn't care.

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


A friend of mine interviewed for a junior web development position. Somehow he ended up getting questions about using stochastic gradient descent in a distributed environment.

Space Whale
Nov 6, 2014

Zaodai posted:

Making broad assumptions about your peers regarding how superior you are to them may mean you aren't as good with people as you think. You might be, I don't know you. All I'm saying is consider that other people might not see you the way you think they do.
I always assume I'm surrounded by people who are superior devs than I am, especially in interviews, since they're doing the interviewing.

I also assume I'm almost certainly mediocre, since that's almost always the case, for most people, and most things most people do.

Zaodai posted:

Having to play "the game" is the worst part of most corporate environments.
I just meant interviews.

I always do the naive/obvious thing first then make changes as I go, since skipping to something as good as I can do in an interview means I have no room to improve, and a lot of people apparently like seeing the progression.

In terms of being myself, I am; I've worked jobs with environments that did not click and learned that lesson the hard way.

Space Whale
Nov 6, 2014

ultrafilter posted:

A friend of mine interviewed for a junior web development position. Somehow he ended up getting questions about using stochastic gradient descent in a distributed environment.

For Jane Street?

PT6A
Jan 5, 2006

Public school teachers are callous dictators who won't lift a finger to stop children from peeing in my plane

Space Whale posted:

I always assume I'm surrounded by people who are superior devs than I am, especially in interviews, since they're doing the interviewing.

I also assume I'm almost certainly mediocre, since that's almost always the case, for most people, and most things most people do.

Be careful with this. Being around the prima donna who thinks they're the best at everything is a pain in the rear end for obvious reasons, but being around the person who thinks they're mediocre or average is equally frustrating when they're actually very good at what they do, because their expectations of everyone else get warped as a result.

magnetic
Jun 21, 2005

kiteless, master, teach me.
So I just interviewed with Oracle for a dev position that I really was not after because a friend of mine is heading up UX for the team. My code challenge: Implement an LRU cache.

me: what does L, R and U stand for?
her: least recently used.
me: hrm let me think about that. I am not feeling well I have a pretty bad cold so bare with me.
her: what kind of data structure would you use.
me: hashmap, linked list and some strings or something
her: that's good code that...
me: stubs out some methods with todos declare a hashmap
me: "thinks about it for a minute" I feel terrible I think I am going to go back to bed, I am too stoned on robotusin to implement a double linked list (since you know I never use them, and I am spaced out)
her: well you got further than most people.
me: to be fair I do mostly management, show juniors how to use git or JIRA and solve one off problems for big clients.
her: would you like me forward your resume to the management team.
me: No I really don't see myself as a manager at Oracle.

and somehow I am getting a second interview? I am pretty blown away.

FYI - this is for the new cloud services SDK team, they are pretty eager to hire a few solid engineers.

Despite being very sick, sure glad I am employed I am pretty bad a interviewing.

Cast_No_Shadow
Jun 8, 2010

The Republic of Luna Equestria is a huge, socially progressive nation, notable for its punitive income tax rates. Its compassionate, cynical population of 714m are ruled with an iron fist by the dictatorship government, which ensures that no-one outside the party gets too rich.

leper khan posted:

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.

Yeah, I would never do this, just trying to think of reasons why somebody might have.

Centripetal Horse
Nov 22, 2009

Fuck money, get GBS

This could have bought you a half a tank of gas, lmfao -
Love, gromdul

magnetic posted:

So I just interviewed with Oracle for a dev position that I really was not after because a friend of mine is heading up UX for the team. My code challenge: Implement an LRU cache.

me: what does L, R and U stand for?
her: least recently used.
me: hrm let me think about that. I am not feeling well I have a pretty bad cold so bare with me.
her: what kind of data structure would you use.
me: hashmap, linked list and some strings or something
her: that's good code that...
me: stubs out some methods with todos declare a hashmap
me: "thinks about it for a minute" I feel terrible I think I am going to go back to bed, I am too stoned on robotusin to implement a double linked list (since you know I never use them, and I am spaced out)
her: well you got further than most people.
me: to be fair I do mostly management, show juniors how to use git or JIRA and solve one off problems for big clients.
her: would you like me forward your resume to the management team.
me: No I really don't see myself as a manager at Oracle.

and somehow I am getting a second interview? I am pretty blown away.

FYI - this is for the new cloud services SDK team, they are pretty eager to hire a few solid engineers.

Despite being very sick, sure glad I am employed I am pretty bad a interviewing.


This is like a Dilbert cartoon, or that scene in Office Space. "I'd like to move us right along to a Mr. Magnetic. Now we had a chance to meet this young man, and boy that's just a straight shooter with upper management written all over him."

sarehu
Apr 20, 2007

(call/cc call/cc)

magnetic posted:

me: No I really don't see myself as a manager at Oracle.

A well-timed neg, bro, you signaled you aren't a cuck. (Am I doing this right?)

Space Whale
Nov 6, 2014

sarehu posted:

A well-timed neg, bro, you signaled you aren't a cuck. (Am I doing this right?)

Strong Sauce
Jul 2, 2003

You know I am not really your father.





i have probably mentioned this story before in the job threads.

this was >4 years ago

basically one of the authors of a very popular frontend framework (not the position i was applying for) spent all his time looking down at his laptop chatting with his friends during the interview. the only times he looked up was when he walked in the door to say "hello" but didn't bother to allow me to introduce myself because he went right back down to looking at his laptop.

then looking at my resume, he asked me to either reimplement jquery or eventmachine from scratch. i chose jquery because gently caress if i know how a C or C++ library was written for ruby.

he pretty much spent the rest of the interview on his laptop. he looked up one time to check my progress, said something about, "how does jquery implement that?" (so of no real help at all), and went back down to his laptop.

Space Whale
Nov 6, 2014
You walked out right

piratepilates
Mar 28, 2004

So I will learn to live with it. Because I can live with it. I can live with it.



Strong Sauce posted:

i have probably mentioned this story before in the job threads.

this was >4 years ago

basically one of the authors of a very popular frontend framework (not the position i was applying for) spent all his time looking down at his laptop chatting with his friends during the interview. the only times he looked up was when he walked in the door to say "hello" but didn't bother to allow me to introduce myself because he went right back down to looking at his laptop.

then looking at my resume, he asked me to either reimplement jquery or eventmachine from scratch. i chose jquery because gently caress if i know how a C or C++ library was written for ruby.

he pretty much spent the rest of the interview on his laptop. he looked up one time to check my progress, said something about, "how does jquery implement that?" (so of no real help at all), and went back down to his laptop.

Misko Hevery?

Sex Bumbo
Aug 14, 2004
Has anyone intereviewed using HackerRankX?

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.

WINNINGHARD
Oct 4, 2014

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.

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

Jabor
Jul 16, 2010

#1 Loser at SpaceChem
I haven't even looked at the code but just from the form of the question I'm guessing it's an unnecessary n2 algorithm.

sarehu
Apr 20, 2007

(call/cc call/cc)
Or (I don't know Django) the filter is O(log n) or O(1) but you're still doing 10 million roundtrips?

sarehu fucked around with this message at 05:49 on Jul 15, 2016

WINNINGHARD
Oct 4, 2014

leper khan posted:

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).

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?

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).

Pollyanna
Mar 5, 2005

Milk's on them.


WINNINGHARD posted:

This guy's answer?
code:
for i in my_list:
        if i == i:
                my_list.delete(i)
        else:
                pass

(ノ∀`)アチャー

I expected the Django question to be an ~O(n^2) issue, because that's the sort of thing you write SQL queries for. It's loading everything into memory and then operating on it with Sales.objects.all(), and then running a query on each one. I haven't done Django work in two years, but if it's anything like Rails (not by much), then there should be some documentation that explains how to use the ORM in a manner that isn't as stupid as that. I'd have to tinker a bit to figure out exactly what to do, but whenever you see imperative/procedural loops and conditional statements over the results of a database call, that's a huge code smell. Also the whole incredibly-inefficient thing.

spiritual bypass
Feb 19, 2008

Grimey Drawer
The question itself is strange. Why wouldn't you just use an aggregate query to identify and count dupes? Databases are really good at that stuff.

Adbot
ADBOT LOVES YOU

Pollyanna
Mar 5, 2005

Milk's on them.


rt4 posted:

The question itself is strange. Why wouldn't you just use an aggregate query to identify and count dupes? Databases are really good at that stuff.

ORMs have made people pretty bad at using databases. They figure they can handle the database's job in the application, when the database is better at it in the grand majority of cases.

  • Locked thread