Elliott C. Back: Internet & Technology

A Liberal Engineer

Posted in Education, Science by Elliott Back on February 23rd, 2005.

This is my third year as an Engineering Major at Cornell University, and being in the especially dorky field of Computer Science I’ve tried to balance my education by specializing in English. Too many engineers can’t express themselves in written English, or give a long eloquent speech. Whether or not this is necessary for the workplace is arguable, but whether an excellent command of language is good for one’s soul is axiomatically true. To read Forster or Woodsworth is to come alive in a transcedental sense disjoint from the pleasure of working with machines.

You can look at the issue from a philosophical standpoint, or a practical one. Practically (which is what many engineers are concerned about), command of English and Literature is important from three functional perspectives: innovation & creativity, documentation & presentation, and design & production. I believe that a poet-engineer will have more innovative ideas than a pure engineer, because he has avenues of escape from one realm to the next. While working on a particular problem, his mind can flit between two ideas of knowledge, Lord Byron inspiring a different metal in some alloy, simply by allowing his mind to wander while on the job. The best minds pursue all avenues of innovation, even tangentially. Then, there’s the obvious clarity that skills in English bring to technical documentation. The farther you can abstract your documentation from the harsh technical reality of the machine you’ve built, the easier they are for operators and layman to understand. In a presentational sense, good English means a good resume, which is the key to getting good jobs. How well can you present yourself if you can write the next Google, but can’t speak a fluid sentence? Finally, English, while mystical and lively, is also highly structured and formalized. A full understanding of the grammar of letters and words could help you understand the Car grammar, of nuts and bolts.

Philosophically, well roundedness has been an ideal since Plato first wrote about the immortal soul in the Republic. “Engineering,” he would say, “is good for your mind, but your mind is only one part of the body, spirit, mind consortium. You should exercise all three.” To which we might reply, “And how, sir, should we improve the state of our spirit?” Plato would say, “By the careful study of the Arts you will better your spirit, the creative part in you.” Psychologists might disagree: modern proponents of the liberal education certainly would agree with him. And I think so, too.

To have a truly liberal engineer, you need some part technical studies, and some part liberal. And not just liberal studies, but a passion for the Arts that rivals your passion for engineering.

Search Spell: Rating = Neat

Posted in SEO, Search by Elliott Back on January 18th, 2005.

I just came across search spell, a service that intelligently permutes words into their mispellings for Search Engine Optimization. It actually does a pretty good job. Writing “elliott” into their machine gives me:

elliott, ellott, ellitt, leliott, erliott, leriott, leriot, elliot, leliot, erliot, eliott, eriott, leiott, eliot, eriot, leiot, 311ott, e11ott, el1ott, ellitot, elloitt, elilott

This is a pretty impressive list of mispellings. It pretty much covers any omission of permutation of the letters. Would you believe “elilott” has 304 hits in Google? Talk about information overload!

The Microsoft Interview Revealed

Posted in Code, Education, Microsoft by Elliott Back on November 3rd, 2004.

This Monday I had an interview with Microsoft for a summer internship position. I decided I would go for the Software Design Engineer in Test. It’s a job that involves writing code to break code, writing secure code, profiling, and a lot of debugging–all things I enjoy. For my classes, I’ve written software compilers that don’t crash on mp3s, games that persist even if the AI or the server dies, and databases that even silly users can’t ruin. It’s interesting how much testing goes into good software. I’ve written code to write testcases for other code, and turned in 40 pages of SML test code for one CS312 assignment. You can see how much I enjoy it!

After we discussed the position, I was asked to write a piece of code to take a 7 digit phone number, and generate all possible combinations of the letters in their 7 places. Imagine a slots machine with 7 spinners. The problem is to write out all the possible slots combinations you could arrive at by pulling the level and spinning each digit. (Aside: I was tempted to write this as a random problem, and draw a random set of digits until I had exhausted the set space. I resisted.)

Here’s simple code to solve this Microsoft problem:

public void myCutiePie(char[] in, int level){
    if(level == in.length){
        System.out.println(in);
        return;
    }
     for(int j = 0; j < 3; j++){
         char temp = in[level];
         in[level] = getNextLetter(temp, j);
         myCutiePie(in, level+1);
         in[level] = temp;
     }
}

The getNextLetter() function just takes a digit and returns the appropriate letter. It’s just a little bit of character arithmetic that I didn’t want to write in an interview without an ASCII reference. Of course, the interviewer didn’t mind, since that wasn’t the point. When I was done, after a false start where I wanted to generate all the combinations of all the letters, he asked me:

How would you test this code?

Well, if I had a better method of generating these permutations, I could test this new one against the verified output of the old one. I would test cornercases–sorted , unsorted, and alternating arrays of digits. I’d test invalid inputs, like an array of size 0, or in a loosely typed language, another datatype. I’d also test some random, easy to check cases, as well. After he looked at my code, he said:

That’s an interesting way to write it.

Apparently he was expecting me to nest 7 for-loops… which is not my idea of good code. And, it would have filled up the whole page. Icky. The next brain teaser was

How do you cut a cake in half where some rectangle has already been cut out?

You have to bisect both rectangles and cut along the line formed by the points of bisection–but he had to walk me through that. Geometry and cakes is not my strong point. After that, we talked more about the position and my qualifications.

All in all, the interview went well, and the famous Microsoft brainteaser coding question didn’t seem as hard as last year’s, where I was expected to reverse a string in place, by word.

Update: I should have mentioned that duplicates were considered OK.

Update 2: My outer loop was duplicating the results from the recursion. No point in doing that!