How others do it. page 3

65 posts

Flag Post

Senekis93 you would be surprised what kind of tests or even simple questions you would get in top companies, especially Google ;)

alecz127 sounds cool, kind of demoscene-ish

 
Flag Post
Originally posted by sHTiF:

Senekis93 you would be surprised what kind of tests or even simple questions you would get in top companies, especially Google ;)

alecz127 sounds cool, kind of demoscene-ish

I’ve taken one such test.
Wasn’t anything super fancy on it, although there was one question along the lines of…

function B(b) {
    b += 5;
}

function main() {
    var a = 3;
    var b = 6;
    B(b);
    a = a + b;
    trace(a + "," + b);
}

What is the output of the trace?

There was more to it, but it was something like that.

The only reason I remember it was agonizing over the value of b due to an issue I’d come across previously where an integer had passed by reference in flash, for an unknown reason. So I was conflicted over knowing that the specification is pass by value (and local scope), but having experienced a pass by reference, and my bug was solved by simply using a different variable name inside the called function.

 
Flag Post

I’d say nothing would be outputted because main is never called.

 
Flag Post

If main was in fact called-
the output would be “9,6” because B(b) does not do anything because b is defined in the main, it is not a global variable. rendering B(b) moot :)

 
Flag Post

It should be noted that main is called.

But yes, it should be “9,6.”

I was just saying that I once encountered an issue where it was not “9,6” but in fact “9,11”. (unintentional, that)

Or more specifically, I had a loop that should run twice

i.e. for(var s = 2; s > 0; s--) {} that called a function inside it, that also had a variable named s that when the function finished, that s was 0. And somehow caused a premature exit of the loop.

 
Flag Post
Originally posted by Draco18s:

I was just saying that I once encountered an issue where it was not “9,6” but in fact “9,11”.

Mother of god.
Draco do you realize your IDE was compromised by terrorists?

 
Flag Post
Originally posted by alecz127:
Originally posted by Draco18s:

I was just saying that I once encountered an issue where it was not “9,6” but in fact “9,11”.

Mother of god.
Draco do you realize your IDE was compromised by terrorists?

Example numbers used as an example.

(Giant smiley is not big enough)

 
Flag Post
Originally posted by alecz127:

How about we cover some fun procedurally generated graphics related stuff.
I’ve watched the contests, and they’re pretty awesome. Like that vampire city Sen did.
E: Found it.
That vampire city is so sweet. x o

Thanks, too bad I never finished it; I didn’t even log in to Kong for about two months or something and I totally forgot about the contest.
Why noone took it over and made a voting thread or something? :\

Anyway, here’s the preview; click to generate. And you can see how building are generated here. (Warning: horrible var names ahead).

I feel like something like that would be too much for the thread; remember that the point is that they should be simple problems, like the fizzbuzz thing. If you can come with a particular, simple problem about procedurally generation, it could work.

Originally posted by sHTiF:

Senekis you would be surprised what kind of tests or even simple questions you would get in top companies, especially Google ;)

I’ve read about that interview thing designed by Microsoft, filled with nonsense questions and stuff. Personally, I feel it’d be better to give a laptop to the candidate and give him/her a list of tasks; interviews can be missleading, just as hiring someone just because he/she has N years of experience in S subject or because he has X or Y degrees.

Originally posted by Dev Luchador:

One of my QA hires at a startup showed up in my office after one of our morning meetings. I’d been asking the team to scour their network of contacts for someone who could build us a scripting language for our product. He wanted the job. After barely suppressing a desire to laugh in his face, my inner dialog said, “What harm could it cause?”, and I gave it to him with the proviso that we would keep looking to hire and when the new guy came on, this QA guy would apprentice with him to learn programming. We never got the chance to hire the new guy because this “QA guy” got what I had budgeted as a 6-8 week project all built, and built extremely well, in about 30 days.


Also, suggest themes, people! d:

 
Flag Post

Topic:

Sorting a collection of objects based on distance from a known point.

1) Assume that a point p is constant (i.e. does not change during code execution)
2) Assume that the array of objects objectArray contains objects with an x and y property
3) Assume you have an O(1) sort function available to operate on any list or array type passed

The goal of the exercise is not to optimize the sort itself, but rather to see how you lay out the structure prior to sorting.

 
Flag Post

Sounds good. If noone suggests anything else by the time I login tomorrow, we’ll go with that. If there are more suggestions, please make sure to mention which one you’d like, or we’ll go with random(suggestion) from the available ones.

 
Flag Post

I’ve got a few ideas:
1. Boids that follow each other.
2. Boids that constantly try to get to the center of the group.
3. Coolest procedurally generated effect you can come up with.
E: Last one would be NO external graphics.

 
Flag Post
Originally posted by RTL_Shadow:

I’ve got a few ideas:
1. Boids that follow each other.
2. Boids that constantly try to get to the center of the group.
3. Coolest procedurally generated effect you can come up with.
E: Last one would be NO external graphics.

Eh, these exercises should have a defined goal, where everyone’s output (should) be identical. That way the code can be compared side-by-side to see how someone else did the same thing.

 
Flag Post
Originally posted by Draco18s:
Originally posted by RTL_Shadow:

I’ve got a few ideas:
1. Boids that follow each other.
2. Boids that constantly try to get to the center of the group.
3. Coolest procedurally generated effect you can come up with.
E: Last one would be NO external graphics.

Eh, these exercises should have a defined goal, where everyone’s output (should) be identical. That way the code can be compared side-by-side to see how someone else did the same thing.

Then the first two are still kind of relevant.

 
Flag Post

Yeah, if you come with suggestions, please be specific and explain the whole problem, as Draco did.

The instructions should be concise. It should be clear to everyone what’s the initial setup and what’s the goal/problem.

 
Flag Post

I was thinking there’s no need to vote or set deadlines for this.
If anybody wants to start a How to do it thread, just add that to the title (or post the problem here and I’ll make the thread when I see it).

You can use this as a template.