Tag Archives: Books

Farewell, Robert Jordan

According to his blog, Robert Jordan passed away yesterday. He fought a tough illness for quite a while. I became a big fan of The Wheel of Time a few years ago and forced myself to stop reading the books until the final one comes out.

I loved the books because they were immense, detailed, complex, and very engaging. He was in the middle of writing it, and he has left notes and given an oral narration of the end of the series, but it just won’t be the same.


Check out my latest book, the essential, in-depth guide to performance for all .NET developers:

Writing High-Performance.NET Code, 2nd Edition by Ben Watson. Available for pre-order:

My interview experience with Google

(See also part 2 of this article).

A few months ago I received an e-mail from a recruiter at Google asking for an opportunity to talk to me about available development positions. Needless to say, I was pretty excited. I’m fairly happy in my current job, but–it’s GOOGLE. You don’t say no to an interview opportunity at Google.

Like this article? Check out my latest book, Writing High-Performance .NET Code.

I’m writing this account in order to contribute to the meager resources available on the Internet about the Google interview experience. I signed an NDA, so I’m not going to say what the specific questions were, but I think I can give a pretty good idea of my experience. I apologize right now for the length.

I traded a few e-mails with a recruiter in Mountain View. I had a phone conversation with him, wherein he asked me general questions about my skills, desired work locations (giving me a choice of Santa Monica, Mountain View, and Boston). I have no desire to live in California, so I chose Boston. I was then passed to another recruiter, who setup a phone interview with an engineer in Mountain View. There was a false start, when they couldn’t do the interview at the original time, so we postponed.

The phone interview went very quickly. He was very nice and asked about my specific talents, things I enjoy doing, and projects I’d worked on–especially those I listed on my resume. He asked about the ray tracer I wrote in college, since he had an interest in that. He also asked some general questions about the stuff I do for work. Then he got into the technical question. It was an interesting problem, and I asked follow-up questions, talked out loud, wrote things down in front of me (and told him what I was writing and why). I immediately thought of the naive solution–always a good place to start. He was interested in the asymptotic complexity. I knew there were better ways of doing it, so I started thinking of optimizations to the algorithm, trying to come up with ways of caching information, reusing previously-computed values, etc. He gave me some gentle prodding, and I think I understood immediately where he was going. I answered the question fairly well, I though.

And that was it–just a single question. I was surprised. The entire thing lasted less than 30 minutes. I was almost disappointed, and thought–“well, that’s that–I won’t hear back.” I really wasn’t expecting any follow-up.

The next week, I got an e-mail from my recruiter who said I had impressed and was going to get the opportunity for an in-person interview in Boston! They hooked me up to a travel coordinator, as well as the recruiter in Boston.

Very exciting. I had a convenient time to go, so I set that up, took time off from work and went up to Boston, staying in the Cambridge Marriott. Very nice hotel. 40″ flat screen TV in the room ( which I never turned on). All expenses paid for, of course. 🙂 I did have to pay for hotel and food up front, and save the receipts. (And yes, I promptly received a reimbursement check from them a few weeks after I sent them in.)

I arrived on Monday afternoon, figured out Logan International (a very confusing airport, I thought), and got myself to Cambridge, in the heart of MIT, an hour or so later. I checked in, then went walking. I found the building Google is in on the very next block from the hotel. They have a floor in a building that MIT leases to startups, tech incubators, and the like. There are plenty of news articles about the Google Boston office–just…you know, Google for them.

I walked past the ultimate geek bookstore–

Quantum Books. Discount tech books. COOL. I would definitely have to stop there later. Then I got some cheap, awful Chinese food at the food court

right under the hotel. Why? When I could go out on Google’s dime? I think I was just tired and wanted to get back to the hotel soon and start studying.

I ate dinner in the room, took pictures of the wonderful view of the Boston skyline.

Boston Skyline (Day)

Boston Skyline (night)

Studying

What did I study? I brought two books with me: Robert Sedgewick’s Algorithms in C++, and a C++ reference manual. I went over advanced C++ topics, STL, simple sorting and searching algorithms, properties of graphs, big-O, and anything else that popped into my head.

By far the most valuable thing I did was write out algorithms before-hand. I picked something and wrote it out by hand in a notebook. It was hard going at first, but I knew it was the best thing I could do to prepare. I did selection and insertion sort in both array and list form. I did string reversal, bit reversal, bit counting, and binary search. All by hand, without looking in a book at all. As well you might know those simple algorithms, it’s harder than it sounds.

I went to bed relatively early–9:30, and woke up the next morning at about 6. I went to breakfast in the hotel restaurant, got a rather large meal, and then headed to my room to study more. I wrote more algorithms and redid some I had done the previous night.

Oh, I also wrote down in my notebook (beginning on the plane ride up) questions for Google, as well as answers to questions they could ask me (standard interview fare–projects, favorite project, languages, strengths, passions, getting along with people).

My interview was scheduled for 10 am–I checked out at 9:30 and left with my bag (I had everything in a single bag I could carry–it was very heavy) and sat in a little square for a few minutes. At about 9:50, I went in, took the elevator, and was greeted with:

.

. (ready for it?)

.

The Google

Dr. Seuss land! Yes, that was my first thought. I think the door was green, the reception area was very colorful. The receptionist was very nice and asked me to sign in on a computer, which printed a name badge for me. They had some research papers by Google employees on a wall, so I grabbed a couple (their hard drive failure study, and map/reduce). After a few minutes, my Boston recruiter came out and greeted me, offered me a drink from their free fridge, and took me to a small conference room, furnished, it appears, from Ikea. It was simple, clean, and very nice. There was a white board. I would get to know that whiteboard very well.

My first interviewer came in and we got started. I talked about my projects for a bit, they answered my questions, and then we got to the problem. Each interviewer asked me to solve a single problem (could be some sub-problems involved), and I had to do it on paper or on the board. I wrote C/C++ code. They take note of what you write and ask you further questions, especially if your first solution isn’t optimal.

I tried to take extra care with my code and not let stupid mistakes creep through. I used good variable/function names, made sure my braces matched, and I ran through the algorithm on the board once I had written it.

The first interview was one of the toughest. I was more nervous. I think I made more mistakes–I didn’t see things as quickly as I did later.

I had three interviews before lunch. They then handed me off to someone else who would not be evaluating me, but would just be an escort for lunch. The Google cafeterias in Mountain View are legendary, but the Boston office is far too small to warrant such lavishness. Instead, they have a catered lunch every day. It was wonderful. They also have all the free drinks and candy you could want, available all the time. I spent much of the time asking my escort questions about Google, what he was working on (couldn’t tell me), the area, the office, the commute. We were also joined by the head of the office, who didn’t realize I was an interviewee, and we had a nice conversation as well.

Lunch was an hour, and then I was back in the conference room. I had two more interviews. Then the recruiter came back in at about 3:15 or so and debriefed me–asked me my impressions, how I felt. I reiterated what I had told him on the phone previously, and that morning before we started: that I was trying to take this as easy and nonchalantly as possible, to have fun, and learn, and let it be a good experience. I had a job that I enjoyed, and didn’t NEED this one, but I think I would do well there and enjoy it very much. They came to me, after all.

I think by the end of the day, I was really pulling that off well. Once I got over my nervousness in the first interview, I really did have fun and enjoy it.

General Notes

They didn’t ask me any stupid questions. None of this “what’s your biggest weakness?” garbage. Not even the recruiter asked me anything like that. Nothing silly at all. They also didn’t ask me easy technical questions. They got right into the problems and the code. I had to describe an algorithm for something and write code for it. It was serious, they were all nice–I met people with serious reputations online. I felt like they were respecting me as a fellow programmer–almost. I wasn’t one of them, but they really wanted to see if I could become one of them.

I did receive prompts to get through certain problems, but not overly so. I answered every question they asked. Some I answered better than others, but the ones I didn’t get right away, I had alternate solutions, and I understood where they were going as soon as they started talking about it.

Why I didn’t get the job

Well, companies these days won’t tell you why. I think they fear it opens them up to lawsuits. I think that’s silly. It prevents those of who really do want to learn and improve from knowing what we’re deficient in. Oh well. They told me that they thought I would do well at Google, but that it wasn’t a good fit at the time, and I should apply again in the future. (Of course, I didn’t apply in the first place.)

My suspicions, however, are that I lean too much towards Microsoft technologies. I do a lot of work in .Net. That’s where more and more of my experience is. I do consider myself very good in C++, but I’m doing more and more C# work. I’ve always been a Microsoft Windows developer.

