ebayTechnicalInterview2.js

@@ -1,8 +1,9 @@
-e
+E
 bay
+ 
 Tech
@@ -7,16 +7,17 @@
 echnical
+ 
 Intervie
@@ -21,9 +21,2174 @@
 view
-2.js
+. Senior Front End Engineer Role - Shopping experience team%0A%0A10 min Intro%0A20 min random questions%0A10 min on html challenge%0A10 min on algorithm%0A10 Q&A%0A%0A%0A// -------------------------------------------------------%0A%0A// What does this return?? Why?%0Afunction f() %7B%0A  console.log(%22foo%22);%0A  setTimeout(g, 0);%0A  console.log(%22baz%22);%0A  h();%0A%7D%0A%0Afunction g() %7B%0A  console.log(%22bar%22);%0A%7D%0A%0Afunction h() %7B%0A  console.log(%22blix%22);%0A%7D%0A%0Af();%0A%0A//--------------------------------------------------------------%0A%0A// - HTML challenge%0A%0A/* Create a button that is destroyed by clicking on it but two new buttons are created in it's place. */%0A%0A// %3Cdiv id=%22doubleHolder%22%3E%0A//   %3Cbutton class=%22double%22%3Edouble1%3C/button%3E%0A// %3C/div%3E%0A//%0A//%0A// %3Cdiv id=%22doubleHolder%22%3E%0A//   %3Cbutton class=%22double%22%3Edouble2%3C/button%3E%0A//   %3Cbutton class=%22double%22%3Edouble3%3C/button%3E%0A// %3C/div%3E%0A//%0A//%0A// %3Cdiv id=%22doubleHolder%22%3E%0A//   %3Cbutton class=%22double%22%3Edouble2%3C/button%3E%0A//   %3Cbutton class=%22double%22%3Edouble4%3C/button%3E%0A//   %3Cbutton class=%22double%22%3Edouble5%3C/button%3E%0A// %3C/div%3E%0A%0Afunction addEl()%7B%0A    var buttons = document.getElementsByClassName('double');%0A    for(var i=0; i%3Cbuttons.length; i++)%7B%0A        buttons%5Bi%5D.addEventListener('click', function()%7B%0A            var newButton = document.createNewElement('button');%0A            newButton.class = 'double';%0A            var newButtonTwo = document.createNewElement('button');%0A            newButtonTwo.class = 'double';%0A%0A            this.parentElement.append(%0A               newButton, newButtonTwo%0A            )%0A            this.remove%0A          %7D();%0A    %7D%0A%0A%7D%0A%0A%0A%0A// merge sort%0Avar a1= %5B1, 3, 5, 7, 7, 8, 8, 9, 9%5D;%0Avar b1= %5B2, 4, 5, 6, 7, 8, 9%5D;%0A%0A%0Afunction mergeSort(arr)%7B%0A    var mid = ParseInt(arr.length/2),%0A        left = arr.slice(0, mid),%0A        right = arr.slice(mid, arr.length);%0A%0A    return merge( mergeSort(a1), mergeSort(b1) );%0A%7D%0A%0Afunction merge(l, r)%7B%0A    var result = %5B%5D;%0A%0A    while( l.length && r.length )%7B%0A        if( l%5B0%5D%3C=r%5B0%5D )%7B%0A            result.push( l.shift() );%0A        %7D else %7B%0A            result.push( r.shift() );%0A        %7D%0A    %7D%0A%0A    while(l.length) result.push( l.shift() );%0A    while(r.length) result.push( r.shift() );%0A    return result;%0A%7D%0A%0Amerge(a1, b1)%0A%0A%0A%0A
 %0A

add initial flow