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.
 
  • Post
  • Reply
Bunny Cuddlin
Dec 12, 2004
pretend i posted some inline assembly using XCHG here im too lazy to look it up

Adbot
ADBOT LOVES YOU

Dren
Jan 5, 2001

Pillbug
I've found that you don't have to ask people about code in order to figure out that they can't code. You can weed them out before that. Ask them to explain some projects on their resume, their role on those projects, and describe a code problem they encountered.

hobbesmaster
Jan 28, 2008

Bunny Cuddlin posted:

pretend i posted some inline assembly using XCHG here im too lazy to look it up

Its xchg eax, eax of course!

But uh, seriously don't write xor swap or inline asm for this poo poo. If its even a correct answer its likely not faster than what the compiler has for swap and a rather extreme example of premature optimization.

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...

Dren posted:

I've found that you don't have to ask people about code in order to figure out that they can't code. You can weed them out before that. Ask them to explain some projects on their resume, their role on those projects, and describe a code problem they encountered.

This doesn't work, at least not for us. We get people who talk a great game but literally cannot code anything.

Doctor w-rw-rw-
Jun 24, 2008
Commit Message Generator
Heh. Why produce bad commit messages when the computer can do it for you?

Jewel
May 2, 2009

Doctor w-rw-rw- posted:

Commit Message Generator
Heh. Why produce bad commit messages when the computer can do it for you?

"For real, this time." is one I've found myself using once or twice. Forgetting to add something to the commit :argh:

bucketmouse
Aug 16, 2004

we con-trol the ho-ri-zon-tal
we con-trol the verrr-ti-cal
'You have a conveyor belt that periodically brings you boxes of different colors. You need to open the purple ones and hold the red boxes aside until they can be paired with a matching blue box. There converyor also periodically produces rocks, which can be ignored entirely. How would you model this using objects?"

(We need a fizzbuzz question to weed out people who write insane OO inheritance models)

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde

Dren posted:

I've found that you don't have to ask people about code in order to figure out that they can't code. You can weed them out before that. Ask them to explain some projects on their resume, their role on those projects, and describe a code problem they encountered.
What are you looking for with that last bit? Because people who have a poor grasp of programming language semantics can tell you about encountering code problems all day.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe

bucketmouse posted:

'You have a conveyor belt that periodically brings you boxes of different colors. You need to open the purple ones and hold the red boxes aside until they can be paired with a matching blue box. There converyor also periodically produces rocks, which can be ignored entirely. How would you model this using objects?"

(We need a fizzbuzz question to weed out people who write insane OO inheritance models)

