ephemeral garbage
Member
(04-05-2011, 07:26 PM)

ephemeral garbage's Avatar
#251

have you tried using the performance tools? maybe you're allocating a lot of ephemeral garbage in a tight loop or similar?
Ecrofirt
Member
(04-05-2011, 07:43 PM)
#252

Originally Posted by Not A Fur:
have you tried using the performance tools? maybe you're allocating a lot of ephemeral garbage in a tight loop or similar?
I'm looking into them now, but I'm not exactly sure how they work.

I do know this:
I initialize all of my stuff once (and only once). from there, I reference it when I'm updating or drawing the game.
Half and half
Member
(04-05-2011, 07:50 PM)

Half and half's Avatar
#253

Originally Posted by iapetus:
...
Instead, give them a simple task to implement. Fizzbuzz is fine. Implementing equals() in Java is fine. If they don't know what they're supposed to be doing, tell them the spec.

Then make them justify their implementation. Tell them it's not efficient enough. Add extra constraints on it.

For example, most people will use % (or the equivalent in the local currency) to implement Fizzbuzz.

Code:
for (int i = 1; i <= 100; i++) {
  if (i % 15 == 0) {
    System.out.println("Fizzbuzz");
  } else if (i % 5 == 0) {
    System.out.println("Buzz");
  } else if (i % 3 == 0) {
    System.out.println("Fizz");
  } else {
    System.out.println(i);
  }
}
Tell them the three % checks are too inefficient for your high-speed Fizzbuzz app on low-powered devices, and that they have to implement it more efficiently.
Quoted for emphasis. I think that is a great way to conduct an interview. Give them a fairly easy problem that they won't spend forever on and then get them to optimize it. I often encounter similar issues at work.

I'm not a big fan of tricky questions (ex. Swap two integers in C++ w/o using an if statement, etc).
Ourobolus
Member
(04-05-2011, 07:50 PM)

Ourobolus's Avatar
#254

Reading this thread made me realize that despite my CS degree I'm glad I went towards the management side of things rather than the down-and-dirty technical side.

That said, I'm glad that I went through that education, because there have been several times where I've had an enormous, monotonous task to fulfill, and writing a program made it infinitely easier to tackle.

Recent example: I had 3,600 network configuration files that I needed to parse from one enormous text file into individual files. 90% of the files followed the same format, but the others were ones and twos that someone didn't configure properly. I figured writing a parser was the best way to solve the problem. Problem is the only available language I had was Python (government computer, didn't have rights to install others), which I'd never used before. My background was mostly C++ and Perl, so luckily a lot of the basic principles were applicable. Managed to figure it out in a few days after figuring out the language.
Zoe
(04-05-2011, 07:51 PM)

Zoe's Avatar
#255

I have to say, I'm so glad to see that there aren't any QA rants here yet. I'm currently working on some stuff from an offsite office. These guys don't have any sense of following the dev-QA cycle, and of course they're not maintaining any change lists (at least that I'm privy to).

I'm about to unleash a boatload of defects... don't know if they'll ever be addressed...
Drkirby
Corporate Apologist
(04-05-2011, 07:51 PM)

Drkirby's Avatar
#256

I sadly can't think of a way to make that fizzbuzz better :/
-COOLIO-
The Everyman
(04-05-2011, 07:51 PM)

-COOLIO-'s Avatar
#257

ML is being a little bitch right now
diddles
Banned
(04-05-2011, 07:52 PM)
#258

I've been in aggressive interviews where the guy was asking questions about stuff he wasn't even really comfortable with (physics math, advanced 3d rendering techniques, stuff he obviously just read up on to formulate a challenging question) and i turned the tables by answering and then asking him more questions about the subject that he implied he would be able to answer by asking me the question in the first place. pretty funny to turn the tables and have the interviewer turn into a stuttering sweaty nervous mess. One of those interviews ended up in me not getting the job :)

