aswietlicki
BAN USERWhen the physical distance takes less time to walk than to transport. Transporter completes the cycle in 7 seconds, so walking across a room can take less time. The 7s is just for the transport cycle. There's time necessary to input the coordinates, verify they're not inside a mountain or moving vehicle, etc., getting on and off the pad (and people who take their time doing so), safety check of the buffer and energizing coils, and a host of other things between each transport. So what if there's a long line for the transporter? It's safe to assume not everyone can afford one, so there would be a transporter station like a bus stop. If you're in a city, and it takes you 10 minutes to walk a couple blocks to your destination, but the transporter station at your street corner has 30 people waiting for it, it's possible that you'll get there faster by walking.
Another situation is when there's a power outage that affects the transporter.
This serious answer brought to you by someone who takes interviews seriously.
According to the JavaDocs for Java 6, "StringTokenizer is a legacy class that is retained for compatibility reasons although its use is discouraged in new code. It is recommended that anyone seeking this functionality use the split method of String or the java.util.regex package instead."
The split method returns an array of strings, which has the advantage of quickly allowing you to compare the 2 lengths. Additionally, you can create a for loop to compare the individual strings, and only need to do conversion to Integer (or int) for those elements that aren't equal. (For this question, each piece would need the conversion.)
Thank you, Chaos, for for the moment of clarity. I was going to point out the same comment until I saw yours.
Many of the responses above make me want to point out something crucial in any engineering environment... before you answer a question, make sure you understand the problem and all the information you have.
I agree that my first guess would be memory leak. However, could there be other causes too?
One that comes to mind is the following: what if the test or application being tested spawns a daemon? If I recall correctly, Java daemons all die when there are no user processes running and the JVM shuts down. However, for a C application or Perl script, there could be a daemon spawned and then not properly terminated. Is this a reasonable thing to look for?
Non-Functional:
- is box the right size, color, shape, etc.?
- does box appear/disappear in the right amount of time?
- does box appear each time it is called? - reliability
- is the content displayed as expected?
Functional:
- do all of the correct buttons show up (such as next/previous, ok, cancel, show/hide details min/max/close, etc.)?
- do all of the buttons do the correct work?
- does the box return a value when a button is clicked, and is the value for each button correct?
Agreed. Interviewers will rarely ask questions like this and expect any code. It looks like they wanted to understand your thought processes and possibly understanding of the basics of how google works.
- aswietlicki January 09, 2011