Tech & Work

Prepare for your next contracting interview with these sample questions and answers

Think you're ready to interview for a job as a Java developer or as an Oracle DBA? Before you shine your shoes, read this article from <i>Contract Professional</i> to make sure you're prepared to answer some tough questions.


By Noah Suojanen

Editor’s note: This is the second half of an article that originally ran in the March 2001 edition of Contract Professional magazine. It appears here under a special arrangement with TechRepublic. Part one gave resume suggestions and mapped out some typical questions and answers to expect during an interview for a Java developer position.This installment will discuss writing code on demand and potential questions for Oracle developers and systems administrators.

If you've been doing contract work for very long, you've likely come to expect some tough interview questions. Often, employers are worried about being burned because of trouble with contractors in the past, so they attempt to weed out less serious candidates with very specific technical questions.

Employers need to make sure a contractor has the specific technical skills to do the job before they invest any money to have the work done. The interviewer's goal in the interview is to figure out whether you have those skills. Your goal, obviously, is to convince him or her that you do.

But this is not always an easy task. Even if you have the right skills, you still have to demonstrate them. Even if you demonstrate them, the interviewer may not be qualified to evaluate your answers. (If they had an in-house expert, they probably wouldn't need a contractor, right?) With those issues in mind, interviewing effectively can be quite tricky. Here are some typical questions and answers to review to help you better prepare for your next interview for a Java developer, an Oracle developer/DBA, or a systems administrator contract position.

Java implementation
To pass the implementation portion of an interview for a Java developer position, you'll basically be given a marker and a whiteboard and be expected to write code.

This is an important part of the interview, because this is basically what you'll be doing day to day. If you can't do it in the interview, the hiring manager will assume that you probably can't do it on the job.

One of the most important things to do is to immediately try an example of the problem. This is a good way to clear up any misunderstandings, and it shows a clear thought process. It should also help you solve the problem and is a good technique to fall back on whenever you're stuck.

Contract Professional  on TechRepublic
Contract Professional is the monthly magazine written specifically for contract IT workers. CP provides information on technology trends, training, job opportunities, tax and financial issues, and contractor-friendly cities. To read more, visit Contract Professional online.

It's important to realize that these questions usually require only a little bit of code, because they have to be implemented thoroughly in about 20 minutes. If you find yourself writing endless helper methods or tons of code, it's a good sign that you may be on the wrong track.

You'll usually be given hints while coding, and a large part of the interview is how you respond to the hints. Always pay attention to the hints, and you'll get tons of partial credit.

Finally, explain your algorithm to your interviewer before you start coding it. It's not very impressive to implement an incorrect or incomplete algorithm. Your explanation also shows that you don't hastily jump into writing code.

Here is a sample question and answer that I love asking people I interview:

Question: Write a method that takes two strings, del and s, and returns a string that is s with all of the characters that also appeared in del removed. Here's an example:
s = "Hello World"
del = "ol"


The method should return the string "He Wrd" because it is s with all of the characters that also appeared in del removed.

Answer:
private String removeChars(String s, String del) {
  String result = '''';
  for (int i = 0; i < s.length(); i++) {
    if (!contains(s.charAt(i), del)) {
      result = result + s.charAt(i);
    }
  }
  return result;
}
 
private boolean contains(char c, String del) {
  for (int i = 0; i < del.length(); i++) {
    if (del.charAt(i) == c) {
      return true;
    }
  }
  return false;
}

There may be follow-up questions about this implementation that focus on running time and memory considerations. Try to think of more efficient implementations of the above problem as an example.

Oracle DBA/developer
"Oracle knowledge" is a huge topic. There are DBAs who "keep the trains running." There are developers who write SQL queries.

There are designers who come up with efficient database schema. There are tuners and specialists in various products. And there are a lot more Oracle jobs besides just these.

Almost every Oracle job requires a sound understanding of SQL, some database architecture, and elementary optimizations. Oracle questions generally will fall into two buckets: experience and technical knowledge.

Experience is probably more important with databases than with Java. While a bad developer obviously has a slew of problems, a bad DBA can easily tank your entire system or leave you totally unprepared for a disaster. It's important that you convince the employer that you're prepared to undertake the responsibility of a key database position.

Often, the interviewer will know much less about databases than you. He or she needs to be convinced that you can handle this sort of task. Craft all of your answers to demonstrate past responsibility and how you successfully handled it.

Again, be prepared for questions that require a negative answer and always demonstrate similar skills and confidence.

Almost every interviewer will ask at least a few technical questions to try and separate the people who can "talk the talk" from those who can "walk the walk." Here are a few questions and answers that people claiming Oracle experience should be prepared to answer. (Note: The first two may not apply if you're interviewing for more of a developer-type role.)

Question: What is the purpose of the rollback segments of a database?
Answer: The rollback segments are used to guarantee atomicity. Basically, if a transaction does not complete because of an error, the database can use the rollback segments to see what has occurred and roll back the transaction to ensure there are not partial effects.

Question: Give an example of a query that is less efficient if there are indexes on a certain attribute.
Answer: Consider a database of people with an attribute of gender—male or female—in which about half the people in the database are men and about half are women.
Now, suppose there is an index on gender and you want to select all of the women. The index may cause the disk to follow pointers to each of the women and cause lots of disk head movement.
This is likely to be less efficient than moving the disk head over all of the tuples and pulling out the ones that are women.

Question: Given the following two schemas, with id as the shared key, write an SQL query to get the names of all of the employees with five years of experience:
Employee(name String, int id)
YearsServed(int id, int yearsServed)


(This should be trivial for anyone with SQL experience but impossible for a resume padder.)

Answer:
SELECT name FROM Employee, YearsServed
WHERE yearsServed = 5 AND Employee.id = YearsServed.id;


Systems administrator
As a systems administrator, you will find that most questions will focus on your experience; a few questions may be more technical. For this kind of job, it's important to demonstrate that you have the skills to work productively within the client's current environment.

For example, if you're asked, "Describe your experience with sendmail," you should certainly describe everything you know about sendmail as well as all of your experience with it. You should also mention all of your knowledge and experience with similar products, such as Exchange. Finally, point out key issues between certain products and features common to all of them, such as user management, lists, aliases, and MX records.

You basically need to convince the employer—who often lacks the technical expertise to judge you—that you have the appropriate experience to take on the systems administrator responsibility. You may, however, be asked more specific technical questions. Here are two examples (the first is only relevant if you have claimed to know sendmail or UNIX systems administration on your resume) of some questions you should be prepared to answer.

Question: How do you start a sendmail daemon?
Answer:
sendmail -bd

Question: What are the differences between TCP and UDP?
Answer: Both are network layer protocols that deal with sending packets. TCP ensures that the packets arrive and that they are ordered. UDP does neither but is generally faster.

Certainly, these are only sample questions that may or may not come up in your next interview, but they do point to some crucial knowledge you should have if you want to be a serious candidate for these positions. It never hurts to brush up on your skills, and you'll likely find that you'll increase your confidence level in your next interview by taking the time to revisit some of the issues posed in these scenarios.

Noah Suojanen is the coauthor of Programming Interviews Exposed: Secrets to Landing Your Next Job (Wiley, 2000). He is currently the lead developer at Mspect, Inc., a wireless Internet start-up.


What’s in demand?
What skills are your clients requesting? Are there new skills you’ve had to add to your repertoire? Tell us about them in a discussion below or send us an e-mail.

 

Editor's Picks