DBA > Job Interview Questions > Manager Round interview Questions and Answers

Microsoft Interview for Software Engineer in Man

More DBA job interview questions and answers at http://dba.fyicenter.com/Interview-Questions/

(Continued from previous question...)

Microsoft Interview for Software Engineer in Manager Round

How do you find the 3rd largest word in a given string that is millions of characters long and he wanted me to give a solution in only one pass ?

public static void thirdLargest(string[] a)
{string fLarge ="";
string sLarge= "";
string tLarge = "";
string temp = "";
for (int i = 0; i <a.Length; i++)

if (a[i].Length > tLarge.Length)
tLarge = a[i];

if (tLarge.Length > sLarge.Length)

swap(tLarge, sLarge);<---write a normal swap function

if (sLarge.Length > fLarge.Length)
swap(sLarge, fLarge);


Console.WriteLine("Third Largest:"+ tLarge);

(Continued on next question...)

Other Job Interview Questions