Tuesday, August 19, 2014

Previous Interview Question Next Interview Question
Home

In viewing thesource code of your company’s”main_include.js”,you see the previous developer has written it to be compact.Based on a snippet of this code below.If “withtax” is passed the value of”14” what is the value returned by “withtax”?

function ad(s){var j;j=fst(s);
j+=0.01;
return j/100;
}
function withtax(a)
{
var j,i;i=a>=10?'PA':'';/*j=ad(i);*/a*=1+ad(i);return Math.round(a);
}
function fst(m){switch(m)
{
case 'NJ': return 7.52;
case 'PA' : return 9.99;
case 'DE': return 3.19;
case 'CA': return 8.01;
default:
return 0;
 }
}
function dnoth(x){var i;for(j=0;j<5;j++)
{
j%2==0?i*=j:i-=j;
}
return –i;
}

         a)      13
         b)      14
         c)       15
         d)      0


Answer :  

Previous Interview Question Next Interview Question
Home

1 comments :