Originally Posted by Drkirby:
I sadly can't think of a way to make that fizzbuzz better :/
you could just loop individual counters for each special print, like if (++i2 == 5) { i2 = 0 and print whatever } instead of doing modulus's on a single counter. much faster on most hardware.

or you could make a precalculated global lookup table of 100 funtion pointers for each iteration and jump to the right one for each index assuming you have function pointer support in your lingo :p
Last edited by diddles; 04-05-2011 at 07:57 PM.
Drkirby
Corporate Apologist
(04-05-2011, 07:53 PM)

Drkirby's Avatar
#259

Originally Posted by Ecrofirt:
Rant:

The goddamn XNA game I'm working on is pissing me off. I'm getting terrible framerates and I can't explain why at all.

Hell, I've only got a total of 12 sprites on screen, and they're all using the same damn texture.

I've tried with both displaying them and not displaying them, and the framerate bounces around. God forbid I attempt to move them at all, or it consistently dips below 60fps.

What in the blue fuck!
I worked with XNA a tad, post your code or a link to it.
-COOLIO-
The Everyman
(04-05-2011, 07:59 PM)

-COOLIO-'s Avatar
#260

Error Line 20: go fuck yourself
ronito
got my tag in the OT
(04-05-2011, 08:01 PM)

ronito's Avatar
#261

Originally Posted by diddles:
I've been in aggressive interviews where the guy was asking questions about stuff he wasn't even really comfortable with (physics math, advanced 3d rendering techniques, stuff he obviously just read up on to formulate a challenging question) and i turned the tables by answering and then asking him more questions about the subject that he implied he would be able to answer by asking me the question in the first place. pretty funny to turn the tables and have the interviewer turn into a stuttering sweaty nervous mess. One of those interviews ended up in me not getting the job :)
Ha! Do this at your own peril.
I had a guy try to do this to me. And was like "You're just being all high and mighty because you have the answers in front of you."

I put down all the papers and said, "Very well. Ask me anything you want."

He proceeded to throw a bunch of questions at me that were all fairly simple. I answered all of those and then said, "Do you have any more questions for me? Because if not , your interview is over."

As to my interview style I always ask them what they feel they're really good at and start there. If they're really good at certain things they can learn the rest. If they think they're good and are crap or mediocre on that then they probably can't be taught. Also I almost never pose straight code questions. I always pose a problem and let them have at it.

As for my rant: I hate it when users think everything is a bug. For example: "Hey! This process ran on this record and wasn't supposed to! Fix it!"

"Can you prove that the flag for processing wasn't Y when the process ran? Because it's hard coded in there. I don't see how this is even possible. Also if it were ignoring the process flag it would've happened to every record and not this one."

"But I unchecked the flag!"

"Yes. Did you do that before or after the process ran?"

"Just fix it!!"
Steve Youngblood
Member
(04-05-2011, 08:04 PM)

Steve Youngblood's Avatar
#262

Originally Posted by Drkirby:
I sadly can't think of a way to make that fizzbuzz better :/
The one iapetus referenced? The "Fizzbuzz" check is unnecessary. Just don't do an elseif check. You output Fizz if it's divisible by 3, and buzz if it's divisible by 5. You don't need to check for divisibility by 15.
Half and half
Member
(04-05-2011, 08:05 PM)

Half and half's Avatar
#263

Originally Posted by diddles:
you could just loop individual counters for each special print, like if (++i2 == 5) { i2 = 0 and print whatever } instead of doing modulus's on a single counter. much faster on most hardware.

or you could make a precalculated global lookup table of 100 funtion pointers for each iteration and jump to the right one for each index assuming you have function pointer support in your lingo :p
A great opportunity to use those code comments that people are against!
Ecrofirt
Member
(04-05-2011, 08:07 PM)
#264

Originally Posted by Drkirby:
I worked with XNA a tad, post your code or a link to it.
That might prove a little difficult.

