Tags: , | Posted by Admin on 12/1/2009 10:32 AM | Comments (0)
Comparison of Internet searches for "Google interview questions" vs. "Microsoft interview questions." Source: Google Insights for Search, December 2008 to November 2009
Tags: , , | Posted by Admin on 3/15/2008 5:16 AM | Comments (0)
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 process. 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 protocols, etc. 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 JavaScript code in the client’s web browser, accessing the session 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 SMS notification. 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 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). 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 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. 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. Original story
Tags: , , | Posted by Admin on 3/21/2007 12:11 PM | Comments (0)
As promised, here follows what I hope will be an interesting overview of my interview experience as an intern candidate at Google, Microsoft and Apple. Google My interview at Google was probably the most unusual of the bunch. A long time ago (Almost a year), one of my friends in the fellow reverse-engineering community contacted me about a job opporunity at a Google office in Montreal, working on a top-secret project, but which was related to my knowledge. I got to the phone screens, and had a great first interview. My second interview however didn’t go so well. It was the first time my interviewer was ever screening a candidate, and he kept me stuck on a single question. The question was related to a low-level structure change in a private datatype used in Vista’s kernel; this change was documented in a patent, which I always found fishy as an interview question. Nevertheless, I believe I answered correctly some of the more generic implementation details, but the interviewer kept coming back on the same question and seemed like he wanted to hear a precise answer. Additionally, it didn’t seem like the project was fully related to my field of experise; unsurprinsingly, I got a refusal letter two weeks later. Fast forward eight months later, and the DRM hacking news appears on the Internet. I get a call from Google the day after about setting up some interviews. My interviews get cancelled a couple of days later, then rescheduled for Monday, after my return from the SCALE 5X talk. I have a short (and very interesting) conversation with someone at Google would probably end up being my boss/mentor, and I get news a couple of days later that I got the job. And that’s about it. Job Description: Security/Software Engineer/Developer. Code Auditing plus Windows Internals consulting/special projects. Phone Screens: 1 Campus Visit: No Apple My path to Apple was a long and ultimately rewarding one. I attended CUTC last January, already with knowledge that I would be interviewing with Microsoft later. Therefore, I avoided most of the smaller booths, avoided Microsoft since I already had an interview, as well as Google since, at the time, I had not received the phone call about a new opportunity. The only company that I still had some interest in during the job fair was Apple. This is mostly because during the day, I attended two sessions on Apple Development Tools. The first one was on Shark, which completely amazed me. There were lots of technical questions during the presentation, and I was always the only one answering them correctly, so the Apple people noticed me and asked me to come for a chat. I went to see them, and handed in my CV. The Apple recruiter was mostly looking for people to work on the Ipod or Mac stuff, so my Windows Kernel experience didn’t seem relevant at first. My friends got calls from Apple during the days after, I didn’t. I gave up on the opporunity since I thought they wouldn’t be interested. Two weeks later, I get a call from the recruiter saying she passed on my information to the OS X Kernel Team. After the DRM news, the Security Team gets interested as well. What followed after was the most exhausting interviewing process I’ve been through. Because Apple couldn’t fly me in (I don’t think they do that for non-local candidates), I had to go through the equivalent of the Microsoft interview process, but over the phone. Since I was actually interviewing with two teams, double the amount of time and people for an accurate depiction. In total, I believe I spoke with 9 or 10 Apple developers, managers and testers on both teams. The questions were very technical, but not in the “optimize this algorithm” way. The engineers there seemed to be genuinely interested in my ideas, thought process, and solutions/problems I could find to various designs. One question I was asked, which I think I can share, is how a Hypervisor Rootkit would be more dangerous then a normal Kernel Rootkit, how to protect against that, as well as how to create a workable Hypervisor Patchguard-like system, what to look for, how to discriminate against the OS touching critical data, and malware, etc. There also of course the general ReactOS/TinyKRNL questions as well as questions on my interest for the job/company. I felt exhausted at the end of about the 1-2 weeks this process took, but I thought I had done very well on all the interviews. During my talk in Waterloo, I got a call saying I got offers from both teams, and had to choose one. I chose the Core OS kernel team, and received my offer in the mail a couple of days later. Job Description: Kernel Developer. Working on various Darwin/OS X related undisclosed projects. Phone Screens: 6, some were conference calls with multiple people on the line. Campus Visit: No Microsoft My path at Microsoft started through various friends and contacts that I’ve made a the company in the last few months thanks to my security-related research and presentations/papers. They saw in me a really good candidate for the various security groups at Mircrosoft, and also on the actual NT Kernel Team. The interview process at Microsoft was both disappointing and amazing. First off, it started with a pretty technical phone screen. Unforunately, my screen was on SQL, which I knew absolutely nothing about. However, my interviewer was very understanding, gave me a couple of hints, and I was able to identify and solve issues with “cursors”, something I had never even heard of. I was also asked some more generic and personality questions, and I my opinion of the interview was that I did decently. I was also interviewed by one of the most prominent figures in SQL, working on the Core SQL Engine Group at Microsoft, and someone I deeply respect. This interview let me to an actual invitation for a campus interview. This is where the disappointing part starts. My phone screen was sometime in October or November. It took about two months, by email, to get an actual interview date, and it ended up being in March. Therefore, even though Microsoft was my first confirmed interview, in the time frame that it took the mto set something up for me, Apple and Google had the chance to hear about me, contact me, interview me and both send me offers. This created a very difficult problem for me in terms of various deadlines that the other offers had to meet. All in all, I didn’t feel that my RC (Recruiter Coordinator) was very communicative with me, and I had to rely on my connections inside the company to figure out what was going on. Contrast this with Apple which had everyone on their team calling me (which greatly raised my interest in the company) and even Google, who had one of their top engineers chat with me on the phone, and both companies kept in touch by email and phone relating my status, offers, interviews, etc. Microsoft’s replies, when available, were always robotic and template files. However, this disappointement quickly faded away once I got on campus. Microsoft has the most amazing interviewing experience. First of all, not only do they pay all your expenses, you also get a generous amount of money to spend during your daily activites, and you’re encourage to stay more then one day. Taxis are included, up to 75$ of food per day is included, museum visits, sightseeing, long-distance calls, Internet access and more are all free perks you get. Additionally, before your rounds start, Building 19 has various computers, big-screen TVs and XBOXes to fill up your time. You can also visit the campus, and even go see the Microsoft Museum, which has some unique artifacts you’re likely not to see anywhere else. Once your interviews start, you’ll meet with a variety of people on the teams that are interviewing you. There are all very smart people and each of them has his or her own interviewing style. You’ll probably start out with coding questions/tricks, and move up to more high-level implementation/architecture stuff. My final interview was with a hiring manager, which consisted a lot more of personality and profesional questions related to work habits, ethics, etc. I like the fact that the interviews seemed to test every part of the candidate, from your typical algorithm questions down to your pattern of thinking and answering hard business problems. I had a serious issue with my work at Microsoft however. First of all, the deadlines for my other offers were Monday (and my interviews on a Friday). Secondly, I needed to know if I could ever work on ReactOS/TinyKRNL after my internship was over. The only peopel who could answer this were LCA, the Law and Corporate Affairs deparment of Microsoft, who are usually pretty hard to get by, especially on a weekend. I made it clear that two things were critical to me: being allowed to work on ReactOS after my internship was over, and working on the Base or Virdian Team. It turns out I passed my interviews, and my understanding was that an offer could’ve been offered to me. Unfortunately, I was qualified as a “legal risk”, and they did not want to go forward with it, due to my work on ReactOS. It was made clear to me that I would have to choose between the two. Since this wasn’t a full time employement, and only my first internship in many to come, I didn’t want to sacrifice the project for an internship. Who knows if I didn’t like the Base Team? Or maybe I wanted to work in some other company later on, or maybe Microsoft would not want me anymore. The restriction of never having to work on ReactOS again seemed way too harsh — not even non-compete agreements are this permanent, but regardless, I can understand why Microsoft chose to do this. I am still very greatful for meeting all those smart people, and will be keeping in touch with them in the future. Job Description: Kernel Developer. Working on the base kernel and/or Virdian. Phone Screens: 1 Campus Visit: Yes. Five Interviews. Final Choice Ultimately, because of the Microsoft situation, my choice became Apple vs Google. Both companies are dream companies to work for, and it wasn’t easy choosing between the two. Ultimately however, the work I would be doing at Apple was a lot more related to my core competencies (kernel development), and gave me the chance to discover a new architecture and OS design. I felt like some of my work at Google might be hindered by their requirement for computational/algorithm experience and my lack of a formal training in the matter (which won’t come until my next semesters). Also, Apple’s details about my work (which I can’t mention) clearly became the defining factor in my decision. The team size, which is extremly small, meant that my work would have a real impact on the products/services/etc I’d be working on, and that was also another great opporunity that I think an internship is good for. Another important factor was ReactOS, which didn’t seem to hinder at all my work at Apple, as well as the friendlyness of all the people at Apple. I am trying to bring my girlfriend over with me for the summer, and Apple was very forthcoming in helping with this. In the end, the Apple offer was the most interesting, and the culture/ethics and work seemed the most adapted to me, as did the helpfulness of everyone involved in my interview process and offer. I felt like I was really needed, a truly unique candidate, and that was indeed a great feeling to have. Conclusion Please remember that this experience was unique to me; do not attempt to generalize or make any employement choices based on this experience, since you will most likely have a different one. I have however tried my best to avoid giving away any confidential or private information, so please do not ask/make comments on my offer, and perks offered, et caetera, because I will not discuss them. I strongly recommend anyone with the opportunity to work at any of these three companies to take it, if their interest in the work they’ll be doing is high. They are all amazing companies that I’d love to work for during my life. If there’s one lesson that I want to share from my experience it’s this: go with your interests. Don’t be amazed by perks, salaries, or other material things. Does the campus/team seem a good match? Does the work interest you? If yes, everything else should be secondary. Original story