class Rock extends Box {

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed
class Rock {}
class RedBox extends Rock {}
class BlueBox extends Rock {}
class PurpleBox extends RedBox, BlueBox {}


Pretty sure that's how OO is supposed to work.

evensevenone
May 12, 2001
Glass is a solid.
Clearly you need multiple inheritance, since a purple box is both the descendant of box and of the color purple.

HappyHippo
Nov 19, 2003
Do you have an Air Miles Card?
I prefer to view the purple box as a descendant of the red box and the blue box since it has the qualities of both redness and blueness (and boxness).

Edit: damnit someone already made the same joke

Doctor w-rw-rw-
Jun 24, 2008

Plorkyeran posted:

class Rock {}
class RedBox extends Rock {}
class BlueBox extends Rock {}
class PurpleBox extends RedBox, BlueBox {}


Pretty sure that's how OO is supposed to work.
No, no. That's clearly inadequate.
interface IColoredObject {}
interface IConveyorObject {}
abstract class AbstractConveyorObject implements IConveyorObject {}
final class Rock extends AbstractConveyorObject {}
abstract class Box extends AbstractConveyorObject {}
final class RedBox extends Box implements IColoredObject {}
final class BlueBox extends Box implements IColoredObject {}
final class PurpleBox extends Box implements IColoredObject {}


and then refactored into

interface IColoredObject {}
interface IConveyorObject {}
interface IBlueObject extends IConveyorObject, IColoredObject {}
interface IRedObject extends IConveyorObject, IColoredObject {}
interface IPurpleObject extends IBlueObject, IRedObject {}
abstract class AbstractConveyorObject implements IConveyorObject {}
final class Rock extends AbstractConveyorObject {}
abstract class AbstractBox extends AbstractConveyorObject {}
@Deprecated final class RedBox extends AbstractBox implements IColoredObject {}
@Deprecated final class BlueBox extends AbstractBox implements IColoredObject {}
@Deprecated final class PurpleBox extends AbstractBox implements IColoredObject {}
class BlueBoxImpl extends AbstractBox implements IBlueObject {}
class RedBoxImpl extends AbstractBox implements IRedObject {}
class PurpleBoxImpl extends AbstractBox implements IPurpleObject {}


Remember, sometimes purple boxes gotta do what only purple boxes can.

McGlockenshire
Dec 16, 2005

GOLLOCKS!

Doctor w-rw-rw- posted:

interface IColoredObject {}
How amazingly un-PC of you.

That should be IAfricanAmericanObject.

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

Doctor w-rw-rw- posted:

No, no. That's clearly inadequate.
interface IColoredObject {}
interface IConveyorObject {}
abstract class AbstractConveyorObject implements IConveyorObject {}
final class Rock extends AbstractConveyorObject {}
abstract class Box extends AbstractConveyorObject {}
final class RedBox extends Box implements IColoredObject {}
final class BlueBox extends Box implements IColoredObject {}
final class PurpleBox extends Box implements IColoredObject {}


and then refactored into

interface IColoredObject {}
interface IConveyorObject {}
interface IBlueObject extends IConveyorObject, IColoredObject {}
interface IRedObject extends IConveyorObject, IColoredObject {}
interface IPurpleObject extends IBlueObject, IRedObject {}
abstract class AbstractConveyorObject implements IConveyorObject {}
final class Rock extends AbstractConveyorObject {}
abstract class AbstractBox extends AbstractConveyorObject {}
@Deprecated final class RedBox extends AbstractBox implements IColoredObject {}
@Deprecated final class BlueBox extends AbstractBox implements IColoredObject {}
@Deprecated final class PurpleBox extends AbstractBox implements IColoredObject {}
class BlueBoxImpl extends AbstractBox implements IBlueObject {}
class RedBoxImpl extends AbstractBox implements IRedObject {}
class PurpleBoxImpl extends AbstractBox implements IPurpleObject {}


Remember, sometimes purple boxes gotta do what only purple boxes can.

This makes me feel violent towards you.

Doctor w-rw-rw-
Jun 24, 2008

Thermopyle posted:

This makes me feel violent towards you.

Only because it's so disgustingly plausible, am I right?

Maluco Marinero
Jan 18, 2001

Damn that's a
fine elephant.

Jewel posted:

"For real, this time." is one I've found myself using once or twice. Forgetting to add something to the commit :argh:

What's wrong with git commit --amend? Is this not a common feature?

tef
May 30, 2004

-> some l-system crap ->

Otto Skorzeny posted:

There was a place that a coworker of mine interviewed at that had everyone take a two hour personality test during the interview, and all the employees cubicles had color-coded signs with their Myers-Briggs type and a blurb on how to interact with them based on their being an INTJ or whatever :stare:

At one place I worked at, every interview was special.

They'd hired someone who'd previously worked on a 'personality test horoscope' thing, http://en.wikipedia.org/wiki/DISC_assessment and so everyone who joined was asked to pick from a series of Forer Sentences to see if they were a fighter, a mage, or a priest, etc. They also asked people to do a "mental agility" test, which involved simple "A is to B as B is to C" and tests that measured how fast you could rotate shapes in your head. They also liked to ask "impossible gimmick" questions, including "How much teflon is there in the universe", you know, to see how well you knew XML and Xpath.

Wheany
Mar 17, 2006

Spinyahahahahahahahahahahahaha!

Doctor Rope

Jabor posted:

Be careful with fizzbuzz, because it doesn't really help with screening out the degree mill graduates who study those "interview questions" and can regurgitate an answer, but still don't actually know how to program.

You probably want a similarly-trivial programming problem that no-one else uses as an interview question.

Fizzbuzz, but with 5 and 7 instead of 3 and 5.

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...

Doctor w-rw-rw- posted:

Commit Message Generator
Heh. Why produce bad commit messages when the computer can do it for you?

How did you find our repository?! Get out of there you do not belong shoo go!

Civil Twilight
Apr 2, 2011

tef posted:

everyone who joined was asked to pick from a series of Forer Sentences to see if they were a fighter, a mage, or a priest, etc.

Just run everyone through the character creation questions from Ultima, problem solved.

seiken
Feb 7, 2005

hah ha ha
I stumbled across this thread on another forum that's from a year and a half ago so it's kind of old, but it's too good not to share.

Your opinion on the functionality of a template dynamic list

Basically, a clueless C++ guy ranting for several pages about how terrible the standard library is (while completely misunderstanding it) and showing off his crazy hand-rolled replacement where pretty much every function is called operator=. Some choice excerpts:

quote:

For example, some time back I had a linked list that took probably about 2000 - 3000 lines of code riddled with memory allocation crashes and various pitfalls.

The present one (iteration 4) takes roughly 800 lines of code (scratched out in one day) - this includes both node and list, doesn't crash (bar user abuse - iteration 3 can't be crashed but is less efficienct), it will explicitly report traceable errors, and compared to previous iterations, already has more advanced functions (it's not finished yet).

C++ code:
File = "Test.txt";
File = 'w';
File = "Write this to file.";
C++ code:
RendererProc Renderer;
ImageQueue Queue;
FileImage ImageLoader;

Queue = ImageLoader = "image1.jpg";
Queue = ImageLoader = "image2.jpg";
Queue = ImageLoader = "image3.jpg";

Renderer = Queue;

quote:

I had the last iteration code up to the point where, barring some optimisation, this would have been valid:

File = HTMLData = "http://iono.jpl.nasa.gov/latest_rti_global.html";

And yes, it does precisely what you think it does.

quote:

I am not sure what there is to maintain? It's straight forward enough to use - assignment operators mostly.

Wheany
Mar 17, 2006

Spinyahahahahahahahahahahahaha!

Doctor Rope

seiken posted:

C++ code:
File = "Test.txt";
File = 'w';
File = "Write this to file.";

Am I interpreing this correctly: The first assignment opens a file, the second sets the file's mode to write and the third assignment is written into the file?

Well that's just genius.

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...

Wheany posted:

Am I interpreing this correctly: The first assignment opens a file, the second sets the file's mode to write and the third assignment is written into the file?

Well that's just genius.

Perfectly intuitive.

Volte
Oct 4, 2004

woosh woosh

seiken posted:

I stumbled across this thread on another forum that's from a year and a half ago so it's kind of old, but it's too good not to share.

Your opinion on the functionality of a template dynamic list

Basically, a clueless C++ guy ranting for several pages about how terrible the standard library is (while completely misunderstanding it) and showing off his crazy hand-rolled replacement where pretty much every function is called operator=. Some choice excerpts:


C++ code:
File = "Test.txt";
File = 'w';
File = "Write this to file.";
C++ code:
RendererProc Renderer;
ImageQueue Queue;
FileImage ImageLoader;

Queue = ImageLoader = "image1.jpg";
Queue = ImageLoader = "image2.jpg";
Queue = ImageLoader = "image3.jpg";

Renderer = Queue;
I'm crying

Posting Principle
Dec 10, 2011

by Ralp

Crazy man posted:

Std::list requires log(n) time to get the size of the list, when it's perfectly possible to get a log(1) return, including iterator numeric position.
OK so O(n) list::size would indicate that he's using GNU libstdc++ ...

quote:

Given how I have no idea how it operates under the covers
... but he doesn't know he can just look at the source :negative:

Jewel
May 2, 2009

I'm speechless. The dude not even once explains why he needs to call size() so often that it's a bottleneck. Or why he wants to read a file into a linked list in the first place?? Or was he trying to save a linked list to a file?? Or?? I'm so confused :negative:

Posting Principle
Dec 10, 2011

by Ralp

Volmarias posted:

Perfectly intuitive.

s/operator=/operator<<

congratulations you're now in the C++14 standard kiddo.

Hughlander
May 11, 2005

Jewel posted:

"For real, this time." is one I've found myself using once or twice. Forgetting to add something to the commit :argh:

git commit -a --amend
git push -f origin master
has your back.

Mogomra
Nov 5, 2005

simply having a wonderful time

kitten smoothie posted:

Are you in the US? From everything I've read, administering a general intelligence test in an interview is asking to get yourself sued. Skill-based testing is one thing, as it demonstrates that the test is relevant to the critical skills necessary to do the job. But a plain old IQ test means you have to show that the IQ cutoff you choose means nobody below that can do the job, and that the test is professionally developed and not biased against people in protected classes.

I have to imagine that a bona fide IQ test administered by a licensed psychologist is prohibitively expensive to use as a general employment screening tool.

Yes I am, and I didn't think about that for a second. It wasn't administered by a licensed psychologist though. They just threw a test in front of me that had a bunch of weird spacial reasoning and math problems in front of me, and said I had a time limit.

So thinking about it, while it probably wasn't really an IQ test, it sure as hell felt like one to someone who has never done anything like that before.

I wonder if there's a thread for wacky interview poo poo people have had to go through.

Jewel
May 2, 2009

Hughlander posted:

git commit -a --amend
git push -f origin master
has your back.

Both people replied with a git command but I wasn't using git. I haven't gotten a chance to use/learn it yet v:shobon:v

(I do most of my personal work in class where we use perforce so I just use it because it's there, and use it at home because I have to use it for class. I used to use TortoiseSVN when I did the majority of work on my own projects from home though. I tried out git for the first time about.. 2-6 months ago, and I liked it! I don't know any of the commands yet, but I definitely can see why it's liked, and will try to learn it thoroughly when I get the chance (probably after uni or during a break).

Jewel fucked around with this message at 14:27 on May 7, 2013

hobbesmaster
Jan 28, 2008

Jerry SanDisky posted:

s/operator=/operator<<

congratulations you're now in the C++14 standard kiddo.

C++14? Yeah right, just start calling it C++2x now so it's not as embarrassing when it's formalized in 2031.

Posting Principle
Dec 10, 2011

by Ralp

hobbesmaster posted:

C++14? Yeah right, just start calling it C++2x now so it's not as embarrassing when it's formalized in 2031.

And libstdc++ will still be missing <regex> :smith:

New Yorp New Yorp
Jul 18, 2003

Only in Kenya.
Pillbug

Mogomra posted:

Yes I am, and I didn't think about that for a second. It wasn't administered by a licensed psychologist though. They just threw a test in front of me that had a bunch of weird spacial reasoning and math problems in front of me, and said I had a time limit.

So thinking about it, while it probably wasn't really an IQ test, it sure as hell felt like one to someone who has never done anything like that before.

I wonder if there's a thread for wacky interview poo poo people have had to go through.


One of the worst things I've been asked was the Brown Eyes/Blue Eyes logic puzzle. Except it wasn't posed to me correctly and was rendered impossible to solve. They asked me "how would everyone know what color their eyes are?", and left out a bunch of other pieces of information.

My ultimate response (after eliminating all of the "reflective surfaces" options) was to suggest that every person on the island pull out one of their eyes. This met with a horrified expression. I did not receive an offer.

Even if they had posed it to me exactly as worded in that article, I doubt I'd have been able to solve it.

[edit] This thread is turning into the "interview" thread somehow.

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



Hughlander posted:

git commit -a --amend
git push -f origin master
has your back.

Isn't it a bad idea to force push when you've changed the history? I mean I force push all the time but that's cause nobody ever pulls from my repos so I don't care. Though I do try to hold off pushing until I'm at least partially sure that I won't have to rebase or amend anything.

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...

Jewel posted:

Both people replied with a git command but I wasn't using git. I haven't gotten a chance to use/learn it yet v:shobon:v

(I do most of my personal work in class where we use perforce so I just use it because it's there, and use it at home because I have to use it for class. I used to use TortoiseSVN when I did the majority of work on my own projects from home though. I tried out git for the first time about.. 2-6 months ago, and I liked it! I don't know any of the commands yet, but I definitely can see why it's liked, and will try to learn it thoroughly when I get the chance (probably after uni or during a break).

You should definitely learn it. After coming from P4 and SVN it's like a breath of fresh air wrapped in diamonds inside of a TARDIS

Also, for those suggesting that he rewrite history, I'm sure you're all aware that this is a bad thing when others have pulled that commit already.

Dren
Jan 5, 2001

Pillbug

Gazpacho posted:

What are you looking for with that last bit? Because people who have a poor grasp of programming language semantics can tell you about encountering code problems all day.

From asking them about a code problem they encountered I hope to figure out A) What they consider to be an interesting and non-trivial enough problem to bring up in response to that question during an interview and B) A hint as to where their interests lie. The question is meant to be innocent enough that they won't attempt to hide their enthusiasm for terrible crap. E.g. Maybe they would talk about how they wrote this incredible OO rock/box/color object model with fifteen interfaces. Or maybe they will talk about how they wrote a badass test automation system by following industry best practices. Who knows! Either way, you can ask follow up questions to try to ascertain if they really know their poo poo or if they were the guy sitting in the corner while everyone else did the work.

That operator= guy is awesome! Sort of reminds me of when I found a co-worker's copypasta implementation of std::vector.

Jewel
May 2, 2009

Volmarias posted:

You should definitely learn it. After coming from P4 and SVN it's like a breath of fresh air wrapped in diamonds inside of a TARDIS

Also, for those suggesting that he rewrite history, I'm sure you're all aware that this is a bad thing when others have pulled that commit already.

Any good resources to learn it easily with no prior knowledge in anything of the sort? I know what a commit, a checkout, and a branch is. That's about it. I usually only use the bare minimum when it comes to SVN/Perforce, and I do it all visually, so going to a command line interface like GIT is daunting.

Also, using Windows 7, if that means anything.

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed

Carthag posted:

Isn't it a bad idea to force push when you've changed the history? I mean I force push all the time but that's cause nobody ever pulls from my repos so I don't care. Though I do try to hold off pushing until I'm at least partially sure that I won't have to rebase or amend anything.
If you notice like 30 seconds later it's probably not going to be an issue (and if there's enough people pulling that it is then you should probably have more process involved in getting commits to the main branch). Dealing with the very occasional force push from other people after you pulled is also not that big of a deal.

Don't force push public branches is generally a good rule of thumb, though.

Adbot
ADBOT LOVES YOU

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

Doctor w-rw-rw- posted:

Only because it's so disgustingly plausible, am I right?

Anytime I encounter code along those lines I shake my fist at the sky.

I don't encounter other people's code that often as I usually work by myself, but the frequency with which I do encounter such a mess makes me wonder how any of you working in teams can handle it.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply