2007 04 30

I would like to get the feedback of students with whom I’ve worked this academic year. Please click on the relevant link:

I need your feedback to become a better lecturer. And there are only 6 easy questions to answer. And, naturally, this process is 100% anonymous.

Please pass this message to your friends! And, naturally, whatever you say, whether positive or negative, will remain private…

Popularity: 1% [?]

written by avinash

2007 04 29

… and the Google hiring committee has decided that (I quote) “[I am] not a strong match for [the] position [they are offering]“

Chronologically, this is what happened.

28 March 2007: First contact

Google sent me a mail asking me if I would be interested in exploring opportunities in their Site Reliability Engineering (SRE) team. They had found my CV online and were keen to talk to me (I guess they used Google to find me :-) )

The SRE team members run the Google.com website as well as a number of other websites and they only employ people with very extensive knowledge of networking, Linux and programming.

I was extremely flattered to be contacted by Google. I knew, nevertheless, that the Google interview process was tough. And I couldn’t help thinking that (i) I am not an expert in networking and (ii) even though I know Linux and programming pretty well, I am neither a Linux administrator nor a software developer…

But I was ready to give the interview process a try and I replied affirmatively.

6 April 2007: First phone call

I got a first phone call from Mountain View, California, at 11pm(!) and, during our 45-minute conversation, I was asked a number of non-technical questions as well as three relatively straightforward technical questions on networking and Linux.

It was a positive experience for me and a few days later I got an email telling me that I did well enough.

26 April 2007: Second phone call

I was called by an engineer of the SRE team from Dublin, Ireland. We had a 1-hour conversation and I was asked a number of questions on networking (lots), Linux (some) and programming (two small programs to write).

Personally, I thought I replied well enough (as far as I know).

28 April 2007: Last email

I got an email from Google yesterday basically telling me that “[I am] not a strong match for [the] position [they are offering]“ that is, as an engineer in the Site Reliability Engineering team.

This is how I feel about the whole experience.

Negatives

  1. I was not offered a job at Google.
  2. It was a stressful experience.

Positives

  1. I was contacted by Google! It’s tough to explain how dreamy this feels…
  2. I’ve been through the Google interview process. In a few months, I’ll apply for a more adequate job at Google (more in line with what I am really good in) and I’ll be better prepared.
  3. I’ve realised that I need to do more real (as opposed to academic) programming and I need to administer more Linux servers and face more complex issues. Consequently I’ve decided to start working on a secret software development project (watch this space…)

Thanks to all of you who have encouraged me (family, colleagues, students and friends).

And thanks Google (specifically Cecilia, Erika, Andrew and Nikesh) for the experience :-)

Popularity: 2% [?]

written by avinash

2007 04 20

I am a fan of functional programming. I find that paradigm extremely elegant and expressive. I used Scheme when I started university and I was happy. I discovered the Haskell programming language some years ago and it was love at first sight.

According to the official Haskell site,

“Haskell is a general purpose, purely functional programming language featuring static typing, higher order functions, polymorphism, type classes and monadic effects.”

This is a mouthful but is actually a good description of the language. One essential feature of Haskell is its typing system: Haskell features static typing but types are never specified explicitly but are always inferred by the compiler!

Another “feature” is the absence of variables. Yes, you don’t have any variables (i.e. something that can change its value) in Haskell. And if you think about it it’s also the case in SQL, Prolog, XSLT, etc.

Hugs 98 is a nice and easy Haskell programming environment ideal for beginners. GHC is a state-of-the-art Haskell compiler which regularly produces executables that run faster than programs written in C! Both are multi-platform and open source.

Ok. I hope you are salivating. And, cerise sur le gateau, the Haskell syntax is beautiful.

Here is our old friend Quicksort:

quicksort [] = []
quicksort (x:xs) = quicksort [ y | y<-xs, y<x ]
    ++ [x]
    ++ quicksort [ y | y<-xs, y>=x ]

Quicksorting an empty list gives an empty list. Quicksorting a non-empty list (which can always be written as an element x followed by a list of xs (get it?)) is the Quicksort of all elements from xs which are less than x (the pivot) followed by x followed by the Quicksort of all elements from xs which are greater or equal to x. Beautiful isn’t it? In case you don’t think this can be an actual program, you are not alone (read part 7 Lessons learned)

A more involved example is this program I wrote some years ago:

data Tree = Empty | CreateTree Integer Tree Tree

flattenInfix Empty = []
flattenInfix (CreateTree v l r) = flattenInfix(l) ++ [v] ++ flattenInfix(r)

flattenPrefix Empty = []
flattenPrefix (CreateTree v l r) = [v] ++ flattenPrefix(l) ++ flattenPrefix(r)

flattenPostfix Empty = []
flattenPostfix (CreateTree v l r) = flattenPostfix(l) ++ flattenPostfix(r) ++ [v]

insert x Empty = (CreateTree x Empty Empty)
insert x (CreateTree v l r) =
    if x<v then CreateTree v (insert x l) r
    else CreateTree v l (insert x r)

putLeft Empty Empty = Empty
putLeft Empty a = a
putLeft a Empty = a
putLeft a (CreateTree e l r) = (CreateTree e (putLeft a l) r)

remove x Empty = Empty
remove x (CreateTree e l r) =
    if x==e then putLeft l r
    else if x<e then (CreateTree e (remove x l) r)
    else (CreateTree e l (remove x r))

which implements a binary search tree with a number of common operations (three kinds of flatten, insert and remove). Read the code. I’m sure most of you will understand it much more than the equivalent C or C++ program…

The binary tree can be used like this:

tree = (CreateTree 20
    (CreateTree 10
        (CreateTree 5
            (CreateTree 1 Empty Empty)
            (CreateTree 7 Empty Empty))
        (CreateTree 15 Empty Empty))
    (CreateTree 30
        (CreateTree 25 Empty Empty)
        (CreateTree 35 Empty Empty)))

> flattenInfix tree
[1,5,7,10,15,20,25,30,35]

> flattenInfix (insert 4 tree)
[1,4,5,7,10,15,20,25,30,35]

> flattenInfix (remove 30 (insert 4 tree))
[1,4,5,7,10,15,20,25,35]

> flattenInfix
*** Expression : flattenInfix
*** Of type : Tree -> [Integer]

Do you see that Haskell has inferred that flattenInfix is a function which takes a Tree and returns a list of Integers! Can you see why?

Welcome to the world of Haskell!

Popularity: 11% [?]

written by avinash