Skip directly to: Main page content
UC Davis, University of California
go
Search
  •  

Technical Interview Questions
for Engineering Majors


The following questions were put together by the current Engineering Student Advisors.
These questions are to be used as samples to help you prepare for upcoming technical
interviews. Some of them contain answer hints or suggestions.

*If you think of any questions you would like to add to the list, please e-mail: iccengr@ucdavis.edu

Chemical Engineering
Civil Engineering
Computer Science
Electrical Engineering
Mechanical Engineering

Chemical Engineering
Back to Top

1. Why does a kernel of popcorn “pop” when heated? (Solution: Think Thermodynamics)!

2. How would you remove caffeine from coffee beans? What needs to be considered in choosing a method?
(Solution: There are two basic, industrially accepted methods. One uses a solvent known as methyl chloride and the
other uses carbon dioxide under extremely high pressure (supercritical carbon dioxide). The use of methyl chloride
is an older method and requires additional precautions because methyl chloride is poisonous so one must be sure
that it does not contaminate the coffee. Using supercritical carbon dioxide requires more expensive equipment,
but the risk on contamination is no longer there because carbon dioxide is not poisonous to humans. Using carbon
dioxide to decaffeinate coffee has been advertised as “natural decaffeination” on food labels. Okay, if you are like
most people, then you probably did not know this exact answer. However, interviewers are not really looking for
the correct answer anyway. They just want to see what ideas you come up with and how you handle yourself
under pressure. By just mentioning food contamination issues and equipment costs, you would have taken a step
in the right direction).

3. How would you separate water and benzene? What needs to be considered in choosing a method?
(Solution: It is good idea to know how water and benzene interact chemically. What chemical properties do they
have in common? How are they different? Do they react? Are they miscible? All acceptable things to talk about.
This is definitely a good start).

4. How do you go about mixing two unknown chemicals? How do you know if they are “perfectly mixed”?
(Solution: The hint here was “perfectly mixed”).

5. How would you measure the blood flow through a vein? How can it be modeled?
(Solution: Think velocity profiles, Reynold's Number, pressure differences, etc).

Civil Engineering
Back to Top

1. What is the difference between pumps in series and pumps in parallel? Under what circumstances would you
use them?
2. What are some of the different ways to lay a foundation?
3. If you were taking a phone complaint from a citizen who demands a stop sign at an intersection and your
supervisor was unavailable, how would you handle the situation?
4. You are asked to organize and present data from an air quality study. How would you go about it?
5. Why is a manhole round?
6. How do you predict the movement of soil under unpredictable forces and wet conditions?
7. If you were assigned to be on a team to redesign I-80, what would you change? How would you go about it?
What obstacles do you think you'll face?
8. What are the different ways to “reclaim” water?
9. You have designed an intersection based on data from past years. What is the most important thing you must
do before submitting it for final approval?
10. During construction, the contractor was digging a trench and found something large and unusual. He calls you
and asks what he should do. How would you handle this situation?

Computer Science
Back to Top

1. Write a function that returns the factorial of a number.

Solution: This is a typical, can-you-program warm-up question. Example 1 shows the iterative and recursive solutions. Notice that in both solutions, I check the input values and boundary conditions. Factorials of negative numbers are undefined, and the factorial of both 0 and 1 are 1. The functions in Example 1 handle these cases correctly, and they initialize all variables.

(a) int iterative_factorial (int number) { int rval = 1; /* first check input values */ if (number < 0)
{ /* we'll return -1 if there's an error */ return (-1); } for (int i = number; i > 1; i--) { rval = rval * i; }
return (rval); }

(b) int recursive_factorial (int number) { if (number < 0) { /* we'll return -1 if there's an
error */ return (-1); } else if ((number == 0) || (number == 1)) { return (1); } else
{ return recursive_factorial (number-1) * number; } }

2. Write an implementation of strlen().

Solution: Given a char pointer, strlen() determines the number of chars in a string. The first thing that your strlen() implementation ought to do is to check your boundary conditions. Don't forget the case where the pointer you are given is pointing to an empty string. What about the case where the pointer is equal to NULL? This is a case where you should state your assumptions. In many implementations, the real strlen() doesn't check to see if the pointer is NULL, so passing a NULL pointer to strlen() would result in a segmentation fault. Making it clear to your interviewer that you are aware of both of these boundary conditions shows that you understand the problem and that you have thought about its solution carefully. Example 3 shows the correct solution.

int strlen (char *ptr) { int i = 0; if (ptr == NULL) { /* the real strlen doesn't handle this */ /* case,
but I do! I return -1 */ return (-1); } while (*ptr++) != '\0') { i++; } return i; }

