Microsoft Interview Questions

4 04 2009

These Are one of the Microsoft Interview Questions

Round 1:
  1. What are your interests? ( as in academics/topics)
     
  2. Given a string, search it in a set of strings (say among 1000s of string). What data structure would you use to store those 1000 strings and get the results fastest?

     Answer:I answered hash tables but he said suggest a better
           one.He said suggest a better one and then gave me one
           Tree sort of DS and then asked me to compare the two.

  3. Reverse a linked list?

     

  4. Find if there is a loop in a linked List?

     

  5. Given two arrays of numbers, find if each of the two arrays have the same set of integers ? Suggest an algo which can run faster than NlogN ?

     

  6. Validate a Binary search tree? ( as in the left- right child follow the property )
     

       Well i gave a the some weird eg where the struct was not
       a Binary tree but if passed through the test will give
       positive results.then he asked me to solve for that too.

Round 2:
The interviewer gets a bit serious with each stage. He will test ur work for all possible set of inputs.

Prologue: Well in my case he started with how they require not only a programmer but a designer and coder who writes perfect code.

  1. Write a routine that takes input as a string such as
     

               "aabbccdef" and o/p "a2b2c2def"
          or
               "a4bd2g4" for "aaaabddgggg"

    write it perfectly as if it should ready to be shipped after you code it.
     

  2. In the same Question (q1) why will u o/p “abc” for the i/p “abc” instead of “a1b1c1″ ?

     

  3. Given a NxN matrix with 0s and 1s. now whenever you encounter a 0 make the corresponding row and column elements 0.

    Flip 1 to 0 and 0 remains as they are.

    for example
    1 0 1 1 0
    0 1 1 1 0
    1 1 1 1 1
    1 0 1 1 1
    1 1 1 1 1

    results in

    0 0 0 0 0
    0 0 0 0 0
    0 0 1 1 0
    0 0 0 0 0
    0 0 1 1 0

Round 3:

  1. Some Questions on the projects listed on your resume?
     

          For me some Qs on DB Lock Manager? 
  2. Given 2 set of arrays of size N(sorted +ve integers ) find the median of the resultent array of size 2N.
    (dont even think of sorting the two arrays in a third array , though u can sort them. Try something better than order N ..order LogN )

     

  3. Given 1000 bottles of juice, one of them contains poison and tastes bitter. Spot the spoiled bottle in minimum sips?

     

  4. Whats the difference b/w a thread and a process? are Word and PowerPoint different processes or threads of a single process?

     

  5. How does a spell checker routine (common to both, word and PowerPoint) used? I mean is the code copied 2 times for each of the processes in the main memory, if they are different processes or how is it used if they are threads.

Microsoft Interview Questions and Answers

 

1. How could you determine if a linked list contains a cycle in it, and, at what node the cycle starts?

There are a number of approaches. The approach I shared is in time N (where N is the number of nodes in your linked list). Assume that the node definition contains a boolean flag, bVisited.
struct Node
{

bool bVisited;
};

Then, to determine whether a node has a loop, you could first set this flag to false for all of the nodes:
// Detect cycle
// Note: pHead points to the head of the list (assume already exists)
Node *pCurrent = pHead;
while (pCurrent)
{
pCurrent->bVisited = false;
pCurrent = pCurrent->pNext;
}

A much better approach was submitted by 4Guys visitor George R., a Microsoft interviewer/employee. He recommended using the following technique, which is in time O(N) and space O(1).

Use two pointers.

// error checking and checking for NULL at end of list omitted
p1 = p2 = head;

do {
p1 = p1-gt;next;
p2 = p2-gt;next->next;
} while (p1 != p2);

p2 is moving through the list twice as fast as p1. If the list is circular, (i.e. a cycle exists) it will eventually get around to that sluggard, p1.

2. How would you reverse a doubly-linked list?

This problem isn’t too hard. You just need to start at the head of the list, and iterate to the end. At each node, swap the values of pNext and pPrev. Finally, set pHead to the last node in the list.

Node * pCurrent = pHead, *pTemp;
while (pCurrent)
{ pTemp = pCurrent-gt;pNext;
pCurrent-gt;pNext = pCurrent->pPrev;
pCurrent-gt;pPrev = temp;

pHead = pCurrent;

pCurrent = temp;
}

3. Assume you have an array that contains a number of strings (perhaps char * a[100]). Each string is a word from the dictionary. Your task, described in high-level terms, is to devise a way to determine and display all of the anagrams within the array (two words are anagrams if they contain the same characters; for example, tales and slate are anagrams.)

Begin by sorting each element in the array in alphabetical order. So, if one element of your array was slate, it would be rearranged to form aelst (use some mechanism to know that the particular instance of aelst maps to slate). At this point, you slate and tales would be identical: aelst.
Next, sort the entire array of these modified dictionary words. Now, all of the anagrams are grouped together. Finally, step through the array and display duplicate terms, mapping the sorted letters (aelst) back to the word (slate or tales).

4. Given the following prototype:
int compact(int * p, int size);

write a function that will take a sorted array, possibly with duplicates, and compact the array, returning the new length of the array. That is, if p points to an array containing: 1, 3, 7, 7, 8, 9, 9, 9, 10, when the function returns, the contents of p should be: 1, 3, 7, 8, 9, 10, with a length of 5 returned.

A single loop will accomplish this.

int compact(int * p, int size)
{
int current, insert = 1;
for (current=1; current < size; current++)
if (p[current] != p[insert-1])
{
p[insert] = p[current];
current++;
insert++;
} else
current++;
}





Commandments For Personal Interviews

10 02 2009

Commandments For Personal Interviews

You have fared well in the written test and the group discussion. You are just a step away from admission to your dream programme — the personal interview. A panel of management experts, a battery of questions. Are you perspiring already? Well, a personal interview could actually be challenging and fun if you just relax and remain focused. Think of it as a conversation between the interview panel and yourself, so enjoy it thoroughly. To begin with, there are four main focus areas in any personal interview:

Personal details

Academic details

Your background

Current affairs

Commandments for every personal interview Even after months of preparation, some candidates do not perform well inside the interview room. The trick is to follow the below commandments practice them during mock interview sessions diligently. You are sure to crack the personal interview.

1. Whenever the interviewer asks any questions, listen carefully. Do not interrupt him midway. Ask for a clarification if the question is not clear. Wait a second or two before you answer. And don’t dive into the answer!

2. Speak clearly. Don’t speak very slowly. Be loud enough so that the interviewers don’t have to strain their ears.

3. Brevity is the hallmark of a good communicator. An over-talkative or verbose person is disliked and misjudged instantly, so keep it short.

4. If you don’t know an answer, be honest. The interviewer will respect your integrity and honesty. Never exaggerate.

5. Never boast about your achievements. Don’t be overconfident — it is often misinterpreted by interviewers for arrogance.

6. Don’t get into an argument with the interviewer on any topic. Restrain yourself, please!

7. Remember your manners. Project an air of humility and be polite.

8. Project enthusiasm. The interviewer usually pays more attention if you display enthusiasm in whatever you say.

9. Maintain a cheerful disposition throughout the interview, because a pleasant countenance holds the interviewers’ interest.

10. Maintain perfect eye contact with all panel members; make sure you address them all. This shows your self-confidence and honesty.





Fresher Salary

12 01 2009

What is average salary for fresh software engineers? Well depends on your college/degree, salaries can vary from private colleges to NITs/BITs/IITs with the highest range being for IITs (offcourse!!). Do IITians work better than other guys? Well in some cases, may be not because they are capable of, but to prove that they are better. Nature of work in software companies does not give ample scope to those with more gray cells.
Salary also varies from non-computer science to computer science, MCA to B.Tech to M.Tech. The following figures give an indication of the fresh engineer salary; there is no way to compare the exact in-hand salary as the salary component also varies from company to company. If you take into account the purchasing power parity, a high salary in Mumbai may not be equal to a much lower salary in Hyderabad.

PLEASE PUT ANY SALARY FIGURE YOU KNOW OR THINK IS INCORRECT IN COMMENTS

All these figures are in lakhs per annum (Rs.) unless otherwise mentioned

Accenture 2.1 to 2.7

Adobe 5.7 to 8.05

Alstom 2.75

Amazon 7/8 (IIT)

Ashok Leyland 3.25

Attrenta 4.8
Adea Solution 2.48
Amdocs 3.7
Avaya 3 +
Birlasoft 2.0
Capital One – $59,000 (US posting) (Only IIT)

Caritor 2.0

CISCO 4.0

Computer Associates 4.5 to 5
CTS 2.4 to 2.8

Capgemini 2.4

Cash systems, Switzerland $ 72,000 (IIT)
DCM Technologies 2.48

DE Shaw 6.0 to 9.5

Deloitte 3.0
Evalue Serve 3.10 to 4.01(IIT)

efunds 2.5

Fiorano 5.0

Flextronics (HSS) 3.0
Freescale 4.5

Google 12.0

GE 3.0 to 5.3

HCL 2.0

Hexaware 2.1
HLL 7.2 (IIT)
HP Labs 3 to 3.5
iGate 2.04
ITC 8+ (IIT)

IBM 2.85 to 3.0 (IIT)
I-flex 2.7

Impulsesoft 4.5

Interra Systems 4.6
Intergraph 2.88

Induslogic 4.2

Infosys 2.7
Inautix 2.75

Ivy Comptech 4.5 to 7.92

Kanbay 2.7

Kritical 5.6
Kotak Mahindra 4.5 (IIT)
Lee specialities – $ 29,000 + benefits (IIT)

L &T 3.25

L&T Infotech 1.8
Magma DA 6.42
Mckinsey and Co 7 (IIT)
MBT 2.5

Microsoft 6 to 9.1 (BIT) to 14(IITs)

Mindtree 2.55

Motorola 3.6 to 4.0 (IIT)
NVidia 6+ (IIT)
Onmobile 4.4 (IIT)

Oracle 4.2 to 5.5 (NITs/BITs); 6 (PG + IIT)

