programmers... what kind of questions have you been asked on interviews?

Discussion in 'OT Technology' started by D1G1T4L, Jun 22, 2007.

  1. D1G1T4L

    D1G1T4L Active Member

    Joined:
    May 4, 2001
    Messages:
    16,489
    Likes Received:
    0
    Location:
    Bay Area
    In terms of coding something or problem solving....... I got an interview on monday where they will ask me to code something or solve some problems..... I wanted to know how can I prepare for it
     
  2. GOGZILLA

    GOGZILLA Double-Uranium Member

    Joined:
    Jan 16, 2003
    Messages:
    10,760
    Likes Received:
    3
    Location:
    Plantation, FL
    what type of company is it?
     
  3. CompiledMonkey

    CompiledMonkey New Member

    Joined:
    Oct 26, 2001
    Messages:
    8,528
    Likes Received:
    0
    Location:
    Richmond, VA
    I generally like to see how deep their knowledge is when I interview someone. The guys that work for me are just *into* this line of work. For us, it's not a 9-5 kind of job and that's what I like to see in a potential employee. I want someone who spends their free time learning new things and keeping themselves up to date. At the same time, having a solid understanding of the theory shows me that a candidate is more than just some programmer. Take data structures for example; it's not exactly a requirement to understand how they work behind the scenes in order to use what's supplied in your framework of choice. But, having that knowledge shows you care a little more and are probably better than your average developer. Those are the kinds of things I look for.
     
  4. D1G1T4L

    D1G1T4L Active Member

    Joined:
    May 4, 2001
    Messages:
    16,489
    Likes Received:
    0
    Location:
    Bay Area
    they make web applications in java
     
  5. D1G1T4L

    D1G1T4L Active Member

    Joined:
    May 4, 2001
    Messages:
    16,489
    Likes Received:
    0
    Location:
    Bay Area

    who do you work as now? I thought you used to be a programmer?
     
  6. mrj

    mrj New Member

    Joined:
    Jun 10, 2007
    Messages:
    2,637
    Likes Received:
    0
    Location:
    nyc tpa sf
  7. Penguin Man

    Penguin Man Protect Your Digital Liberties

    Joined:
    Apr 27, 2002
    Messages:
    21,696
    Likes Received:
    0
    Location:
    Edmonton, AB
    C questions I've been asked:

    How would you multiply a number by 7 without using the * or + operators?
    How would you check whether a number is a power of 2 without using any sort of looping structure?
     
  8. kronik85

    kronik85 New Member

    Joined:
    Feb 8, 2005
    Messages:
    34,837
    Likes Received:
    0
    Location:
    Deutschland
    only programming questions i've gotten are

    write a recursive loop to find factorials
    something about exception handling



    it was a job that was completely unrelated to coding.
     
  9. Coottie

    Coottie BOOMER......SOONER OT Supporter

    Joined:
    Jun 6, 2006
    Messages:
    32,407
    Likes Received:
    0
    Location:
    OKC
    I was asked to reverse a string in any prog. language I wanted to use?
    I was also asked to show an SQL stmt where I join at least 2 tables and use a where clause?

    I was also asked what's the class that every other class inherits in Java?
    In Java why when would you use a vector instead of an ArrayList?
    What is the parent class for both vector and ArrayList?

    That's all I can think of and they're pretty easy but I'm applying for entry level positions.
     
  10. JustJeff

    JustJeff www.youtube.com/thisisjustjeff

    Joined:
    Oct 30, 2006
    Messages:
    1,651
    Likes Received:
    0
    Location:
    Long Island // Virginia Tech
    God... I took Java 2 years ago and I'm having trouble with some of those... That's bad :(


    Since i was gettin gan IT job, i was asked more on structures like Stacks and Queues and how they work... what's the difference, and when would you use one or the other?


    It's really nothing you can prepare yourself for. It's either you know it or you don't. You can't prepare yourself for the problems you'll find in the field, you just have to be able to think on your feet and find the answer, I'm sure that's what they are looking for. I would assume that's what they want.
     
  11. Coottie

    Coottie BOOMER......SOONER OT Supporter

    Joined:
    Jun 6, 2006
    Messages:
    32,407
    Likes Received:
    0
    Location:
    OKC
    In regards to the java questions the answers are:
    1. Object
    2. ArrayList is serializable so it's thread safe whereas vector is not
    3. They both inherit the List class

    In one application the company had me take a C/C++ online test given by ProveIt.com. It sucked because I didn't do very well on the test at all. We weren't allowed to use any reference materials and the questions were fairly challenging and some were down right BS.

    One BS question was: What function is not contained in the math.h library. I think the choices were: a) sin b) cos c) tan d)arctan e) none of the above. My problem with this type of question is that memorizing these libraries doesn't necessarily make me a better programmer but this was a multiple choice test with no ability to provide feedback. I didn't get the job. :(
     
  12. deusexaethera

    deusexaethera OT Supporter

    Joined:
    Jan 27, 2005
    Messages:
    19,712
    Likes Received:
    0
    I interviewed with Booz Allen Hamilton a couple of years ago. The guy gave me a task to create a linked list, iterate through it and populate it, then calculate the sum of all its values. He gave me twenty minutes.

    When he came back, I had two functions written out and waiting for him. When he looked at it, he asked me what language it was written in; when I told him it was written in VB6, he looked at me like I had three heads. After he regained his composure, he said "that's not one of the languages we usually develop applications in." I said, "That doesn't surprise me; a lot of programmers don't like VB because it doesn't enforce good coding standards like other languages do. But, it doesn't keep me from writing good code if that's what I want to do, and it compiles into native binary code just as well as C++ does. Oh, and I was done with the assignment ten minutes ago; check the security tape if you want."

    He leaned back in his chair, looked at me, looked back at the code, looked at me again, and said, "good answer."

    In the end, I still didn't get the job, but as luck would have it, I got a better job at another company anyway.
     
  13. D1G1T4L

    D1G1T4L Active Member

    Joined:
    May 4, 2001
    Messages:
    16,489
    Likes Received:
    0
    Location:
    Bay Area


    post answers to all the questions as well if you can, thx
     
  14. Coottie

    Coottie BOOMER......SOONER OT Supporter

    Joined:
    Jun 6, 2006
    Messages:
    32,407
    Likes Received:
    0
    Location:
    OKC
  15. GOGZILLA

    GOGZILLA Double-Uranium Member

    Joined:
    Jan 16, 2003
    Messages:
    10,760
    Likes Received:
    3
    Location:
    Plantation, FL
    probably not the best ways but easiest:

    multiply by 7 example:
    Code:
    int numToMultiply = 15;
    int temp = numToMultiply;
    
    numToMultiply = numToMultiply << 3;
    numToMultiply -= temp;
    
    cout<<numToMultiply;
    
    

    check power of two:
    Code:
    int main() {
    
    int check;
    bool result = false;
    
    cin >> check;
    
    
    if ( (check & ~(check-1)) == check)
        result = true;
    
    cout << endl << result << endl;
    
    return 0;
    
    }
    
     
  16. Penguin Man

    Penguin Man Protect Your Digital Liberties

    Joined:
    Apr 27, 2002
    Messages:
    21,696
    Likes Received:
    0
    Location:
    Edmonton, AB
    Yep, those are the optimal answers. No need for all the C++ garbage around them, though. The following would have been sufficient:

    1: (x << 3) - x gives x * 7
    2: x & (x - 1) will be zero if and only if x is a power of 2.
     
  17. Coottie

    Coottie BOOMER......SOONER OT Supporter

    Joined:
    Jun 6, 2006
    Messages:
    32,407
    Likes Received:
    0
    Location:
    OKC
    I thought every bit shift multiplies by a power of 2 so wouldn't shifting it 3 positions = multiplying by 8? What am I missing?
     
  18. Penguin Man

    Penguin Man Protect Your Digital Liberties

    Joined:
    Apr 27, 2002
    Messages:
    21,696
    Likes Received:
    0
    Location:
    Edmonton, AB
    (x << 3) - x == (x * 3) - x == x * 7
     
  19. Nocera

    Nocera ...

    Joined:
    Aug 9, 2000
    Messages:
    1,307
    Likes Received:
    0
    Location:
    Long Island, NY
    I usually don't have them write much code. I usually present some code to them and have them point out the problems. The problems are usually related to concurrency, improper data structures being used, or both.

    After that, I ask 2 random questions in each of 4 categories: 1) General programming knowledge (Java), 2) Web Application specific questions, 3) Security, 4) Databases, and 5) Generalized code/db optimization. I then drill down into the category they knew the best to see how well they know it.

    For my final question, I present them with an inadequate requirements document. I then ask them to tell me what further requirements they would need before they could begin on the design. Most people do not get past this point unfortunately (even the people that appear to be a solid programmer). If they do get past, I give them the added requirements and have them layout an informal design on a whiteboard.

    I never leave the room to let them work. Someone watching over them is added pressure and I like to see how they respond and how they think aloud.
     
  20. GOGZILLA

    GOGZILLA Double-Uranium Member

    Joined:
    Jan 16, 2003
    Messages:
    10,760
    Likes Received:
    3
    Location:
    Plantation, FL
    i c++'d them because it seemed like the dude would want to compile them and see them work to figure it out
     
  21. Penguin Man

    Penguin Man Protect Your Digital Liberties

    Joined:
    Apr 27, 2002
    Messages:
    21,696
    Likes Received:
    0
    Location:
    Edmonton, AB
    If the interviewer needs to compile them to see if they're right, it's probably not somewhere you want to work.
     
  22. Coottie

    Coottie BOOMER......SOONER OT Supporter

    Joined:
    Jun 6, 2006
    Messages:
    32,407
    Likes Received:
    0
    Location:
    OKC
    damn makes sense now lol guess I was really tired last night and not thinking clearly.

    But here's what I don't get, how does know how to multiply by 7 by using shift operations make one a better programmer?? Perhaps it's a job specific requirement but these types of questions seem more like brain teasers, ment to trip up the applicant, than actually trying to determine programming skill.
     
  23. GOGZILLA

    GOGZILLA Double-Uranium Member

    Joined:
    Jan 16, 2003
    Messages:
    10,760
    Likes Received:
    3
    Location:
    Plantation, FL
    no, the op
     
  24. GOGZILLA

    GOGZILLA Double-Uranium Member

    Joined:
    Jan 16, 2003
    Messages:
    10,760
    Likes Received:
    3
    Location:
    Plantation, FL
    it tests your knowledge of binary and low level math operations. itd be very good skills to have for an embedded programming position
     
  25. Penguin Man

    Penguin Man Protect Your Digital Liberties

    Joined:
    Apr 27, 2002
    Messages:
    21,696
    Likes Received:
    0
    Location:
    Edmonton, AB
    Ah, I see. Good idea.

    They test your knowledge of the language and your ability to solve problems given some restrictions. The second question especially is probably something one you'd come up with an answer for immediately (unless you'd seen it before), so it helps the interviewer to see how you think through a problem.

    Also, the company that asked me these two is a company that works on distributed file systems, so they do a fair amount of low-level stuff.
     

Share This Page