Whiteboarding Problems

These are our favorite whiteboard coding problems. We suggest all future coders become familiar and competent with each:

1. Design an OO parking lot and the classes and functions it will have. It should have a status of full or empty and also be able to find a spot for valet parking. The lot has 3 different types of parking: regular, handicapped and compact.

2. Create model classes that will properly represent the following constructs:

  • Define a Shape object, where the object is any two dimensional figure, and has the following characteristics: a name, a perimeter, and a surface area.
  • Define a Circle, retaining and accurately outputting the values of the aforementioned characteristics of a Shape.
  • Define a Triangle. This time, the name of the triangle should take into account if it is equilateral (all 3 sides are the same length), isosceles (only 2 sides are the same length), or scalene (no 2 sides are the same).

3. Given a maze with cheese at one place and a mouse at some entrance, write a program to direct the mouse to cheese correctly. (Assume there is a path). Following primitives are given: moveforward, turnright, turnleft, iswall?, ischeese?, eatcheese.

4. Draw the Objects necessary to build an online store. The user should be able to order multiple items and ship them to address. The system should keep track of orders and inventory.