Thoughts on Software Engineering

Rejected a Program Manager Position at Microsoft Dublin – My Successful Interview at Microsoft

Microsoft DublinLast 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 managers that interview me
  • Really professional way of conducting interviews
  • Challengeable product development

I was most excited on the people and the development process. I think this is what makes Microsoft so successfull: brilliant people and solid engineering process.

Microsoft made a small negligence: they didn’t ask me to sign any NDA agreement, so I can share all the interview questions to help all other candidates who 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 a senior technical position, like a team leader in a typical software development company). Interviewers were not just asking me to explain some technical concept or propose a solution to some real-world problem. They gave me a blackboard to write some code in order to see how I am attacking the problems, what types of pictures I draw, how exactly my thinking flows, etc.

I remembered most of the interview questions and the answers I gave. I hope my answers were good because I was approved and the recruiter from Microsoft sent me a job offer few days after the interview. Below are the questions with my answers:

Interview Question 1: You need to architecture the security for a bank software. What shall you do?

There is no exact answer here. This question is about thinking: follow the existing standards in the banking sectors, establish global security policy, secure the network infrastructure, secure the application servers, secure the databases, establish auditing policy, securing the operators’ workstations, secure the Internet and mobile banking portal, etc. Think about authentication (smart cards), authorization, secure protocols, etc.

Interview 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 will you write?

I knew an 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 str, int startPos, int endPos).
To test this method 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 ranges). Test it with Unicode symbols (consisting of several chars). Perform stress test (e.g. 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.

Interview 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 behaviour.

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.

Interview 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 JavaScript code in the client’s web browser, accessing the session cookies, logging keyboard, and sensitive data (like credit card numbers).

Interview Question 5: What is SQL injection?

SQL injection is vulnerability comming from dynamic SQL command text 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 parameterized commands or at least SQL escaping.

Interview Question 6: What is the most challengeable issue with multithreading?

Maybe this is the synchronization and avoiding deadlocks.

Interview 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.

Interview 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).

Interview Question 9: You need to design a large distributed system with Web and mobile front-end. 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 SMS notification.

We consider the SMS gateway is an external system.

Interview 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).

Interview 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.

Interview 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 (topological sorting).

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).

Interview Question 13: You are given a coconut. You have large building (n floors). If you throw the coconut from the first floor, it can be broken or not. If not you can throw it from the second floor. With n attempts you can find the maximal floor keeping the coconut intact.

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.

Interview Question 14: You have 1000 campaigns for advertisements. 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 campaings.

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 a senior software engineering position at Microsoft in Dublin. I was approved and the recruiters started to talk with me about my relocation 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 average 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 currently 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 directly 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 thing 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 really 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 Seems Like a 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 kindergarten – 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.

Previews (95,836), Views (75,535), Comments (36)

