Monday, August 4, 2014

Programming Language Questions

These are purely questions about programming languages themselves along with a little about data structures and applications thrown in for a little additional flavor. For more puzzle type or coding level questions, please see my other post on "Quant Interview Questions". What follows are questions one can typically expect to be asked in phone-screens or in early warm-up for technical interviews. This is a very non-exhaustive list, I will add more to these as time permits.
  1. what is a procedural language? a functional language? what is the difference between the two?
  2. what is a pointer? what is an array? when would you use one or the other?
  3. what is garbage collection? give an example of where this might be used.
  4. what is an object? a class? what is a class variable?
  5. what is a virtual function? a pure virtual function?
  6. what is the difference between a method and a function?
  7. what is a partial function? give me an example.
  8. what is a friend function?
  9. what is a mix-in?
  10. what is inheritance? what is multiple inheritance?
  11. can you illustrate with an example how you would implement multiple inheritance in Java? in Python?
  12. what is introspection? can you illustrate with an example?
  13. can you think of any language that would allow you to create a variable from a text string a user types in at a program prompt? how would you implement this? (hint: this is easily done in Python)
  14. what is the difference between passing a variable into a function by reference vs. by value?
  15. what is a static variable? what is a class variable? what does the C-keyword "volatile" indicate? where is it used?
  16. how can you tell the direction of stack growth on your computer? incidentally, does this tell you about the direction of stack growth on your computer, or given the context of your compiler?
  17. what is a dictionary or hash table? give an example of its use.
  18. what is an interface? what does serializability mean?
  19. what does a pickling operation represent? how would you use it?
  20. what is a hashing function? how would you use it?
  21. what is operator precedence? what is operator overloading?
  22. what is polymorphism? illustrate with a simple example.
  23. what are software patterns? give me a simple example.
  24. what is TCP/IP? what is a socket?
  25. when would you use TCP vs. UDP? can you have two separate programs listen on the same socket, one for TCP and the other for UDP, at the same time?
  26. what is a list comprehension?
  27. what is a lambda expression?
  28. what is the most efficient method to sort input data that is guaranteed to be neither sorted nor reverse sorted?
  29. what is the most efficient method to find an element in a long list of data elements?
  30. (***) what is a Bloom filter? how is it used?
  31. (***) what is a Kalman filter? how is it used?
  32. explain a socket life-cycle at the server side (bind, listen etc...) for a multi-threaded server. do the same at the client side. 
  33. what is an assert? what is exception handling?
  34. what is a critical section? what is the pigeonhole principle?
  35. what is a semaphore? when would you use setjmp and longjmp in C?
  36. what is a Turing Machine? what is the Turing Test?
  37. what does a try-finally block let you do in Java?
  38. what is a "Duff's device"? How would you implement a case statement in Python? 
  39. what is recursion? explain with an example.
  40. how would you write a function that takes multiple, variable number of arguments. illustrate with an example.
  41. what is idempotence?
  42. what is the difference between public, private and protected variables in a class?
  43. what is a structure? a union? a typedef? an enum?
  44. what is a generic? what is a template? how would you use them?
  45. what is a list? a stack? a deque? a tree? how would you build a tree in Python?
  46. what is a livelock? what is a deadlock? what is the difference between the two?
  47. what does the term "thread-safe" mean to you?
  48. can a program be a client and a server at the same time? give an example of how this might work.
  49. what is monkey patching? in what kinds of languages could this work?
  50. explain the difference between final, finalize, and finally in Java.

1 comment:

  1. Hello Phantom,
    Very Nice List of some Programming Language Questions. I like way of writing especially point wise description.
    I am looking for the blog / website like your's Java questions and answers Blog for my programming queries. I must admid, I never encounter of such type crisp blog post in my recent time.

    Thanks for sharing