Patni (PCS) 1.7

Perot Systems 2.5

Polaris 2.0
PWC 3

SAP Labs 4.0
Schlumberger 8 + Upto 35 (in IITs)
Sasken 2.0

Samsung 4.6
Sapient 2.75

Satyam 2.25

Sonata 2.2 to 2.5
STM 4.5 to 4.87

Sun Microsystems 5.0

Syntel 2.6 (to 3.4 not confirmed)

SSA Global 3.4
TATA Steel 4.5

Tata Elxsi 1.9

Tavant 3.6

TCS 2.36 to 2.8 (IIT/NIT)

T-Mobile 8.0

Trilogy 7.5 to 8.1 (IIT)

Tech Mahindra 2.6

Teradata 2.8 to 3.1
Trident 4.2 (IIT)

Verizon 3.0

Virtusa 2.4
Yasu Technologies 3.45 (IITs)

Wipro 2.3 to 3.1 (IIT)
ZS Associates 6 (IIT)





What work software companies do?

12 01 2009

Think of India and ignore software companies? You cant, even if there are no major software products coming out of India, the sheer number of software engineers is something to write about. But what do the 43,000 software engineers in IBM, India actually do? The answer is no straightforward, IT Industry is too big, and it actually works for all the industries you can think off.
Lets go from the basics. Any company, which wants to manage its day-to-day operations like production or sales using computers, would need the following and accordingly companies need to provide similar products/services:
1) System Software Products, which will run the computer, like operating system, yes Microsoft makes them under the windows brand. There are servers like database server (Oracle, DB2 (IBM)), web server (again Microsoft and IBM Labs). All these companies have presence in India but not much of work is done in India, though the trend is changing and companies are fast moving development work to India, after gaining confidence in Indian workforce and in a bid to minimize costs.
2) Application software like Oracle Applications (business suites including packages for Finance, HR), SAP, and i2 (supply chain management). Most of these companies have moved a part of their development work to India. All these products need maintenance, testing and development of new features to survive the competition.
3) Now comes our own homegrown companies like Infosys, TCS. After all we need someone to implement and maintain these products. There are also migration projects say from PeopleSoft HR to SAP HR, or Oracle database to DB2. These companies are called Services Company as they provide implementation, maintenance and migration services to other companies. Globally known software service provides include IBM Global Services, Accenture, EDS, CSC and ADP.
There could be several other classifications there are few more, which deserve mention. But first define what is outsourcing? Outsourcing could be Toyota taking help of a company like ADP for its payroll services, or DHL taking help of Infosys to manage its IT operations. All these makes sense as the company can focus on its core area of work. Outsourcing is a widely accepted business practice though we mostly hear it connection with work being outsourced to India’s cheap labor.
a)Technology consulting -> Companies like Accenture and Deloitte are moving towards technology consulting which is nothing but designing large scale enterprise architecture and technological solutions.
b)Outsourced product development -> Product development is a costly and risky affair which has forced many companies including Yahoo, Ebay to outsource a part of their product development to Indian companies like Aditi Technologies, Tekriti Software.





Frequently asked interview questions – VI

12 01 2009

Question: 51. If you had your choice of jobs and companies, where would you go?
Answer: Here, you have to give job preference and answer should reflect that the job profile and company suits very much to your career goals.

Question: 52. Do you prefer working with figures, or with words?
Answer: Give an answer keeping in mind the requirements and the position of the job. It can be both in figures and words.

Question: 53. Describe what would be an ideal working environment? Or what kind of a work environment are you comfortable in working?
Answer: An environment that provides me a chance to use and enhance my skills for the betterment of the organization. The organization should also provide an open communication environment among team members.

Question: 54. What are your short-term goals?
Answer: My short-term goal is to find a good job with an ideal profile in a company that moves forward with a better future perspective.

Question: 55. What is your long-range objective? Or what are your long-term goals?
Answer: I have divided my long-term goals into different segments as short term objective as it will easy to achieve. My short term goal is to get a good job in a company that provides better opportunity to grow professionally as well as personally.

Question: 56. How do you evaluate success?
Answer: Its measurement is different for everyone but to me success means achieving your goals whether in short term or long term with complete dedication and hard work. Success should be measured through satisfaction though not complete fulfillment. However, success depends on level of performance.

Question: 57. What do you think it takes to be successful in this career?
Answer: Hard work and complete dedication in achieving career objectives makes one successful.

Question: 58. What decision have you most regretted?
Answer: Be fare and honest in answering this question. If you did something that you regret now, then explain but also mention that you have learnt from that mistake. Even you can also say that you take life as its comes and never regret for anything as mistakes are a part of life and one should always learn to never repeat the same one.

Question: 59. Have you been involved in any extracurricular or volunteer activities while at university or college?
Answer: Describe all kinds of extracurricular activities you have participated and focus on how these helped in improve your personality.

Question: 60. What qualities do you look for in a boss?
Answer: One should be positive and give a universal answer that is common like a sense of humor, fair, helpful, encouraging and obviously excellent managerial skill.