36 Responses to “Rejected a Program Manager Position at Microsoft Dublin – My Successful Interview at Microsoft”

  1. maryam moradi says:

    I want to work in microsoft,i am a c# programmer
    what skills i should know to learn about them .of cource
    please help me , of cource i am having khowledge in wcf , socket programming
    and pass a course about Design Pattern.


  2. nakov says:

    Hello, just some technologies are now enough. You should have very deep understanding in algorithms, software architectures, logical thinking, etc. I am not sure, but your writing style, full of punctuation mistakes, will not be a plus.

  3. […] Svetlin Nakov – Blog » Rejected a Program Manager Position at 15 Mar 2008. Interview Questions @ Microsoft Dublin.. It was a good sign that the manager of the development in Microsoft Dublin for the Windows Live Svetlin Nakov – Blog » Rejected a Program Manager Position at […]

  4. Sneha Dua says:

    Answer to 13th Q is wrong. best answer is if you start from 14th floor and then 27th and 39th and 50th…60th, 69th, 77th, 84th, 90th, 95th, 99th..

    In your answer, worst case is 20 attempts. But in my case, its 14!

  5. Good job! Congratulations on your interview, you sure did great. Microsoft is a big company to work for so I wish you good luck.

  6. I believe that even skillful Senior QA Engineer have to able or should be to answer those questions.

  7. R says:

    Given the answers ms offer seems fair enough

  8. R says:

    Maybe it is worth mentioning you screwed 6 – 9.
    My reading is that you didn’t score well on 6, and 7-9 came as hints (leading questions) from the interviewer to finally figure out what he/she was looking for at question 6.

  9. Dhanashri k says:

    Good post! Your observations about microsoft and google are head on. I had the exact same experience about these. Ms people are impressively proffessional!

  10. Average Coder says:

    “Their engineers are better. Their development process is better. Their products are better. Their technologies are better.”

    Bing is better than Google Search? PubCenter better than Google Ads? Hotmail better than GMail?

  11. g12323 says:

    Naaakov Naaakov guy again myths and legends for explaining to yourself the “truth” 😉 … They did not approve you right ? You should change your way of thinking and lesser your ego 😉 … No one cares about your proffessional experience … “overqualified” – bulshits 😉 You know that many software developers in Bulgaria have much much more experience in all the mentioned from you areas and none of them is like you – exaggerating and not saying the truth

  12. g12323 says:

    Абе с 2 думи издънка и пяница си … И такъв ще си останеш … А и от математика нищо не отбираш затова не си могъл да решиш задачата с етажите по оптимален начин :)

  13. Hey I know this is off topic but I was wondering if you knew
    of any widgets I could add to my blog that automatically tweet my newest twitter updates.

    I’ve been looking for a plug-in like this for quite some time and was hoping maybe you would have some experience with something like this. Please let me know if you run into anything. I truly enjoy reading your blog and I look forward to your new updates.

  14. It’s remarkable to visit this website and reading the views of all mates concerning this paragraph, while I am also eager of getting knowledge.

  15. Valentina says:

    It’s hard to find experienced people in this particular topic, however, you sound like you know what you’re talking about!


  16. Web site says:

    Terrific work! That is the kind of information that should be shared across the net.
    Shame on Google for not positioning this submit upper!
    Come on over and visit my website . Thanks =)

    Feel free to surf to my web page Web site


    Rejected a Program Manager Position at Microsoft Dublin – My Successful Interview at Microsoft | Svetlin Nakov’s Blog

  18. This is a great tip especially to those new to the
    blogosphere. Short but very accurate information… Many
    thanks for sharing this one. A must read post!

  19. Hurrah, that’s what I was looking for, what a stuff!
    present here at this website, thanks admin of this
    web site.

  20. Zachery says:

    Magnificent web site. A lot of useful information here.
    I’m sending it to some buddies ans also sharing in delicious.
    And of course, thank you on your effort!

  21. click the following website

    Rejected a Program Manager Position at Microsoft Dublin – My Successful Interview at Microsoft | Svetlin Nakov’s Blog

  22. maid says:

    Hello exceptional website! Does running a blog such as this
    take a lot of work? I have absolutely no understanding of coding however I was hoping to start my own blog
    in the near future. Anyhow, should you have any recommendations or tips for
    new blog owners please share. I know this is off subject but I
    just needed to ask. Thanks a lot!

  23. Arron says:

    The district always the romantic idealists say that out of 186
    schools 46 of them showed an increase in students scoring proficient
    in reading and 25 schools showed an improvement in math.
    In her plea agreement, Van Thu Tran admitted that in August 2002, she and her co-conspirators Phuong Quoc Truong, Tai Khiem Tran, and others created a criminal enterprise defined in the indictment as the Tran Organization, based in San Diego and elsewhere,
    for the purpose of orgnaized cheating at gambling casinos across the United States.
    In 2001, Christine Cooper of North Carolina, won a $2,000,000 judgment against her
    husband’s lover.

  24. Hi, I want to subscribe for this web site to get newest updates, so where can i do it please help

    Here is my website … pure garcinia cambogia extract
    ingredients (

  25. Everything is very open with a really clear explanation of the challenges.

    It was really informative. Your website is very useful. Thank you for

  26. Excellent post. I was checking continuously this weblog and I am inspired!

    Very helpful info specifically the final phase
    :) I deal with such information much. I used to be looking for this particular information for a very long time.
    Thanks and best of luck.

  27. zam says:

    Hi author. Just judging from interviews for one position, do you think it’s logical to conclude that Microsoft is a better place to work? I leave that to you.

    I have interviewed at Microsoft for 3 different positions and also worked there as FTE. Also interviewed at google once. You have no idea how wrong you are in jumping to this conclusion.

    Further I would like to correct you that program manager job at MS is not a team leader position in any way. Developers and testers at MS would be unhappy to hear that. People who actually got working experience at the companies know that MS has a pretty well defined organizational structure. Every team consists of 3 sub teams that is developers,testers and PMs. All have saber levels of career. Developers have their own devlopment leader, testers got their own test lead and PMs got their own PM lead. A developer or tester at junior level would be if Dane grade as of a junior PM.

    Further google doesn’t hire everybody as junior engineer. Their interviews are focused at algorithms and data structures, that’s true. These days Microsoft also interviews the same way at most places of the world. Further google would give you the offer based on their interview results. If they offered you junior position, it means you didn’t qualify to be their senior level engineer.

    Don’t meant to offend you. Just wanted to state the truth so that readers of your blog are not misguided.

  28. Though they may seem like a bunch of words put together, but their length does not influence their effect.
    You will find portable ice machines extremely handy here.
    When dealing with a water-based rink, a
    lot of upkeep in required.

  29. My legs and my bottom seem more toned which is good’.

    There’s no point in planning what you’re going to say beyond this point, because who knows how your conversation will go.
    Centre ice spot, which is a blue spot in the most middle of
    red midcourt line.

  30. chestnut hill orange va

    Rejected a Program Manager Position at Microsoft Dublin – My Successful Interview at Microsoft | Svetlin Nakov’s Blog

  31. how to find an HVAC company

    Rejected a Program Manager Position at Microsoft Dublin – My Successful Interview at Microsoft | Svetlin Nakov’s Blog

  32. Anonymous says:

    I’ll just say that Google Zurich is full of young inexperienced people. There are other Google offices in Europe that have more experienced people.

    That said, I congratulate you for rejecting both, I am sure it is the best choice you could have done. I myself has moved on from Google.

  33. Josie says:

    I think you hit a buylsele there fellas!

  34. tuple says:

    Наков, за толкова години не можа да научиш английски като хората. Срамота.

  35. Antoan says:

    Interview Question 13:
    I think there is another more efficient way to solve this problem. I will give simple example with the steps when we have 100 floors:
    If it breaks at 15th floor, you have made 1 try and you have 14 more -> 15 total
    If it breaks at 29th floor, you have made 2 tries and you have 13 more -> 15 total
    If it breaks at 42nd floor, you have made 3 tries and you have 12 more -> 15 total
    You got my idea. 15 is better than 19(worst case in your decision).

RSS feed for comments on this post. TrackBack URL