3. You are presented with a linked list, which may have a "loop" in it. That is, an element of the linked list may
incorrectly point to a previously encountered element, which can cause an infinite loop when traversing the list.
Devise an algorithm to detect whether a loop exists in a linked list. How does your answer change if you cannot
change the structure of the list elements?

Solution: One possible answer is to add a flag to each element of the list. You could then traverse the list, starting at the head and tagging each element as you encounter it. If you ever encountered an element that was already tagged, you would know that you had already visited it and that there existed a loop in the linked list. What if you are not allowed to alter the structure of the
elements of the linked list?

The following algorithm will find the loop:
1. Start with two pointers ptr1 and ptr2.
2. Set ptr1 and ptr2 to the head of the linked list.
3. Traverse the linked list with ptr1 moving twice as fast as ptr2 (for every two elements that ptr1 advances within the list, advance ptr2 by one element).
4. Stop when ptr1 reaches the end of the list, or when ptr1 = ptr2.
5. If ptr1 and ptr2 are ever equal, then there must be a loop in the linked list. If the linked list has no loops, ptr1 should reach the end of the linked list ahead of ptr2.)

4. Given a Process A that collects user inputs through a GUI and passes input parameters to Process B on another
machine which in turn records the data to a data base. As a system designer, what considerations would you take
into account? What technologies would you employ?

Solution: Requirements must include performance needs with respect to latency and volume (e.g. throughput). Performance requirements will drive the type of technologies used for process-to-process communications, GUI interactions and database access. Data base optimization for read or write needs to be considered. Performance and throughput requirements will drive the architectural decisions the designer needs to make to decide on the split of functionality between Process A and Process B. The number of users and the number of expected transactions per hour will also drive the decision on how many instances of Process A will need to created and whether multiple machines will be employed to run the Process A.

5. Describe the data structures of a double-linked list. How do you insert a record between how others?

Solution: A double-linked list structure contains one pointer to the previous record in the list and a pointer
to the next record in the list plus the record data. Previous R; Data R; Next R; To insert a record
(B) between two others (A and C): Previous.B = A; Next.B = C; Next.A = B; Previous.C = B;


6. What is the difference between a WHILE loop and FOR loop construct?

Solution: The WHILE loop continues until the condition is FALSE. The FOR loop is good for regular loops.

7. What should a professional software designer consider in the design and implementation of code?

Solution: The following are some of the considerations: · Throughput · Latency · Reliability
· Usability · Resource limitations · Supportability)


8. Illustrate the use of * and & for pointers in C.

Solution: char c = 'a'; - contains a single character 'a' char* p = &c; - p holds the address of c char c2 = *p; - c2 is equivalent to 'a'

9. Explain TRY and CATCH exception handling in C++. Why is this type of exception handling useful?

Solution: The TRY block of code is subject to exception handling. The closing CATCH identifies the
class of exception that is to be caught. Exceptions are rooted in the Exception class. The catch clause
will catch every exception of the stated class, and any descendants of that class. This type of exception
handling is useful for large programs comprised of multiple modules when an exception occurs and the
reporting of errors cannot be resolved locally or handling errors detected elsewhere.


Electrical Engineering
Back to Top

1. Describe the Bode Plots of a High and Low Pass filter.
2. Describe the functions of a D Flip Flop.
3. Explain Ohm's Law.
4. How are a resistor and its corresponding current related?
5. Explain the differences between a transistor and capacitor.
6. Describe the functions of a diode.
7. Describe the basic elements of an integrated circuit.
8. Describe the difference between the P-type and N-Type configurations.
9. How does an Analog-to-Digital converter function?
10. Explain how a resistor functions.

Mechanical Engineering
Back to Top

1. List Newton's Laws and state the equations.
2. How is a factor of safety used in design?
3. Interpret a Stress vs. Strain Curve.
4. What types of equations or theories would be used in Static Failure?
5. What types of equations would be used in Fatigue Failure?

 

 

 

 

EPS Home