Last month I was invited by Microsoft to an interview in their
largest european development center in Dublin. It was exciting trip and
real challenge to see the Microsoft development live. I was excited of
their professionalism in all directions:
Professional organization - phone interviews, invitation, flight, accomodation, etc.
Nearly perfect development process - like I read in the software engineering books
Very skillful developers and manager that interview me
Really professional way of conducting interviews
Challengeable product development
I was most excited on the people and process. I think this is what
makes Microsoft so successfull: brilliant people and solid engineering
Microsoft had a small fault. They didn’t ask me to sing any NDA
agreement, so I can share all the interview questions to help all other
candidates that want to join Microsoft.
Interview Questions @ Microsoft Dublin
I had 5 interviewers asking me lots of software engineering
questions. The questions were very adequate for the team leader
position that was my objective (”program manager” position in Microsoft
is senior technical position, like team leader in a typical software
development company). Interviewers was not only asking me to explain
some concept. They gave me a blackboard to write some code and to see
how I am attacking the problems, what types of pictures I draw, how my
thinking flows, etc.
I remember most of the questions and the answers I gave. I hope my
answers were good because I was approved and Microsoft sent me an offer
few days after the interview. Below are the questions with my answers:
Question 1: You need to architecture the security for a bank software. What shall you do?
There is not exact answer here. This is about thinking: follow the
exisitng standards in the banking sectors, establish global security
policy, secure the network infrastructure, secureg the application
servers, secure the database, establish auditing policy, securing the
operators workstations, secure the Internet and mobile banking, etc.
Think about authentication (smart cards), authorization, secure
Question 2: You are given a string. You want to
reverse the words inside it. Example “this is a string” –> “string a
is this”. Design an algorithm and implement it. You are not allowed to
use String.Split. After you are done with the code, test it. What will
you test? What tests you will write?
Elegant solution in 2 steps:
1) Reverse whole the string char by char.
2) Reverse again the characters in each word.
You need to write a method Reverse(string s, int startPos, int endPos).
Test normal cases first (middle of the word, beginning of the word, end
of the word, 1 character only, all leters in the string). Check bounds
(e.g. invalid range). Test it with Unicode symbols (consisting of
several chars). Perform stress test (50 MB string).
Write a method ReverseWords(string s). Test it with usual cases (few
words with single space between), with a single word, with an empty
string, with words with several separators between. Test it with string
containing words with capital letters.
Question 3: What is the difference between black box and white box testing?
Black box testing is testing without seeing the code. Just looking for incorrect bahaviour.
White box testing is about inspecting the code and guessing what can
go wrong with it. Look inside arrays (border problems), loops (off by 1
problems), pointers, memory management (allocate / free memory), etc.
Question 4: What is cross-site scripting (XSS)?
In Web application XSS is when text coming from the user is printed
in the HTMl document without being escaped. This can cause injecting
cookies, logging keyboard, and sensitive data (like credi card numbers).
Question 5: What is SQL injection?
SQL injection is vunerability comming from dynamic SQL created by
concatenating strings with an input comming from the user, e.g. string
cmd = “SELECT * from USERS where LOGIN=’” + login + “‘ and PASS=’” +
password + “‘”. if username has value “‘ OR 1=1 ‘;”, any login /
password will work. To avoid SQL injection use parametric commands or
at least SQL escaping.
Question 6: What is the most challengeable issue with multithreading?
Maybe this is the synchronization and avoiding deadlocks.
Question 7: Explain about deadlocks. How to avoid them.
Deadlock arise when 2 or more resources wait for each other. To
avoid it, be careful. Allocate resources always in the same order.
Question 8: Do you know some classical synchronization problem?
The most important classical problem is “producer-consumer”. You
have several producers and several consumers. Producers produce some
kinf of production from time to time and consumer consume the
production from time to time. We have limited buffer for the
production. When the buffer is full, producers wait until space is
freed. When the buffer is empty, the consumers wait until some
producers put something inside.
Practical use of the producer-consumer pattern is sending 1 000 000 emails (production) with 25 working threads (consumers).
Question 9: You need to design a large distributed
system system with Web and mobile interface. Through the Web customers
subscribe for stock quotes (choosing a ticker and time interval) and
get notified by SMS at their mobile phones about the price for given
tickers and the requested intervals. A web service for getting the
price for given ticker is considered already existing.
Use 3-tier architecture (ASP.NET, C# business tier, SQL Server
database). Use a queue of tasks in the business tier and a pool of
working threads (e.g. 100 threads) that execute the tasks. A task has 2
steps (query for the ticker price and send SMS). These steps are
executed synchronously (with reasonable timeout).
We have another thread that performs SQL query in the database to
get the subscriptions matching the current time and appending tasks for
We consider the SMS gateway is an external system.
Question 10: How you secure the stock quote notification system?
We need to secure all its parts:
1) The user registration process - need to verify phone number with
confirmation code sent by SMS. Need to keep the password with salted
hash. Need to keep the communication through HTTPs / SSL.
2) The application server with business logic. Secure the host, put reasonable limitations to avoid flooding the server.
3) Secure the database (e.g. Windows authentication without using passwords).
4) Secure the network (e.g. use IPSEC)
5) Secure the access to the Web service (WS Security).
6) Secure the mobile phone (e.g. sending encrypted SMS messages and
decrypt them with a proprietary software running on the phone).
Question 11: How you write a distributed Web crawler (Web spider)? Think about Windows Live Search which crawls the Internet every day.
You have a queue of URLs to be processed and asynchronous sockets
that process the URLs in the queue. Each processing has several states
and you describe them in a state machine. Using threads with blocking
sockets will not scale. You can still use multiple threads if you have
multiple CPUs. The Web crawler should be stateleass and keep its state
in the DB. This will allow good scalability.
A big problem is how to distribute the database. It is very, very
large database. The key here is to use partitioning, e.g. by site
domain. Take the site domain, compute a hash code and distribute the
data between the DB nodes based on the hash code. No database server
can store all the pages in Internet, so you should use thousands of DB
servers and partitioning.
Question 12: You have a set of pairs of characters
that gives a partial ordering between the characters. Each pair (a, b)
means that a should be before b. Write a program that displays a
sequence of characters that keeps the partial ordering (topolocial
We have 2 algorithms:
1) Calculate the number of the direct predecessors for each character.
Find a character with no predecessors, print it and remove it. Removing
reduces the number of predecessors for all its children. Repeat until
all characters are printed. If you find a situation where every
character has at least 1 predecessor, this means a loop inside the
graph (print “no solution”). Use Dictionary<string, int> for
keeping the number of predecessors for each character. Use a
Dictionary<string, List<char>> to keep the children for
each character. Use PriorityQueue<char, int> to keep the
characters by usign their number of predecessors as priority. The
running time will be O(max(N*log N, M)) where N is the number of
characters and M is the number of pairs.
2) Create a graph from the pairs. Use recursive DFS traversal starting
from a random vertice and print the vertices when returning from the
recursion. Repeat the above until finished. The topological sorting
will be printed in reversed order. The running time is O(N + M).
Question 13: You are given a coconut. You have
large building (n floors). If you throw the coconut from the first
floor, if can be croken or not. If not you can throw it from the second
floor. With n attempts you can find the maximal floor keeping the
Now you have 2 coconuts. How many attempts you will need to find the maximal floor?
It is a puzzle-like problem. You can use the first coconut and throw
it from floors: sqrt(n), 2*sqrt(n), …, sqrt(n) * sqrt(n). This will
take sqrt(n) attempts. After that you will have an interval of sqrt(n)
floors that can be attempted sequentially with the second coconut. It
takes totally 2*sqrt(n) attempts.
Question 14: You have 1000 campaigns for
advertisments. For each of them you have the returns of investments for
every day in a fixed period of time in the past (e.g. 1 year). The goal
is to visualize all the campaigns in a single graphics or different UI
form so the user can easily see which campaigns are most effective.
If you visualize only one campaign, you can use a classical
bar-chart or pie-chart to show the efficiency at weekly or monthly
basis. If you visualize all campaigns for a fixed date, week or month,
you can also use classical bar-chart or pie-chart. The problem is how
to combine the above.
One solution is to use a bar for each campaign and use different
colors for each week in each bar. For example the first week is black,
followed by the second week, which is 90% black, followed by the third
week which is 80% black, etc. Finally we will have a sequence of bars
and the most dark bars will shows best campaigns while the most bright
bars will show the worst campaingns.
I knew that I was approved even at the interview. It was a good sign
that the manager of the development in Microsoft Dublin for the Windows
Live platform Dan Teodosiu
personally invited me in his office at the end of the interview day to
give me few additional questions and to present me the projects in his
department. Dan is extremely smart person - PhD from Stanford
University, technical director and co-owner of a company acquired by
Microsoft few years ago. It was really pleasure for me to meet him.
There were 2 teams in Dublin that wanted to have me onboard: the
edge computing team working on Windows Live and the Office Tube team
working on video recording and sharing functionality for the Microsoft
Office. I met the manager of the Office Tube team at the end of the
interview day to discuss their products and development process.
I was Offered a Senior Position @ Microsoft Dublin
Few days later I was offered senior software engineering position at
Microsoft in Dublin. I was approved and the recruiters started to talk
with me about my rellocation in Dublin. Few days later I received the
official offer from Microsoft. It was good enough for the average
Dublin citizen but not good enough for me.
I Rejected Working at Microsoft Dublin
Yes, I rejected the Microsoft’s offer to work in their development
center in Dublin. The reason was that their offer was not good enough.
The offer was better than the avegare for the IT industry in Dublin. It
was good offer for a software engineer and if I got it 5-6 years ago I
would probably accept it.
I was working as software engineer for more than 12 years. I am
currentlty CTO and co-owner of a small software development, training
and consulting company and I am a team leader of 3 software projects in
the same time (two Java and one .NET project). In the same time I am a
head of the training activities and I manage directlty more than 10
engineers and of course I am paid several times better than the average
for the industry. In the same time I am part-time professor in Sofia
University. I am about to finish my PhD in computational linguistics. I
have share in few other software companies. All of this was a result of
many years of hard working @ 12+ hours / day.
In Bulgaria I was famous, very well paid, working at own company
with no boss, managing development teams and having very good
perspective for development. To leave my current position, I needed
really amazingly good offer. I got good offer, but not amazingly good.
That’s why I rejected it.
My Experience at Interviews with Microsoft and Google
Few months ago I was interviewed for a software engineer in Google
Zurich. If I need to compare Microsoft and Google, I should tell it in
short: Google sux! Here are my reasons for this:
1) Google interview were not professional. It was like Olympiad in
Informatics. Google asked me only about algorithms and data structures,
nothing about software technologies and software engineering. It was
obvious that they do not care that I had 12 years software engineering
experience. They just ignored this. The only think Google wants to know
about their candidates are their algorithms and analytical thinking
skills. Nothing about technology, nothing about engineering.
2) Google employ everybody as junior developer, ignoring the
existing experience. It is nice to work in Google if it is your first
job, really nice, but if you have 12 years of experience with lots of
languages, technologies and platforms, at lots of senior positions, you
should expect higher position in Google, right?
3) Microsoft have really good interview process. People working in
Microsoft are relly very smart and skillful. Their process is far ahead
of Google. Their quality of development is far ahead of Google. Their
management is ahead of Google and their recruitment is ahead of Google.
Microsoft is Better Place to Work than Google
At my interviews I was asking my interviewers in both Microsoft and
Google a lot about the development process, engineering and
technologies. I was asking also my colleagues working in these
companies. I found for myself that Microsoft is better organized,
managed and structured. Microsoft do software development in more
professional way than Google. Their engineers are better. Their
development process is better. Their products are better. Their
technologies are better. Their interviews are better. Google was like a
kindergarden - young and not experienced enough people, an office full
of fun and entertainment, interviews typical for junior people and lack
of traditions in development of high quality software products.
Just realized I do have something to add…
Ok so, being a hotshot MBA (almost) and all, I applied to Google,
just for the heck of it, coz they were hiring for Google India. I
applied for the role of Account Manager in Delhi, and Product Manager
So I get a nice e-mail from the HR person in Google Bangalore saying
I have been selected for a phone interview with a Google Dude, who will
be calling me from Mountain View, California (Google HQ).
My first reaction when I got this e-mail was.. “OH SHIT!”. While
most people would be happy, I’ve heard that Google asks some the worst
questions out there. I mean they really try to screw you. Apparently.
Well they didn’t really try to screw me. I was just terribly
unprepared, and so couldn’t answer the questions they had. What did
Well, i was being interviewed for a role regarding Google’s AdWords.
What are AdWords? Those little tiny ads that appear on the side, and
along the top of Google’s search pages, are displayed based on the
keywords you enter into the search bar. AdWords also powers the ads
that appear in Gmail. Anyhoo, he asked me if I knew what AdWords were,
and I said kind of, and then he asked what they were, and I blabbed
nonsense till the point where the interviewer had to break it down for
me in chunks, i.e. “If you were starting afresh - where would you place
ads on the page?” and then “How would you determine which ads can make
it to the top of the search listings, or which ads appear first”.
Y’argh, I struggled with these basic questions big time. Lesson #1 - PREPARE PREPARE PREPARE!
Then the next question asked went as follows, and I quote now:
Imagine it’s 1996. You are working for Microsoft.
Bill Gates comes up to you, and he says there’s this new company called
Netscape that is up-and-coming and he’s worried it will kill Microsoft.
So he asks you destroy Netscape, and you come up with IE4 and hand it
out for free and kill Netscape
Now fast forward to 2001. Bill Gates comes to you again and says
there’s this company called Google, which is up-and-coming, and may be
a threat. He says he wants you to destroy Google. How would you do it?
(Legally, of course).
Naturally, this questioning is asking you to figure out where Google
makes its money, and what its weaknesses are if any. I answered this
question very poorly as well, but it was agonising, both for the
interviewee and interviewer, having drag all this shyte out of my
mouth. I have to say, the interviewer was a tad bit rude in his tone,
but then, considering how dumb I was, I’m not surprised.
Finally, the dude asked me if I knew what a “session” was (in terms
of web programming). But I was just so dulled and drained from
everything else I couldn’t even answer that. So there ends the Google
Tags: failed |
Posted by Admin
3/9/2005 12:28 PM |
Back in late 2001, after I lost my job with Tellme,
I looked for work at, among other places, Google. I had long been
impressed with Google, which by all accounts offers a great working
environment. And like me, they were also in Mountain View. I submitted
my resumé and a recruiter contacted me and said they had a Junior
position available, and the salary would be about 2/3 what I had been
making at Tellme, where I had worked as an underpaid technical lead. I
explained that I was more interested in and better qualified for some
of the more senior job postings they had open on their web site. “Well,
this is the position we have available,” was the ultimatum offered by
the recruiter. I politely declined.
Two months later and it was very clear to me that the job market was
terrible, and that if Google was willing to talk to me about a junior
position, that was far better than the stresses of being broke and
idle. I contacted the recruiter and she set up a phone screen, which
was followed by an on-site interview.
What ensued is one of the great failed opportunities of my life. I had recently wrecked my car, so I biked up to Google. So, of course, I didn’t dress up nicely, (which doesn’t matter much.)
And while I liked Google, I wasn’t super excited at how they could only
consider me for a junior position, and the pay that had been mentioned,
well, that had been way too low. Worse yet, I had become depressed by
my recent poor fortunes and I had not yet caught on to this fact. It
was actually ten days after September 11,
and while I confidently aced all of the technical questions, the second
interview, with my would-be manager, where I was asked the vexing
questions of motivation, etcetera, well, I flubbed those, bad. I must
have answered that I wasn’t sure that I wanted the work, especially if
all they had was just the one low-paying junior position. I had a
serious bummer going on and it came through in the interview, and the
following week, the recruiter informed me that they could not hire me
because I would not be satisfied with their position.
The phrase that I hung on was “well, we’re concerned that you would
take this job for now, and then leave when the economy improves.” Even
in 2001, it didn’t take an advanced degree from Stanford to figure out
that a position at Google was something one would not take casually,
and that there should be opportunities for job growth. I had never
taken a professional job just to bide my time. I was used to being
underpaid, and loyal. I crafted an e-mail to the recruiter,
collaborating with my friends, detailing with great honesty my recent
job history, and how it had meshed with my character, begging them to
reconsider — after all, if I really did not want the job, I would not
have asked for an interview!
I have since had the occasional phone screen a few times with Google. They really seem to enjoy asking me how traceroute works.
At one point they nearly flew me in from Illinois for an on-site
interview, but when it came time to line up my trip, they went silent
for a week and then got back to me that they had found a local
candidate, but that if I’m ever in town they could speak with me
informally. Google has long been a tease of a company that plays with
my emotions. In the past year or two, Google has hired a handful of
people I know, including a woman I used to have a crush on. It recently
flew two of my friends to India for one month each, making me jealous!
They get to work at Google and Google sends them to an exotic
developing country! But that is Google, always taunting me from just
beyond my reach. Like an old crush, Google is the hottie that will
occasionally talk to me, but nothing will ever come of it, in part
because I manage to find contentment and serious commitment elsewhere.
All the same, who can resist gossip? I recently learned of Mark Jen,
who left Microsoft for Google in January. He immediately immersed
himself in one of Google’s features, Blogger, to blog about his exciting new employment experience.
He made a mistake that is common among honest people who start blogs,
which is that they express too freely and honestly their opinions of
those close to them. In this case, he spoke too easily of Google, which
Google found disturbing. Like a paranoid girlfriend who thinks she
hooked a freak, Google soon terminated him, without so much as explaining why.
“At first, they beat around the bush,�? Jen said. “But
then they told me my blog had upset people and that I wasn’t a good
fit. I asked them if there was anything I could do to change their
minds, but it was a one-sided conversation.”
Now, this is totally not my business, but we are all interested in
the secretive goings-on at the all mighty Google, and as I have
explained, Google’s hiring practices have long been of interest to me.
This Mark Jen guy is probably pretty smart. Getting hired at Google is
no mean feat, nor is getting hired at Microsoft. Apart from only using
lowercase letters in his blog, Mark doesn’t strike me as a culturally
dysfunctional person. He did post some material to his blog saying that
Google’s numbers looked really good, which he had to remove, out of
concerns with SEC regulations. And yes, it would have served him well
if he had been a little less ethusiatic about starting a blog and
talking about his new employer given that blogs are all the rage these
days, and his new employer is especially coy.
On the other hand, they had the guy relocate to San Francisco, and
then dropped him a few weeks later. It reminds me of the time they were
prepared to fly me out, but wanted to know if I would be content to
work as a contractor - I assume, so they could dispose of me more
easily. (California law says you can fire somebody at any time for any
reason, but you’ll end up paying more in unemployment insurance, and
you may be liable for 60 days severence pay. To my knowledge,
contractors do not incur these liabilities.) I have recently completed
my second relocation to the Bay Area, and even with assistance, it does take a serious toll on your bank account,
nevermind the logistics and the need to make new friends. I certainly
hope Mark got his two months severence, because even with California’s
generous Unemployment Insurance benefits, rent around here is not cheap.
But, the Google enigma still traps my thoughts. Early on, Mark
contrasted Microsoft’s unwillingness to change its historical ways of
doing things, compared to Google’s culture of merciless innovation:
I remember when I was at Microsoft, I’d propose trying
new engineering practices . . . these ideas were shot down quickly and
the response was always “we’ve been developing software like this for
20 years and look at where we are: $50 billion in the bank, dominance
in multiple markets… we’re one of the most successful businesses in all
of history. Why would we change the way we make our bread and butter?”
Contrast that to Google, where reinvention is almost in its blood.
there’s no remorse about throwing away dead code; people work however
they feel makes them most productive.
And while I can accept that Google employees should be, and in my
experience are, circumspect in talking about what enchanting things
they are toiling to unleash upon the world, it seems a little weird
that their corporate culture would have such a violent reaction to some
naive newcomer who takes too easily to blogging about life at Google.
reported that “Mark Jen started asking around about Google’s policy on
blogging (it turns out there was none) and reread the non-disclosure
agreement he had signed on the first day.” Gelf goes on to explain that
other large technology companies have employees who blog about their
work. (Microsoft even seems to encourage it.)
“But Google is different. Even their PR people—who are trained to get
publicity for the company—are secretive about the goings-on inside the
Googleplex. Google representatives declined to comment for this
article, beyond stating that Jen is no longer a Google employee.”
It begs the question . . . if Google is all about reinvention, why
does it have such a hard time talking about itself? Or, more to the
point, why does it have a hard time with its employees talking about
their work environment? I learned from Mark Jen that the culture of
innovation does seem to be alive and thriving at Google. I learned, as
is common knowledge, that the pay isn’t so great, and the stock is less
of a perk now that it is so expensive. I heard, as I have heard before,
that Google throws great parties for it employees. Yes, anyone who has
had an employer provide meals and other on-site services understands
that the “free lunch” is there to boost productivity. I thought it was
pretty neat that Google provides a bunch of shuttle buses from San
Francisco that have wireless Internet. I have a hard time seeing why
they shouldn’t notice an “innovation” on the part of a new employee,
and work with him to channel it advantageously. Public Relations and
Recruiting are important channels for Google to innovate and excel at,
as much as Engineering and Operations. Mark wasn’t some loose cannon
whoring out the embarassing details of Google’s cloistered culture . .
. he was an eager, fresh young face who just moved to town and thought
he’d try blogging . . . about something interesting.
At any rate, Google will do what Google will do. For now, they don’t want us to know much. And that is fine with me, for I don’t work for Google, and my own employeer has plenty of work for me. Pretty soon, Mark’s new patron
will have new things to occupy his thoughts. Life goes on, but every
now and then, some strange tales of Google will escape from Mountain
View, and those of us who have ever taken a special interest in the
matter will pause to observe and say “dude . . . WTF?”