Interview Questions: Difference between revisions

From EggeWiki
mNo edit summary
 
(One intermediate revision by the same user not shown)
Line 15: Line 15:
== C++ ==
== C++ ==
* Explain the difference between a macro and a template.
* Explain the difference between a macro and a template.
* What is an initializer list?  Why use them?  When would you be required to use one?
* What is an initializer list?  Why use them?  When would you be required to use one? What order are variables initialized?
* What's the difference between an int and a long?
* How would you determine the number of elements in a C array?
* What's the difference between a reference and a pointer?  Which one do you prefer to use?
* What's the difference between a reference and a pointer?  Which one do you prefer to use?
* How do you see what functions a dll or so is exporting?
* How does a unix program determine where to find it's libraries when it is executed?


== SQL ==
== SQL ==
Line 44: Line 44:
* How do you check the return code of the last command which executed?
* How do you check the return code of the last command which executed?
* How can you tell the number of lines in a file?
* How can you tell the number of lines in a file?
* If I chmod a file 644, what permissions will it have?
* What do the following file permissions mean: 644, 400, 755?
* What do the following variables represent in an sh script: $$ $? $@ $#
* Explain what load average means.
* In debugging a compiled executable, how can you see what system calls it is making?
* Explain the difference between a .so, .a, and .la files.
* How to determine if an executable is a 32 bit or 64 bit program, and what architecture was it compiled for.
* Explain how the dynamic linker determines what libraries to link dynamically.  Explain how to change this.
* How do you truncate the log file of a running program?
* What's your reputation on [http://serverfault.com/]?
* I want my files to have 660 permissions by default.  What umask should I use?
* What's the difference between sourcing a script and executing a script?

Latest revision as of 17:12, 17 May 2010

As part of my job, I am regularly interviewing developers. Often, before a interview a canidate, I do a Google search for them. What I'm hoping to find is:

  • Open source projects they've contributed to
  • Technical postings they've written on messages boards
  • Interesting blog postings

I well prepared canidate as likely Googled me before the interview. In fact, you the reader of this page, may be one such canidate. Well to give you a little help, I'll give you some of the questions I'll probably be asking you. I've posted a subset fo the questions which I usually ask. See also my Phone interview tips

Java Questions

  • What's the difference between .equals and ==. If you can't answer this, it's probably going to be a short interview.
  • Can you put constants in an interface? If so, is this a good idea?
  • Why do people say Java isn't a true object oriented language?
  • What is a weak reference?
  • In Java 1.4, how would you create a type safe enum?

C++

  • Explain the difference between a macro and a template.
  • What is an initializer list? Why use them? When would you be required to use one? What order are variables initialized?
  • What's the difference between a reference and a pointer? Which one do you prefer to use?
  • How do you see what functions a dll or so is exporting?
  • How does a unix program determine where to find it's libraries when it is executed?

SQL

  • What is an inner / outer / self / theta join?
  • Give me an example of a query with a HAVING clause.
  • If you have a time series table which contains the columns instrument, date, & price, what indexes would you create?
  • What is meant by the ACID model?
  • What is a composite primary key?
  • How do you represent a many-to-many relationship?

Network

  • How can you have one thread wait on multiple sockets?
  • Explain how multicast works.
  • What are the five elements which uniquely identify a socket?
  • What is the purpose of the TIME_WAIT state?
  • If a have an echo server on a local network, how many requests per second could a single client make, assuming it has to wait for the response before sending the next request.

Architecture

  • What is virtual memory?
  • What is the difference between virtual memory and virtual address space?
  • What is the difference between kernel and user address space? How much of each do you get on Windows, Solaris, Linux, etc..?
  • What is a memory mapped file? When might you use one?

Unix

  • How do you check the return code of the last command which executed?
  • How can you tell the number of lines in a file?
  • What do the following file permissions mean: 644, 400, 755?
  • What do the following variables represent in an sh script: $$ $? $@ $#
  • Explain what load average means.
  • In debugging a compiled executable, how can you see what system calls it is making?
  • Explain the difference between a .so, .a, and .la files.
  • How to determine if an executable is a 32 bit or 64 bit program, and what architecture was it compiled for.
  • Explain how the dynamic linker determines what libraries to link dynamically. Explain how to change this.
  • How do you truncate the log file of a running program?
  • What's your reputation on [1]?
  • I want my files to have 660 permissions by default. What umask should I use?
  • What's the difference between sourcing a script and executing a script?