这有几个面试题目,看看各位能答几个 :)
1. Object A and B need to communicate with each other. However, object A and B, cannot refer to, or contain each other directly. What way or ways can you think of that would allow object A and B to communicate?
2. Given a very simple microprocessor with no multiply, divide, or subtract instructions what algorithm would you use to implement an integer divide by 7? Assume that the microprocessor and your algorithm will be part of real-time process control system. Explain why you think your algorithm is a good choice for use in a real-time control system.
3. Write code to build an array S from integer array R such that array S contains only one instance of those integers from R that are not evenly divisible by any other integer in R.
4. What class structure would you use for a person scheduling their car for a tune up?
5. In a multi-user database application with no built-in record locking mechanism in the database, how would you ensure that a record does not get updated by two users at the same time?