Skip to content
Related Articles

Related Articles

Microsoft Internship (On-Campus)
  • Difficulty Level : Expert
  • Last Updated : 19 Jul, 2019

Interviews

Technical Round 1:
warmup questions:
i) Difference between c and c++ and talk about the features of c++?
ii) virtual functions
iii) abstract class

1)Write a function that crawls the hyperlinks present in a website and prints the dead pages?
assuming i have been provided the following functions:
vector <String> hyperlinks_present_in_Webpage(String)
bool is_page_dead(String)

2)How to write an interface in c++ ?

3)Have you worked with api’s?



4)It seems you have limited yourself to curriculum . Any special reasons?

5)Tell about your 2 most challenging pieces of code you have written

6)In ds and algo have i done graph algorithms.name some

Conclusion:
any questions?

Technical Round 2:

1)what do you feel is your strongest language/favourite language?
2)how much is your experience in c++?

class parent
{
public:
void walk()
{
cout<<” parent walking”;
}
}
class child:public parent
{
public:
void walk()
{
cout<<” child walking”;
}
}
child p;
p.walk;

3)What will be the output of the above code snippet? Will there be any error?

4)Will a constructor allocate memory if it throws an exception?
Write a code to check the above situation if someone is not sure?



5)Difference between overriding and overloading

6) What are the components of a function’s signature(choose): function name, return type, no of arguments and their data type, sequence of the parameters?

class parent
{

public:
parent(String )
{
cout<<” parent initialised”;
}
void walk() // consider its a virtual function
{
cout<<“parent walking”;
}
}

class child:public parent
{
public:
child()
{
cout<<“child initialised”;

}
void walk()
{
cout<<“child walking”;
}
}

7)Indicate which of the numbered statements will compile, run and give the corresponding output

compile(y/n) run(y/n) output

1 parent p=new parent();
2 parent np=new child();
3 child mp=new parent();
4 child cp=new child();

5 p.walk();
6 np.walk();
7 mp.walk();
8 cp.walk();

(i)The statements that will give error how can i modify them so that the program runs and what will be the output.
Assume that I cannot change the parent class.
(ii) difference between writing
parent p;
parent p=new parent();

(iii)
can I write
if( NULL == p)
in place of if(p == NULL)

(iv) difference between writing
parent *p=new parent();
and, parent &p=new parent();

puzzle :
The interviewer folded a square sheet and tore it in parts, then folded those parts and tore them again.
gave me 10 pieces( 2 pairs of identical triangles, 2 pairs of identical quadrilaterals, two pieces of different triangles)and asked me to form a square

HR round

1)Tell me about your education/schooling

2)Why you want to join microsoft for internship?

3)….. array question

Swap adjacent elements of an array in such a way
that for given
Input: 1 2 3 4 5 6 Output: 2 1 4 3 6 5

4)What will you do to prevent notepad from opening more than one instance.
Write a small code?

5)What is your favourite subject?(give reason)

6)What is your takeaway from the pre placement talk? What did you like in it and Why?

Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready. To complete your preparation from learning a language to DS Algo and many more, please refer Complete Interview Preparation Course. In case you are prepared, test your skills using TCS, Wipro, Amazon and Microsoft Test Serieses.

My Personal Notes arrow_drop_up
Recommended Articles
Page :