Things are in the preliminary stage right now, but it's already bigger tan just a one or two class program. I've got screens, wedges, balls, factories, etc.
Zoe
(04-05-2011, 08:07 PM)

Zoe's Avatar
#265

Originally Posted by Steve Youngblood:
The one iapetus referenced? The "Fizzbuzz" check is unnecessary. Just don't do an elseif check. You output Fizz if it's divisible by 3, and buzz if it's divisible by 5. You don't need to check for divisibility by 15.
How would you output the int when it's neither then without maintaining another variable?
Steve Youngblood
Member
(04-05-2011, 08:16 PM)

Steve Youngblood's Avatar
#266

Originally Posted by Zoe:
How would you output the int when it's neither then without maintaining another variable?
Was no other variable a requirement? If so, then this is what you get for skimming threads in a haphazard fashion. I was just trying to get rid of the third modulus check.
Zoe
(04-05-2011, 08:17 PM)

Zoe's Avatar
#267

Originally Posted by Steve Youngblood:
Was no other variable a requirement? If so, then this is what you get for skimming threads in a haphazard fashion. I was just trying to get rid of the third modulus check.
It's not a requirement, but it strikes me as more wasteful than the extra check.
ultron87
Member
(04-05-2011, 08:19 PM)

ultron87's Avatar
#268

Originally Posted by Zoe:
It's not a requirement, but it strikes me as more wasteful than the extra check.
Well if the reviewer says to consider modulo as the expensive operation than you can do it with just the two checks and a flag variable to tell whether to print the number.

I think I'd prefer to see someone do it the two check way since it suggests an understanding of how to use ifs instead of just following the question and setting up an if statement for each possibility it mentions.
Ecrofirt
Member
(04-05-2011, 08:24 PM)
#269

Originally Posted by Drkirby:
I worked with XNA a tad, post your code or a link to it.
I tried to think of which bits of code would be most relevant, and I think that I can probably get away with just posting my GameScreen class.

Things to know:
* My Game class has a GameScreen object, and when the Game class calls Update() and Draw(), they subsequently call the Update() and Draw() functions for the GameScreen object.
* Ring is a class
* Wedge is a class
*rings.Wedges is a list of wedges

Here's the main code. As you can see, the rings list is populated once, and is just referred to after that:

I should point out that my code seems to run like shit whether or not anything is drawn to the screen. It'll bounce between 60 and 45FPS consistently. This even happens if I set the Draw() code to immediately return, which has led me down the path of thinking that there's a culprit in my Update() function.

Update: If I tell my Update() function to return immediately, the FPS jumps to between 58 and 60FPS, so I know the issue is there.
I'll add in my Ring class code after this, which has got to be the main issue somehow.

Here's my GameScreen class
http://pastebin.com/b7XpQ3kt

Here's my Ring class
http://pastebin.com/WrQTzMLk
Last edited by Ecrofirt; 04-05-2011 at 09:29 PM.
Mister Zimbu
Member
(04-05-2011, 08:36 PM)

Mister Zimbu's Avatar
#270

Code:
void FizzBuzz(int START, int END) {
    Debug.Assert(START>0); Debug.Assert(END>START);

    string[] fb = new string[15];
    for( int i = 0; i < fb.Length; i++ )
       fb[i]=null;

    fb[2] = fb[5] = fb[8] = fb[11] = "fizz";
    fb[4] = fb[9] = "buzz";
    fb[14] = "fizzbuzz";

    for( int i = START, j = (i-1)%15; i <= END; i++, j++ ) {
        if (j==15) j = 0;
        Console.WriteLine(fb[j] ?? i.ToString());
    }
}
Better or worse? I used to be better at these things, I swear.

5 years of ASP3.0/ASP.NET development has made me lazy and stupid. Haven't actually had to optimize anything other than SQL queries in god knows how long.
Last edited by Mister Zimbu; 04-05-2011 at 08:40 PM.
jman2050
Member
(04-05-2011, 08:39 PM)

jman2050's Avatar
#271