I also am not really interested in web-centric technologies, and I told them so. I’m more interested in client apps on the desktop, and server apps.

Of course, it’s very possible I just didn’t answer the questions to their satisfaction–that I needed more prompting than I should have. Oh well.

It could also be that my GPA wasn’t what they wanted. I goofed off my freshman year of undergraduate work. I really hurt my grades. I came back, though, and got straight A’s for my last few years where I took the hard CS classes. I also got straight A’s in my Master’s program while I was working full time. I don’t think this was the issue, but it’s possible.

Lessons

  1. Having your own web-site is a no-brainer. Do it. Update and maintain it.
  2. Do personal projects. You must be passionate, you must love programming. You must be good at it. Not average. You must aspire to excellence and be working towards that.
  3. Know what you’re talking about it. Don’t show off–just display your knowledge as it applies to what they asked you.
  4. Use an interview with them as a learning opportunity and ensure you have a good experience regardless of the outcome.
  5. Don’t take the interview too seriously. Make sure that not everything rides on the outcome. You must be comfortable, confident. You must try for success in every possible way, but yet be completely prepared to fail–and have that be ok. This is a hard balance to achieve, but I think it can really make you have a healthy outlook and have a good time while still showing your best self.
  6. If you don’t get an offer, realize that even being selected for an on-site interview by Google puts you above the ranks of the average-good programmers. Google gets 1,500 resumes a day. You’re already in the < 1% percentile.
  7. Practice writing code by hand in a notebook. This helped more than I can express. Do stuff that’s hard that you don’t know how to do immediately. Time yourself. Make the problem more challenging. If you can’t stretch yourself, they will and you’ll probably break. They did not ask me to do any of the specific questions I had practiced–but the experience writing out and the THINKING is what helped.
  8. Be able to explain your background (90% technical / 10% personal) in a few words. At some point you’ll be asked.
  9. Have a lot of questions for people. You’re interviewing them too. Make sure they’re good questions. Asking about salary is not a good question before you’ve been made an offer.
  10. I let the interview build my own self-confidence. I have no doubt that I could walk into an interview anywhere else and it would be laughably easy.
  11. Don’t ignore obvious, simple solutions. Sometimes a table lookup is better than an O(n) algorithm.
  12. Bring a good, FUN book for the plane ride back. On the way, I focused on the interview, but on the way home I wanted to do anything but, so I had my current novel (Dickens’ Bleak House–very good book, by the way).

If you do all of those steps, it actually doesn’t really matter if you apply to Google or any other great/famous company–you’ll probably get the job you want for the pay you want anyway. Somebody, sooner or later, will come across you and give you the opportunity.

Great programmers will rarely, if ever, need to look for jobs.

I hope this long, rambling essay is helpful to some. I make no claim that my experience is typical or that I’m being completely objective. In other words, YMMV.

Read part 2 of this article


Check out my latest book, the essential, in-depth guide to performance for all .NET developers:

Writing High-Performance.NET Code, 2nd Edition by Ben Watson. Available for pre-order:

What I’m doing to become a better developer

There was a meme going around about 5 steps people will take to become a better developer. I’m not a famous enough blogger to get tagged, but I’ll share my 2 cents anyway. There’s nothing like publicizing something to make you committed: 

  • Read more source code from other projects (especially .Net projects)

Now that I’ve started my own large, non-trivial application, more problems quickly become apparent–how do you structure an application, handle communication? The overall infrastructure becomes vitally important. Unlike DocView in MFC, .Net does not have a standard MVC-style architecture to build on top of.

It makes no sense to iterate over and over to come up with patterns that others have already solved well.

Projects I want to look at: Paint.Net, RSS Bandit, SharpDevelop, Rotor, Mono

  • Become a refactoring fiend

It takes a lot of work, but refactoring code whenever you can/should really pays dividends. I’m doing this in my current personal project, and even though it’s taken a few hours to do some of the major refactoring, it was worth it because implementing new features becomes nearly painless once the structure of the code allowed it. It’s a little harder to do at work, but I have done a little. I want to take this to the next level by always taking the time to restructure the existing code whenever the opportunity presents itself. Thankfully, I’ve spent a lot of time developing unit tests. This will help me use design patterns more thoughtfully, as well as become familiar with some of the more esoteric refactoring patterns in Martin Fowler’s Refactoring.

There are too many good books to name, but those are two of the best ones. I go through books quickly. Some books are worth reading over and over until the concepts become part of you. Of course, for that to happen, you have to actually implement the ideas into your projects. I definitely learned things in Code Complete my first time through that I have made part of me–so much so, that I probably couldn’t tell you what they were. But I know I could do better.

  • Exercise

Huh? That’s not related to programming! au contraire! Self-improvement is a lot more than learning more about your field–it’s training your body and mind to be in better shape. If I feel better, I think better. Now that I have my iPod nano and all the podcasts I could want, I have no excuse not to exercise more than I do. I’ve been getting better, but I have a ways to improve. A healthy body directly correlates to a healthy mind.

  • Build more original Lego models

Another one that isn’t really about programming?! Not so fast. I’ve built Legos for a while, but rarely have designed and built my own models. That needs to change. I have 12,000 Legos–I need to be exercising creativity, design processes, and hard work to achieve some original results. And I want to have fun.

Some other things I want to do:

These are other things I’m interested in trying out this year, but don’t have specific goals in mind yet:

  • Look into WPF — maybe good for UI for my BrickBuilder project?
  • learn more about COM. This has been slowly fading on the priority list. Is there a good reason to learn about COM these days, other than legacy support?
  • Continuous integration — I want to know more about it, but not sure how it would fit into our scenario at work. Once we get our staging server up, it might be a better fit.

Check out my latest book, the essential, in-depth guide to performance for all .NET developers:

Writing High-Performance.NET Code, 2nd Edition by Ben Watson. Available for pre-order:

Fahrenheit 451

I just read the book Fahrenheit 451 by Ray Bradbury. This is the first time I’ve read it, never having come across it in school, like most people seem to. To me, it was the greatest argument against getting a TV. My wife and I decided towards the beginning of our marriage to never subscribe to cable TV. My parents never did while I was growing up. We will probably get a TV at some point, but it won’t be hooked up to anything but a DVD player.

The theme of the book was not exactly what I expected: I had always heard it was about government censorship, and it is–sort of. The more important theme running through it is the danger of intellectual laziness. It portrayed a world where various minority groups demand that offensive books be banned, eventually leading to the solution of burning nearly all non-trivial books (operating manuals and such).

The point is that the problem started with the people, not the government. They demanded softer forms of entertainment: TV in it current form, comics, music. And all of those media were dumbed down to the point of banality as well.

Those media don’t HAVE to be so mindless, but in their present form they largely are. Books that challenge or expand our thinking are crucial parts of our society and personal development. This is something I’ve been taught since a very young age–and it’s why I’ve got about 2,000 books in my home right now, waiting to be read or re-read, and why I can’t resist buying a new book almost every month!


Check out my latest book, the essential, in-depth guide to performance for all .NET developers:

Writing High-Performance.NET Code, 2nd Edition by Ben Watson. Available for pre-order:

Math Magic

I just started reading Scott Flansburg’s Math Magic book. It’s all about more efficient and intelligent ways of doing math. It’s an idea I’ve long wanted to try–to increase my speed and ability to crunch numbers in my head. The hard part is practice–how do you make yourself good at this without a lot of practice? And how fun is it to practice adding numbers in your head? It’s easy to think of some periodic situations: shopping and budget balancing, for example, but after that I’m not sure.

I think I’ll write a small PocketPC app that can give me random problems to solve in my head, as well as time me and note improvements. Cool…any excuse to write a program!


Check out my latest book, the essential, in-depth guide to performance for all .NET developers:

Writing High-Performance.NET Code, 2nd Edition by Ben Watson. Available for pre-order:

Infinite Enjoyment with Finite Resources

Have you ever thought about the miracle of music? OK, some might object to the world miracle, but I’m talking about music, something where transcendental terminology is appropriate.

On a piano you have 88 keys. Instruments can go higher (violin) or lower (organ), but with the same repeated 12-note octave everything in western music is created.

Thing about that. 12 notes, repeated over and over, at higher and lower frequencies. It’s such a small working set! How many melodies can you create in one octave?

More importantly, how many beautiful melodies can you create? Thousands of composers over thousands of years have proven that there is no limit to the originality possible with these limited tools. Of course, there are accompanying tools: instruments, rhythm, and personal style. But always with the same 12 notes.

