• Lucid Dreaming - Dream Views




    Page 1 of 2 1 2 LastLast
    Results 1 to 25 of 26
    1. #1
      Banned
      Join Date
      Apr 2007
      Location
      Out Chasing Rabbits
      Posts
      15,193
      Likes
      935

      Anyone taken a C test for a job before?

      I got a test in C from Cryptic Studios and it's timed so I can't look at it and then go brush up. Anyone know what kind of stuff would be on it? I would consider myself proficient with C, but I would like to know what kind of stuff would be on it.

    2. #2
      dsr
      dsr is offline
      我是老外,可是我會說一點中文。
      Join Date
      Nov 2006
      Gender
      Location
      my mind
      Posts
      374
      Likes
      1
      I've never applied for a programming job, so I can't help you with what might be on the test. But good luck on getting the job. Game development should be fun.

    3. #3
      Member Achievements:
      1 year registered Veteran First Class 5000 Hall Points

      Join Date
      Sep 2004
      Gender
      Location
      Seattle, WA
      Posts
      2,503
      Likes
      217
      C or C++? I know you said C, but they're a MMO game studio, not a low-level driver company

      I took a C++ test when interviewing at Sybase. Very similar to the kinds of stuff you have in university (so, not too difficult). Know your OO, and know your memory management. File i/o is useful to know without having to look it up.

      This was years ago, so all I can remember was they had this one question that asked, "what does this class do?" and it was some weird recursive linked list thing.

      I think mostly, they just want to see that you can code, and that you're not a total waste of their time. It really helps to narrow things down and prevent the interviewers from wasting time on duds.

      I kid you not. When I do phone screens, I always ask a really dumb coding question (most of the time, it's "reverse a string"), and you'd be amazed at how many candidates are all talk.

      I can't speak for cryptic studios, but they're not out to trick you with trick questions. Most candidates are too daft to answer easy, straight-forward questions, so there's almost no need for it at the starting stages. good luck!

    4. #4
      Banned
      Join Date
      Apr 2007
      Location
      Out Chasing Rabbits
      Posts
      15,193
      Likes
      935
      Oh good. Yes, I'm certain that they said C, not C++.

      My specialty is low level stuff like memory management. I should refresh myself on i/o streams, I never used them much so I always looked up parameters for those functions.

    5. #5
      Member Achievements:
      1 year registered Veteran First Class 5000 Hall Points

      Join Date
      Sep 2004
      Gender
      Location
      Seattle, WA
      Posts
      2,503
      Likes
      217
      Ah I see. Then i/o streams and the likes are probably very important, because I'll probably put you into the network layer somewhere hehe. Marshalling/unmarshalling, etc.

      But really, don't worry about it. Do you know what position you're going for? Like, what department?

    6. #6
      Banned
      Join Date
      Apr 2007
      Location
      Out Chasing Rabbits
      Posts
      15,193
      Likes
      935
      General programmer for a gaming company. I hope that they don't ask about networking, I have no knowledge of that at all. *gets scared* Well I'm off to do it and I've got my trusty C in a Nutshell book.

    7. #7
      !DIREKTOR! Adam's Avatar
      Join Date
      Jan 2007
      Gender
      Location
      Aquanina's closet
      Posts
      5,194
      Likes
      34
      Good luck mate, let us know how you get on

    8. #8
      Banned
      Join Date
      Apr 2007
      Location
      Out Chasing Rabbits
      Posts
      15,193
      Likes
      935
      I didn't do good, I couldn't figure out how to do one of the questions.

      Can you tell me how to do this so that I don't go nuts:
      Code:
      Given a string of 10 characters and a number, insert multiplies and
      additions to make the characters equal the number
      
      ie
      
      1232537859, 995  -> 123*2+35*7+8*58
      Last edited by ninja9578; 06-22-2008 at 11:08 PM.

    9. #9
      FBI agent Ynot's Avatar
      Join Date
      Oct 2005
      Gender
      Location
      Southend, Essex
      Posts
      4,337
      Likes
      14
      christ,
      they expected you to come up with code to do that?
      in a timed exam?

      my first thought,

      target = 995;
      test = 1232537859;

      if test is too high,
      split in half and multiply two halves

      12325*37859

      if still too high, try addition instead

      12325+37859

      if still too high, split largest half, and multiply

      12325*378*59

      if still too high, pick largest multiple (12325*378) and try addition

      etc, etc.
      testing value, if too high picking the largest section and altering the operator
      once all altered and still too high, split largest number and go again
      if you get too low, backtrack one step and split smallest section instead

      I don't know,
      there's bound to be a way to do that nice & concisely
      but it's certainly not obvious, and I wouldn't want to be timed to try to figure out a way of achieving it
      Last edited by Ynot; 06-23-2008 at 12:32 AM.

    10. #10
      Banned
      Join Date
      Apr 2007
      Location
      Out Chasing Rabbits
      Posts
      15,193
      Likes
      935
      That's kind of how I wanted to do it too, but backtracking was impossible without recursion and I didn't think the rest of it would work recursively. The other problem was a puzzle solver, I didn't get to it, but I knew how to do it.

      I thought that question was a little too hard, I spent four hours on it.

      Anyone else think they know how to do it?

    11. #11
      FBI agent Ynot's Avatar
      Join Date
      Oct 2005
      Gender
      Location
      Southend, Essex
      Posts
      4,337
      Likes
      14
      the only other way I can think of right now, is the brute force approach

      start with all addition
      1+2+3+2+5+3+7+8+5+9
      change one addition at a time into a multiple
      1*2+3+2+5+3+7+8+5+9
      1+2*3+2+5+3+7+8+5+9
      ......
      1*2*3*2*5*3*7*8*5*9

      then, combine first 2 digits and go again
      12+3+2+5+3+7+8+5+9
      ......
      12*3*2*5*3*7*8*5*9

      then next two
      1+23+2+5+3+7+8+5+9
      ......
      1*23*2*5*3*7*8*5*9

      then combining 2 sets of 2 digits
      then 3 sets of two
      yadda yadda
      then combining one set of three digits
      etc. etc.

      slowly working your way up
      it'd take forever to complete
      but you'd hit every possible combination
      Last edited by Ynot; 06-23-2008 at 01:07 AM.

    12. #12
      Banned
      Join Date
      Apr 2007
      Location
      Out Chasing Rabbits
      Posts
      15,193
      Likes
      935
      I tried to do a brute force approach at first, but I couldn't figure out how to code it. I tried it with for loops, then recursively, then with while loops

      I had to write a string solver too, but I just realized that I forgot to do preserve order precedence

    13. #13
      Member Achievements:
      1 year registered Veteran First Class 5000 Hall Points

      Join Date
      Sep 2004
      Gender
      Location
      Seattle, WA
      Posts
      2,503
      Likes
      217
      Four hours? How long was this test?!? Definitely not what I would have thought. Sorry if I led you into thinking it would be easy. That's pretty insane for a test, but I would expect most everyone to mess up on that level. If you did alright for the others, you stand a chance (and you probably should have gone right to the next question if you knew how to do it - no need to spend 4 hours on one when you can do the next in half an hour).

      For this one, I'd probably just go brute force and move on, and update it if I had the time.

      The brute force solution space is not that huge... You have 10 characters, and the 9 spaces between them can either be a +, a * or nothing (i.e. they're connected as part of the same number). That means the full solution space has a size of 3^9 = 19683. Come to think of it, that's pretty tiny, if you don't think of it in terms of something that has to execute within the ticks of a game. That way, for brute force, you can separate the problem into "solution generator" and "solution tester" (which evaluates the expression). That second part is arguably harder to implement on the fly.

      You can also do some MAJOR pruning by cutting off any search where the result exceeds the number requested, which is also pretty easy to build into your algorithm. It really is the "evaluation" part that you have to be careful of.

      All that being said, my writing about it in a laid back environment doesn't compare to the high-stress environment you were in, and if they gave you 6 hours or so for the test, then I assume you were already pretty fried when you got to it. Let us know if they call you back!

    14. #14
      Banned
      Join Date
      Apr 2007
      Location
      Out Chasing Rabbits
      Posts
      15,193
      Likes
      935
      3^9? Not quiet, it's a little bit more complicated than that. 3^9 tells you how many combinations of +'s, *'s, and nothings there are, but order also matters so for each of those 19,683 combinations, you have to do a permutation of all nine values. P(9, 9) = 9! = 36,2880 so, in fact, there are 7,142,567,040 solutions. That isn't easy, even for a computer. I couldn't figure out how to do the permutations anyway.

    15. #15
      adversary RedfishBluefish's Avatar
      Join Date
      Apr 2007
      Location
      Now
      Posts
      495
      Likes
      4
      Order? But all the numerals are in fixed positions...

    16. #16
      Banned
      Join Date
      Apr 2007
      Location
      Out Chasing Rabbits
      Posts
      15,193
      Likes
      935
      The operations order, the number's positions are fixed like you said. There were nine operators.

    17. #17
      Member Achievements:
      1 year registered Veteran First Class 5000 Hall Points

      Join Date
      Sep 2004
      Gender
      Location
      Seattle, WA
      Posts
      2,503
      Likes
      217
      Quote Originally Posted by ninja9578 View Post
      The operations order, the number's positions are fixed like you said. There were nine operators.
      Not really... 3^9 = every possible combination. Permutations are meaningless. "a + b + c" is the same thing as "a + b + c"

    18. #18
      Banned
      Join Date
      Apr 2007
      Location
      Out Chasing Rabbits
      Posts
      15,193
      Likes
      935
      True, but a + b * c isn't the same as a * b + c. There are lots of repeats as in the example above, but it's still a permutation.

    19. #19
      !DIREKTOR! Adam's Avatar
      Join Date
      Jan 2007
      Gender
      Location
      Aquanina's closet
      Posts
      5,194
      Likes
      34
      LOUD NOISES!


    20. #20
      Forest Monkey Semja's Avatar
      Join Date
      Jun 2008
      Posts
      75
      Likes
      3
      123+2+5+3*7+8+59 = 998

      I failed.

      I tried working backwards...until I had a lower number to work with, and then forwards... see below if you can make sense of it

      1 2 3 2 5 3 7 8 5 9 995

      995-9 = 986
      986/5 = 197.2

      995-(5+9)=981
      981/8 = 122.6

      995-(8+5+9)=973
      973/7 = 139

      1 2 3 2 5 3 139

      123+2+5+3*7+8+59 = 998
      Last edited by Semja; 06-24-2008 at 07:11 PM.

      Nintendo to Release Densha de Grope Train Molestation Simulator for Wii

    21. #21
      adversary RedfishBluefish's Avatar
      Join Date
      Apr 2007
      Location
      Now
      Posts
      495
      Likes
      4
      Quote Originally Posted by ninja9578 View Post
      True, but a + b * c isn't the same as a * b + c. There are lots of repeats as in the example above, but it's still a permutation.
      Isn't that covered by 3^9?
      If each permutation is seen as a number in base three, a+b*c could be '12' while a*b+c would be '21', and abc would be 00. The number of permutations is then the largest number representable, ie. 3^9 - for 9 base-three digits.

    22. #22
      Member Identity X's Avatar
      Join Date
      Mar 2004
      Gender
      Posts
      1,529
      Likes
      7
      Lord almighty, that's a hard one. I was recently interviewed for a .NET programmer (something I know little off) and there was a 1/2 hour exam with questions on programming ("What is polymorphism?") SQL ("What is a subquery?") and web design ("What is CSS and what is it used for?"). Was pretty easy but I got some questions wrong.

      Then in the interview they asked a series of "problem solving" questions, one of which was "How would you write a system that had a web interface and could sychronously communicate between two servers". That lost me, but I made up something.

      Anyhow I got the job, so . Think of it this way: if they're cruel enough to set that as a question, would you like to work for them?

    23. #23
      Banned
      Join Date
      Apr 2007
      Location
      Out Chasing Rabbits
      Posts
      15,193
      Likes
      935
      Quote Originally Posted by Identity X View Post
      ("What is polymorphism?") SQL ("What is a subquery?") and web design ("What is CSS and what is it used for?").
      Oh, oh, I know all those! Why couldn't they give me questions like that?

    24. #24
      Divine Moments of Truth Lunica's Avatar
      Join Date
      May 2008
      Gender
      Location
      Canada/England
      Posts
      283
      Likes
      2
      If you want help on this subject message me and Ill give you my mates msn.

      He kinda knows everything about it.

      In very many cases, the visionary quality, the quality of the vision so to say, spills over, into the external world, so that the experiencer, when he opens his eyes, sees the outer world transfigured...

    25. #25
      Member Achievements:
      1 year registered Veteran First Class 5000 Hall Points

      Join Date
      Sep 2004
      Gender
      Location
      Seattle, WA
      Posts
      2,503
      Likes
      217
      Quote Originally Posted by ninja9578 View Post
      True, but a + b * c isn't the same as a * b + c. There are lots of repeats as in the example above, but it's still a permutation.
      It's covered by the 3^9

      Here, let's pick a simpler example with just 3 characters. Exhaustively, the possibilities are:

      1) abc
      2) a+bc
      3) a*bc
      4) ab+c
      5) ab*c
      6) a+b+c
      7) a*b+c
      8) a+b*c
      9) a*b*c

      ... = 3^2 = 9 possbilities.

      Your permutation argument would stipulate that in this case, there are 18 possibilities, which is not true.

    Page 1 of 2 1 2 LastLast

    Bookmarks

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •