Core language


  1. What are the types in C, Java, C++, and Perl? How many bits does it take
    to represent the basic types?
  2. What do floating point numbers look like in
    memory? Specifically, how many bits are there in a double and
    what sequence to the bits appear in?
  3. What is twos-complement notation?
  4. How would you implement a bit array class?
  5. Does the check x == x + 1 always return false for integer x?
  6. What does a C struct look like in memory? What does a C++
    object look like in memory? What does a Java object look like in
    memory?
  7. What is the difference between an interpreted and a compiled language?
  8. What is garbage collection?
  9. How would you determine if call stack grows up or down relative
    to memory addresses?
  10. Give an example of a memory leak in Java.
  11. What is tail recursion? How can it be removed automatically?
  12. Is the natural recursive program for computing n! tail recursive?
  13. Your manager reads an online article that says it is 10X faster to code in Python than in C++. He wants you to code exclusively in Python from now on. What would you say to him?
  14. What does an executable look like as a sequence of bytes?

Libraries

A programmer who regularly implements complex algorithms such as KMP
string matching or the Dijkstra shortest path computation quickly
will not advance very far. Solutions to such problems are well-known and have
high quality, thoroughly tested, and debugged implementations, often
available as open source. Programmers should know and use these libraries.


  1. Give an example of a function which is in the C standard library.
  2. Give an example of a commonly used function which is not in the C standard library.
  3. What library would you use to determine the current date in Java?
  4. What library would you use in Java if you had to implement a tinyurl service?
  5. How does STL implement sets?
  6. How does the library code compute trigonometric functions?
  7. The strtok(char s1, char s2) function in the C standard library successively returns occurrences of the characters in s2 in string s1; it returns null if there are no more occurrences.
  8. What makes this a dangerous function to use in a multithreaded program?

Programming language implementation


  1. Give an example of a language which cannot be parsed by any computer.
  2. What problems does dynamic linkage solve? What problems does it introduce?
  3. What is a functional language?
  4. What is a virtual function?
  5. How is method dispatch implemented in Java?
  6. What is automatic garbage collection and how is it implemented?
  7. What is a type-safe language?
  8. What is the difference between a lexer and a parser?
  9. Give an example of a language which cannot be recognized by a lexer.
  10. Give an example of a language which cannot be parsed by a parser.

Comments