And an infinity of beauty is possible because of it. Granted, our notions of what art is beautiful change over time, but who denies the beauty of War and Peace, Les Misérables, The Last Supper, Intermezzo from Cavelleria Rusticana, Jesu, Joy of Man’s Desiring, Pachelbel’s Canon in D, or anything by Rembrandt? Beauty grows, never shrinks.

Now imagine if there were infinite numbers of keys–how would that change things? What if we doubled the resolution of the notion of half-step (F toF#, for example) to a quarter step?* 8th step? 16th step? I don’t think this will inspire more creativity (at least not creativity that produces beautiful works of art). Too many options will spoil the landscape–clutter it up so much that not only can we not understand music produced like this, but creating it becomes onerous–there are way too many possibilities. The mathematical framework of music forces us to contain our creativity within bounds of structure that “make sense” to our minds, that allow us to understand, dissect, and enjoy.

The modern notion that lack of constraints promotes creativity is a false one. No constraints means less thought and feeling has to be put into work.

I hand you a canvas and tell you to paint your best work ever. What will you do?

You might ask–“What is the subject of the painting?” I respond–“Anything.”

You can’t work like that. Of course, you might come up with a theme yourself, but now you’re constraining yourself along a certain path.

Another example: in the 20’s Hollywood had no movie-making constraints. There were no censors. Do you remember many movies from the 20’s? In the 30’s, constraints were imposed by the government, forcing Hollywood to clean up its act. How many movies are memorable from the 30’s onward? A lot, even to my young mind. I think a case could be made that dissapearing constraints now is creating the same dull period in Hollywood that existed back in the 20’s. Sure, you can make anything you want, but who is actually going to care deeply about it?

Software development thrives under these conditions. Software developed with no or few constraints quickly looks like garbage and is much less useful. Impose coding constraints, design constraints, interface constraints–all these RULES you have to obey–and your code will become artful. Look in all the books on the subject of turning average programming into craftsmen, artists, what-you-will–the books mostly teach you RULES to follow, lines to stay within.

Coloring outside the lines is fun every so often, but you rarely frame it and call it art.

* Of course, continuous instruments such as strings can do this, but it’s not standard musical technique.


Check out my latest book, the essential, in-depth guide to performance for all .NET developers:

Writing High-Performance.NET Code, 2nd Edition by Ben Watson. Available for pre-order:

Narnia

At the Star Wars movie the other day, we happened to see the teaser trailer for the upcoming movie: The Chronicles of Narnia: The Lion, the Witch, and the Wardrobe.

The Chronicles of Narnia are perhaps some of the best books I have ever read. I read them as a young child, and reread them again a couple of years ago. They are wonderful stories in their own right, but they are so full of rich symbolism and meaning that they are eminently more enjoyable now.

My wife read the series after me and loved them as much as I did. She had tears in her eyes during the trailer. She wants to see it NOW. (It will be in theaters on December 9)

I hope the movie is a faithful rendering of the book. The creatures and effects are being done by WETA (of LOTR fame), so it will be spectacular in that regard. It’s also being shot in New Zealand. I think it’s a nice coincidence (?), given that Tolkien and Lewis were wonderful friends for much of their lives.

Something fascinating that I learned in biography of C.S. Lewis by A.N. Wilson is that Lewis is credited for pushing Tolkien to finish Lord of the Rings.

I just hope that they eventually decide to do all of the books. The stories are amazing, and the images I see in my head are only possible now with the magic of computers. The children they’ve picked for this movie look solid, too.

We’ve also been very fascinated with Lions as a result of the books.


Check out my latest book, the essential, in-depth guide to performance for all .NET developers:

Writing High-Performance.NET Code, 2nd Edition by Ben Watson. Available for pre-order:

Code Complete 2

I finally bought myself a copy of Steve McConnell’s Code Complete, 2nd Edition. I’ve read about a third of it so far and love it. It’s by far the most practical and useful book on programming I have ever read.

But how to learn it all? Sure, an experience programmer will pick up many of these ideas over time, but how can I start implementing ALL of them?

I think my plan is to read it through once, and then while I sit at my desk at work (or home), leave it open to a random page so I can think about the displayed topic.


Check out my latest book, the essential, in-depth guide to performance for all .NET developers:

Writing High-Performance.NET Code, 2nd Edition by Ben Watson. Available for pre-order: