2015 Ali front-end engineer online written test finishing

Source: Internet
Author: User

Yesterday afternoon took part in the Ali front-end of the written test, the topic is random, but it seems that the more difficult to follow the topic. Small partners are advised to attend as early as possible.

Overall, the problem is not difficult, there is time can be done, a total of 11 questions, 6 single-choice, 3-way blank, two big questions bar. One hours less time, plus I originally wanted to hit the code directly above, and then found too slow, so changed to a sumlime.

Single topic has a question of what is the unordered list of elements, a nervous I unexpectedly chose the <ol> .... My heart is going to crumble when I'm done with the exams.

Finally, there is a big question did not write, a blank and a big question did not finish. Make it perfect in this article.

1. Find all nodes with a width and height greater than 40 in the page.

1 <!DOCTYPE HTML>2 <HTMLLang= "en">3 <Head>4     <MetaCharSet= "UTF-8">5     <title>Document</title>6 <style>7 . Odiv{width:50px;Height:50px;}8 input{width:100px;Height:50px;}9 </style>Ten </Head> One  A <Body> - <inputtype= "text"name= "Otext"> - <spanname= "Ospan">Span</span> the <Divclass= "Odiv">Div</Div> - <imgsrc=""name= "Oimg"/> -     <Scriptlanguage= "JavaScript"> -     functionReSource () { +         varret=[]; -         varobj=document.getElementsByTagName ("*"); +          for(varI= 0; I<obj.length; I++){ A             if(Obj[i].offsetwidth> +&&Obj[i].offsetheight> +){ at Ret.push (obj[i].tagname); -                 -             } -         } -         returnret; -     } in Console.log (ReSource ()); -    </Script> to  +      - </Body> the </HTML>

It's pretty simple, right, Leng didn't respond.

2. Remove the space between the words and leave a space between the words. such as ' AAAA bbbb CCCC ddd E F g ' converted to ' aaaa bbbb CCCC ddd E F g ', which examines the knowledge of regular expressions, has been avoiding the regular, and now seems to be the front end of the necessary skills

1 <!DOCTYPE HTML>2 <HTMLLang= "en">3 <Head>4     <MetaCharSet= "UTF-8">5     <title>Document</title>6 </Head>7 <Body>8  <Script>9             vars= 'AAAA bbbb CCCC ddd E F g';Ten             varR= /\s+/G; One s=S.replace (R,' '); A Console.log (s); - </Script>     - </Body> the </HTML> 

2015 Ali front-end engineer online written test finishing

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.