Using source code for an interview

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • Using source code for an interview

      I've been sent a programming problem as a preliminary step in an interview process with a game studio, and I've come across a snag where I need to balance a tree.

      I figured that the random number generator and pseudo-random traversal code found in the book would be great for balancing the tree by randomly inserting elements...

      Would it be okay to include this code in my solution, and if so, would I need to include any headers/redistribution READMEs, or at least a reference to the origin? I would be converting the code to C#, btw.

      Also, I am really enjoying the book!
      -Scott
    • RE: Using source code for an interview

      From what was stated in this thread you should have one of the large block comments found at the beginning of most of the source files. In addition if you modify it you should include the modify comment (found in the linked thread) as well. This is my understanding of it anyway.

      The post was edited 1 time, last by Trinak ().

    • The code is open source as long as you're not trying to pass it off as your own work or trying to make a profit. Here are my thoughts on this:

      1) If you're taking a programming test, it's meant to be a representation of your own programming skills. You really should write your own code for this rather than using something you didn't author.
      2) Randomly inserting nodes is not a valid method of balancing a tree.

      Mike and I jointly own the code, so he should also weigh on this too, but I would lean towards not using code that you didn't author in a programming test.

      -Rez
    • Balancing the tree is not exactly related to the problem, it is just a small requirement of my particular solution, which is why I think it would be okay to use the code.

      The tree in question is a TST, so random insertion would generally provide a balanced tree.

      Regardless, I'm currently starting at the middle of my input and divide-and-conquering, which appears to be working so far.

      Thanks!
    • To be clear, I'm not saying that you can't use it. I'm saying that as a potential employer, it wouldn't look as good. That's all.

      Good luck with your test! What company is it?

      -Rez
    • The company is Bungie, and they gave me a super fun problem! I think they will be very impressed with my algorithm.

      Anyway, inserting from the middle and dividing seems to work fine. I realized that the real problem was the ASPX interface I'm using for my program, because it isn't stable with large inputs.
    • I agree with Rez completely - interview questions are typically made to be answerable without any outside code, just what you can write.

      Also, balancing a tree is done using an algorithm to reorganize it, not by inserting nodes - the goal is to provide an optimal data structure with the same data set. Inserting nodes would grow the data set and perhaps even slow down searches.
      Mr.Mike
      Author, Programmer, Brewer, Patriot
    • My ternary search tree is initialized before the algorithm runs. The problem was that I was initializing it with the entire dictionary in order, which was causing balance issues. Now I am inserting the middle word in the dictionary and divide-and-conquering the rest. This has solved my problem, so I won't be using the GCC code.

      Thanks!
    • RE: Using source code for an interview

      I've worked with databases and data structures for decades and quite frankly I'm rather amazed people still use those 2-dimensional structures (even in simulation) when real life (or even 3D) is anything but 2D.

      When was the last time you were searching for something in a library or elsewhere? You may have had a piece of data and wished to use what little you had to find it. However if you didn't use the search/menu tree the developer insists you use then you can't get past that to find what you're looking for. Catch-22.

      I see a trend towards Graph Theory structures -- that's what I use. I've developed one containing 6-dimensions which seems to suit every need I've ever found. Of course this one is proprietary, however I'm sure going in the right direction you can come up with something better than an archaic 2D data structure.

      Let me add one more thing... perhaps a better solution is to come up with a better solution than B-Trees. Perhaps the novel approach to solving their problems could earn you points -- and attention.

      Although I must also say, I once interviewed with a Microsoft company, and was appalled that they were trying to use an ASP code database query when I'm sure I'd rather leave DB access to a professional DB engine -- and the people who spend all day optimizing them. Needless to say, I didn't get that job. But then again, if that's the was they work, I'm glad I didn't.

      The post was edited 1 time, last by Professorknow ().