Originally Posted by Zoe:
It's not a requirement, but it strikes me as more wasteful than the extra check.
I'm not the most well-versed in processor cycle counts but I figure for most languages on most platforms (assuming you aren't doing something silly like redeclaring the flag variable on every iteration of the loop) one extra modulo operation would definitely be more expensive than writing to a register twice and checking against it.
KiKaL
Member
(04-05-2011, 08:43 PM)

KiKaL's Avatar
#272

I was watching a presentation yesterday and a guy said "Looking at old code is like going back in time...to when I sucked at coding"

So true. I am 2 years out of school now and when I look at my code originally to now it's incredible. I hate working on any of my old projects.
AbortedWalrusFetus
Member
(04-05-2011, 09:18 PM)

AbortedWalrusFetus's Avatar
#273

Originally Posted by nickcv:
i just finished speaking about the last guy of the day (tomorrow i'll have two more)

and i really didn't like his attitude.

he clearly knows what he is doing but he did some rookie mistakes.

- he talked trash about his last boss.
- he started fizzbuzz test but then didn't want to complete it saying "you can fill the rest of it"


he was doing it right, but i don't think i want to work with someone so arrogant.
I never liked this. If you disqualify someone for this you are bad at interviewing, ESPECIALLY if you asked why they are seeking a new position/why they are leaving their current employer. It's an awesome opportunity to find out valuable information about a prospective employee. If someone just starts talking poorly about an old employer and has no justifications for it then you know something of their work ethic. If someone talks poorly about a previous boss and has great justifications for it, what they say makes sense and even you can see why the previous conditions are wrong, you then know that they are someone who is going to be paying attention and helping to get out of bad situations.

For example, I was considering leaving my current place of employment almost solely because of a managers decisions. The guy was fantastic. He was really bright, an incredible coder, and a really hard worker. He just had absolutely no business sense whatsoever. We were tasked with a full re-architecture of our system, and he decided that we should do it all web based. That was great. I was happy. It was good experience doing web-based development, great experience working with SOA architecture, etc. The problem was that four months later he informed us that our clients could only support IE 6, and the technology and intensity of what we were trying to accomplish couldn't be achieved with that browser, so we had to start over using a Swing client. Four months work down the drain. Sure, there was some back end work that was fine (all of the services) but we had written tons of Spring controllers and jsp etc that were essentially thrown away. All because he didn't ask our business client if they could support a modern browser. Of our year of development time four months of it were flushed, and we still had to push the product out by the original deadline.

Now, I was assigned to client side development for this, so I wasn't really aware of the massive issues that were present on the server side development. His plan was to write an intermediary SQL language that would allow us to use the same queries for each different database implementation (even though our clients exclusively used SQL Server). The idea was that they would be able to create domain objects and query them across databases and database implementations. It was sort of like writing our own implementation of data warehousing and data cube software, except instead of storing it in a central data warehouse, which would have been the intelligent thing to do, we'd simply query the 10, 20, 30 who knows however many servers for every request (that should be throwing up huge red flags for performance in and of itself). Not only was there absolutely no focus on just making it so that it supported the type of data objects our client needed (he wanted to be able to expand the business to other clients) but in general there was no focus on one domain. It was like the Sports Car/Mini-van/Truck that Alan Cooper wrote about in "The Inmates are Running the Asylum".

So our small team of four started out on this adventure. I was writing all of the client side code, one of us was writing server side services, one of use was writing the entire data integration system, and the boss was writing the intermediary SQL querying language. About five months in the guy writing the data integration stuff started making a huge fuss about things and complaining that it wouldn't work. I was busy trying to meet my own deadlines so I didn't have the time to jump in the code there and see what was up. About four or five more months into this my boss came to all of us (I think it was right after thanksgiving) and said he was leaving for another company. It was obvious to us at this point that this project was a shit show and we had essentially wasted almost a full year of R&D on a project that was destined for a garbage can, and the boss jumped ship. At about this point I started poking around in the server side code to see what the problem was and I could immediately see that the project was no feasible for a team our size, and probably should never have been attempted anyway. I was sitting on two years experience and this was obvious to me. But they were business decisions. I then realized that while what he wanted us to do was pretty groundbreaking and intriguing from a technical perspective, the technical side and the business side never matched up. It was that inability to sync the technical and the business side together that essentially led to the downfall of the project, and it's the reason I was searching for a new job.

Now, to me if someone told me that story it would tell me that they had a good head on their shoulders, that they understood the importance of matching the goals with what the business end of things require, and a whole slew of different things about them as a candidate for hire. If you simply discount them as a candidate for saying "My last boss had no idea what he was doing" and don't try to get some sound reasoning out of them you're probably doing yourself a disservice.
Complex Shadow
Cudi Lame™
(04-05-2011, 09:22 PM)

Complex Shadow's Avatar
#274

Ecrofirt, might wanna use something like paste bin next time.
Ecrofirt
Member
(04-05-2011, 09:24 PM)
#275

Originally Posted by shadowcomplex:
Ecrofirt, might wanna use something like paste bin next time.
I'll convert it over now.
Kalnos
Member
(04-05-2011, 09:24 PM)
#276

Originally Posted by AbortedWalrusFetus:
I never liked this. If you disqualify someone for this you are bad at interviewing, ESPECIALLY if you asked why they are seeking a new position/why they are leaving their current employer.
If they say: "I chose to stop working at company 'x' because.... good reason" then yeah, that's no problem assuming the interviewer asked.

However,

If they say: "My boss couldn't code his way out of a box, his company was worthless hurr" then that probably isn't going to land you a job.

He said "trash talked" so I'm assuming something more like the second.
Drkirby
Corporate Apologist
(04-05-2011, 09:30 PM)

Drkirby's Avatar
#277

Originally Posted by ultron87:
Well if the reviewer says to consider modulo as the expensive operation than you can do it with just the two checks and a flag variable to tell whether to print the number.

I think I'd prefer to see someone do it the two check way since it suggests an understanding of how to use ifs instead of just following the question and setting up an if statement for each possibility it mentions.
But anyone who has taken an architecture class knows that reading from memory is slower then just about any mathematical operation. Modulo is a built in function in CPUs that can be done in one clock cycle.
jman2050
Member
(04-05-2011, 09:33 PM)

jman2050's Avatar
#278

Originally Posted by Drkirby:
But anyone who has taken an architecture class knows that reading from memory is slower then just about any mathematical operation. Modulo is a built in function in CPUs that can be done in one clock cycle.
Why wouldn't the compiler use a register in that situation?
Steve Youngblood
Member
(04-05-2011, 09:40 PM)

Steve Youngblood's Avatar
#279

Originally Posted by Kalnos:
If they say: "I chose to stop working at company 'x' because.... good reason" then yeah, that's no problem assuming the interviewer asked.

However,

If they say: "My boss couldn't code his way out of a box, his company was worthless hurr" then that probably isn't going to land you a job.

He said "trash talked" so I'm assuming something more like the second.
Also, I think there's a tendency to respect the chain of command. Whether one is absolutely painting the 100% truth with their tale of managerial incompetence, to the interviewer, it still may appear that this individual is an arrogant, young hotshot who doesn't respect authority. Whether justified or not, most people don't like newbies coming in preaching "better" practices, and I might -- perhaps erroneously -- suspect that this individual was such a person.
Zoe
(04-05-2011, 09:42 PM)

Zoe's Avatar
#280

Originally Posted by ultron87:
Well if the reviewer says to consider modulo as the expensive operation than you can do it with just the two checks and a flag variable to tell whether to print the number.

I think I'd prefer to see someone do it the two check way since it suggests an understanding of how to use ifs instead of just following the question and setting up an if statement for each possibility it mentions.
Well this was gonna be my answer before the talk of optimization came up:

Code:
for (int i = 1; i < 101; ++i) {
	String result = "";
	if !(i % 3)
		result += "Fizz";
	if !(i % 5)
		result += "Buzz";
	if !(result.size())
		result += i;		// yeah, I know this part doesn't work
	System.Out.println(result);
	}
Drkirby
Corporate Apologist
(04-05-2011, 09:44 PM)

Drkirby's Avatar
#281

Originally Posted by jman2050:
Why wouldn't the compiler use a register in that situation?
Even then, you would have to first do a store of the value, then a load. You would be right back where you started.


Here is a quick way to do it using a truth value though.
Code:
for (int i = 0; i <= 100; i++)
{
bool FizzBuzz = false;
if (i % 3 == 0) { cout << fizz; FizzBuzz = true;}
if (i % 5 == 0) { cout << buzz; FizzBuzz = true;}
if (!FizzBuzz) cout << i;
cout << endl;
}
Last edited by Drkirby; 04-05-2011 at 09:52 PM.
jman2050
Member
(04-05-2011, 09:50 PM)

jman2050's Avatar
#282

Originally Posted by Drkirby:
Even then, you would have to first do a store of the value, then a load. You would be right back where you started.
But you'd have to do that anyway, since the result of the modulo operation has to be stored before it can be used in a comparison. At least that's how I understand it.
sonikokaruto
Posting on the wrong forum
(04-05-2011, 09:57 PM)

sonikokaruto's Avatar
#283

I design business applications on rpgile for the telcos. They fucking suck, and everything fucking sucks.

Lemme put it this way: someone wrote a program in java to call the rpg binaries so that they return a value ... For a login page done in active server pages.

Yes, that's for real.
ronito
got my tag in the OT
(04-05-2011, 10:08 PM)

ronito's Avatar
#284

Originally Posted by Steve Youngblood:
Also, I think there's a tendency to respect the chain of command. Whether one is absolutely painting the 100% truth with their tale of managerial incompetence, to the interviewer, it still may appear that this individual is an arrogant, young hotshot who doesn't respect authority. Whether justified or not, most people don't like newbies coming in preaching "better" practices, and I might -- perhaps erroneously -- suspect that this individual was such a person.
I like to ask "What was your last boss's biggest failure?"

That typically will tell you if they're arrogant or well thought out or whatever.

Then I ask what they'd do to mitigate it if they had the power.
Articate
Banned
(04-05-2011, 10:15 PM)
#285

The most hilarious thing I've come across so far, only being a IT student at the uni was second semester of my OOT class, when someone managed to send his answer to the current assignment to all-theclass@mail.address instead of just to the teacher. Of course I opened it to see how others were coding and how that looked. Just before I did this I was sort of wondering if my code was at all pretty.

I open his and I just wanted to puke. He really had no consistency and horrible comments.

It started with:
Code:
/* Hi here is my Oblig3 which has one small problem that is little confusing for me with null objec that makes my waiting list to function when
 * i call it again it shows some error and sometimes i get "NullPointerException which is about null object and little complicated with String object
 * i do hope you will help me with it please as usual write to me all the comments you would say (maybe you don like how i write in english or 
 * without easyIO :-) Joke!!!  ok Thank yo checking.
 * /*////////////////////////////////////////////////////////////////////////////////////////////////////////
I was so overwhelmed by its ugliness that when I went back to my assignment, I had a huge sigh of relief that I was doing it somewhat right. He promplty replied with a "SORRY, that was a mistake, please don't use my assignment!!"

Someone replied "don't worry. No one is gonna use it".
Drkirby
Corporate Apologist
(04-05-2011, 10:27 PM)

Drkirby's Avatar
#286

Originally Posted by jman2050:
But you'd have to do that anyway, since the result of the modulo operation has to be stored before it can be used in a comparison. At least that's how I understand it.
It depends on the CPU implementation.

Really, we are arguing over what could at best amount to one or two clock cycles. Overall both take about just as long. Is there some sort of Fizzbuzz solution that will uses even less commands?
Steve Youngblood
Member
(04-05-2011, 10:27 PM)

Steve Youngblood's Avatar
#287

The only example I can think of recently that was mind boggling was someone who, in trying to help with another issue, I noticed that he was duplicating data from a parent table into a child table. I.e. Parent has field "type_id," "type_name" and a bunch of other data. The child obviously needed the primary key from the parent, which he correctly added to the child table. However, I noticed that he also duplicated the "type_name" in the child table. I asked if there was some reason for this move that I wasn't seeing. His response? To be able to sort by the "type_name" when displaying. This person wasn't new.
Zoe
(04-05-2011, 10:35 PM)

Zoe's Avatar
#288

So at my company QA doesn't have access to the version control system, so we're dependent upon comments (if SQL) or release notes to figure out what's been changed.

This is what's in the files I'm looking at right now:

Code:
Ver x.x.4 - 7/2010
Ver x.x.3 - 6/2010
Ver x.x.2 - 5/2010
Ver x.x.1 - 4/2010
Ver x.x.2 - 1/2011
Ver x.x.3 - 2/2011
Really dude?
ephemeral garbage
Member
(04-05-2011, 10:39 PM)

ephemeral garbage's Avatar
#289

Zoe I would like to post a sincere and heartfelt apology to QA on the behalf of programmers.

The amount of shit you folks put up with from us is unreal. I currently owe my QA lead about 40 beers.

QA: "Hey, I just spent four hours verifying that all the bugs you claimed were fixed are in fact still present, and was wondering when you were going to get a chance to revisit them."
Me: "Oh. Uh. I forgot to tell you that I did all that work on a hotfix branch."
QA: (somehow, miraculously, refrains from killing me)
ronito
got my tag in the OT
(04-05-2011, 10:40 PM)

ronito's Avatar
#290

zoe, how do you keep from going ballistic?
Drkirby
Corporate Apologist
(04-05-2011, 10:57 PM)

Drkirby's Avatar
#291

Originally Posted by Zoe:
So at my company QA doesn't have access to the version control system, so we're dependent upon comments (if SQL) or release notes to figure out what's been changed.

This is what's in the files I'm looking at right now:

Code:
Ver x.x.4 - 7/2010
Ver x.x.3 - 6/2010
Ver x.x.2 - 5/2010
Ver x.x.1 - 4/2010
Ver x.x.2 - 1/2011
Ver x.x.3 - 2/2011
Really dude?
Clearly it means nothing changed.
jman2050
Member
(04-05-2011, 11:00 PM)

jman2050's Avatar
#292

Originally Posted by Drkirby:
It depends on the CPU implementation.

Really, we are arguing over what could at best amount to one or two clock cycles. Overall both take about just as long. Is there some sort of Fizzbuzz solution that will uses even less commands?
Yeah I should note that I'm just being pedantic for the sake of argument, nothing more.

I imagine there are some sneaky clever ways to do Fizzbuzz in less commands, though nothing really practical comes to mind.
nickcv
Member
(04-05-2011, 11:33 PM)

nickcv's Avatar
#293

Originally Posted by ronito:
I like to ask "What was your last boss's biggest failure?"

That typically will tell you if they're arrogant or well thought out or whatever.

Then I ask what they'd do to mitigate it if they had the power.
ronito are you available to make a job interview class? :P

how many times did you do it to master it that way?

anyhow the dude started talking trash about his boss all by himself, no one asked him about it.
ronito
got my tag in the OT
(04-05-2011, 11:41 PM)

ronito's Avatar
#294

Originally Posted by nickcv:
ronito are you available to make a job interview class? :P

how many times did you do it to master it that way?

anyhow the dude started talking trash about his boss all by himself, no one asked him about it.
I've done at least 1 interview per month for the past three years. When it's busy it's more like 1 every two weeks. So I've had plenty o' time to come up with stuff.
Last edited by ronito; 04-05-2011 at 11:46 PM.
poweld
Member
(04-05-2011, 11:51 PM)

poweld's Avatar
#295

Originally Posted by ronito:
I've done at least 1 interview per month for the past three years. When it's busy it's more like 1 every two weeks. So I've had plenty o' time to come up with stuff.
We should have a GAF programmer interviewing orgy.
Spoo
Member
(04-06-2011, 01:32 AM)
#296

I suppose if you're hiring for C or C++ programmers, the following could be a fun question to ask. I read about it in Joel Spolsky's book and recognized it immediately since I've had more hands on time with C++ than anything else:

Code:
#include <iostream>

using namespace std;

int main()
{
	char text1[] = "hello";
	char text2[] = "jimmy";
	
	cout << "Before: \n" << text1 << '\n' << text2 << endl;
	
	char* p = text1;
	char* q = text2;
	
	// asking why and how this line works!
	while (*q++ = *p++);
	
	cout << "\nAfter: \n" << text1 << '\n' << text2 << endl;
	
	cin.get();
	return 0;
}
I realize that copying like this is actually kind of archaic-looking, but you have to know your stuff to follow the logic of that one line :\
Zoe
(04-06-2011, 01:36 AM)

Zoe's Avatar
#297

Originally Posted by ronito:
zoe, how do you keep from going ballistic?
I ask myself that every day.
mugurumakensei
Member
(04-06-2011, 03:25 AM)

mugurumakensei's Avatar
#298

Originally Posted by Spoo:
I suppose if you're hiring for C or C++ programmers, the following could be a fun question to ask. I read about it in Joel Spolsky's book and recognized it immediately since I've had more hands on time with C++ than anything else:

I realize that copying like this is actually kind of archaic-looking, but you have to know your stuff to follow the logic of that one line :\
Code:
#include <iostream>

using namespace std;

int main()
{
	char text1[] = { 'h', 'e', 'l', 'l', 'o' };
	char text2[] = { 'j', 'i', 'm', 'm', 'y' };
	char text3[] = "hello";
        char text4[] = "jimminy";

	cout << "Before: \n" << text1 << '\n' << text2 << endl;
	cout << text3 << endl << text4 << endl;

	char* p = text3;
	char* q = text4;
	
	while (*p++ = *q++);
	
	cout << "\nAfter first loop: \n" << text1 << '\n' << text2 << endl;
	cout << text3 << endl << text4 << endl;
	
        p = text1;
        q = text2;
	
        while (*p++ = *q++);

        cout << "\nAfter second loop: \n" << text1 << '\n' << text2 << endl;
	cout << text3 << endl << text4 << endl;
	
        cin.get();
	
        return 0;
}
I think this is far more fascinating. It shows a lot of the pitfalls that developers unintentionally fall into when working with languages like C/C++.
DCharlie
Banned
(04-06-2011, 03:33 AM)

DCharlie's Avatar
#299

Quote:
If they say: "I chose to stop working at company 'x' because.... good reason" then yeah, that's no problem assuming the interviewer asked.

However,

If they say: "My boss couldn't code his way out of a box, his company was worthless hurr" then that probably isn't going to land you a job.
it's a question of professionalism and a little bit of BS Bingo. If you can't phrase the response around the yee olde standard "the direction the company was going was not in line with where i wanted my career to go" then... reggieshrug.gif. This even covers "The direction the company was going : firing people who stole from the cash till. My career path : taking cash from the till" ;)
Half and half
Member
(04-06-2011, 03:40 AM)

Half and half's Avatar
#300

This is something I've been dealing with a lot lately:

Given this struct in C++ (assume Win32 and no #pragma packing):

Quote:
struct randomStruct {
int a;
bool b;
short c;
__int64 d;
bool e;
};
What does sizeof( randomStruct ) return? And the follow-up, optimize the structure for size.