2019 Tencent engineers face questions and answers the front end solution

1 want to find siblings of all elements in the jquery Which of the following can be achieved?

A、eq(index)

B、find(expr)

C、siblings([expr])

D、next()

Reference answer: C

Answer Analysis:

jQuery siblings () method ----------------------

siblings () method returns all elements of the selected element compatriots.

The following example returns

All compatriots elements: ### examples

$(document).ready(function(){

  $("h2").siblings();

});

 

You can also use the optional parameter to filter the search for compatriots elements.

The following examples belonging to return

All compatriots elements
elements:

Examples of
$ (document) .ready (function ( ) {

  $("h2").siblings("p");

});

jQuery next () method ------------------

next () method returns a fellow next element of the selected element.

This method returns only one element.

The following example returns

Next compatriots element: ### examples

$(document).ready(function(){

  $("h2").next();

});

jQuery find () method
 

find () method returns the descendent elements of the selected element, all the way down to the last generations.

The following examples belonging to return

All elements of future generations: ### examples

$(document).ready(function(){

  $("div").find("span");

});

2. The following is not a RDBMS ()

A、mysql

B、postgreSql

C、oracle

D、hadoop

Reference answer: D

Answer Analysis: RDBMS SQL is the foundation, it is also the basis for all modern database systems, such as MS SQL Server, IBM DB2, Oracle, MySQL and Microsoft Access. hadoop is a distributed database

3.JavaScript basic composition does not include the following () options

A HOUSE

B, BOM

C、ECMAScript

D、jQuery

Reference answer: D

Answer Analysis: jQuery library is written in javascript.

JavaScript's three main components are: ECMAScript (core), DOM (Document Object Model), BOM (Browser Object Model). 

4. For border-radius label statement is wrong

For border-radius, saying the error is

A, represents rounded corners

B, IE8 support good

C, IE9 support good

D, firefox support good

Answers: B

Answer Analysis: Internet Explorer 9+ support border-radius and box-shadow property. Firefox, Chrome and Safari all support the new border properties. Note: For border-image, Safari 5 and older versions need to prefix -webkit-.

Opera supports border-radius and box-shadow property, but the need for border-image prefix -o-

![]

5. In doing mobile development, shows a list of page data, data required to display the mark on the left side of the page ...

In doing mobile development, data displayed on a page with a list of data required to display the title of the page on the left side, the right side shows a navigation icon, how do ()

A, <div style = "float: left"> text title </ div> <div style = "float: right"> icon </ div>

B, <div> Text title </ div> <div> icon </ div>

C, <div style = "display: box;"> text title </ div> <div style = "display: box"> icon </ div>

D, <div style = "float: left"> text title </ div> <div style = "float: left"> icon </ div>

Answers: A

6. With regard to the properties of the method of operation JQuery, the error is described below :()

A, addClass (): adding the specified class name matching element

B, val (): returns the setting or values ​​of matching elements

C, html (): returns the HTML content provided or set of matched elements

D, removeAttr (): returns the set of matching elements or attributes and values

Reference answer: D

Answer Analysis: No

7. Under the description of DoS attacks, the error is?

A, DoS attacks typically by inhibiting the flow of all or a particular message object side, an entity so that the system can not perform its normal function, generates a service denied

B, DoS attack without the target system, can be achieved only from external attack

C, as long as there is no internal software system vulnerabilities, DoS attacks can not succeed

D, Ping of Death, Land Attack, UDP floods, Smurf attacks are common DoS attacks

Reference answer: C

Answer Analysis: denial of service: when an entity can not perform its normal function, or its action prevents other entities to perform their normal functions, denial of service will occur. This attack does not necessarily require the presence of loopholes, such as UDP flood the target system.

8. In the object-oriented software development process, the use of the design pattern ().

A, allows the use of object-oriented concept in a non-object-oriented programming language in

B, in order to reuse successful design and architecture

C, in order to reduce the number of the design process to create a class

D, to ensure that the running speed of the optimal value

Answers: B

Answer Analysis: B.

Emergence of design patterns is to code reuse, maintainability increase.

9.Java core package, provided the application program package is the base class ().

A java.lang

B java.util

C、 java.applet

D java.rmi

Answers: A

Answer Analysis: No

10. The following media queries define the way in which one is adapted iphone6s of?

A、.@media(min-device-width:375px) and(max-device-width:667px) and(-webkit-min-device-pixel-ratio:2){}

B、.@media(min-device-width:414px) and(max-device-width:736px) and(-webkit-min-device-pixel-ratio:3){}

C、@media only screen and (min-device-width:320px) and (max-device-width:480px) and (-webkit-device-pixel-ratio:2){}

D、@media only screen and (min-device-width:320px) and (max-device-width:568px) and (-webkit-min-device-pixel-ratio:2){}

Answers: A

Answer Analysis: Do not tangle selecting the A or B selected mainly in -webkit-min-device-pixel-ratio: 2 This property

Want to know here to see the article (interpretation is correct, but this device pixel ratio above is wrong)

iPhone6s plus 2 and 3 to see the device pixel ratio

min-device-width and we usually write this label is also differentiated min-width I also learned to learn ha ha ha

11. jquery, if you want to get the value of the width of the current window, the following is the realization of this feature?

A、width()

B、width(val)

C、width

D、innerWidth()

Answers: A

Answer Analysis:

alert ($ (window) .height ()); <span style = "color: rgb (0,128,0);"> // browser is currently visible area of ​​the window height </ span>

alert ($ (document) .height ()); <span style = "color: rgb (0,128,0);"> // height of the current document window browser </ span>

alert ($ (document.body) .height ()); <span style = "color: rgb (0,128,0);"> body height of the current document window of the browser // </ span>

alert ($ (document.body) .outerHeight (<span style = "color: rgb (0,0,255);"> true </ span>)); <span style = "color: rgb (0,128,0);" > current total height of the body of the document window // browsers include border padding margin </ span>

alert ($ (window) .width ()); <span style = "color: rgb (0,128,0);"> current viewing area width browser window // </ span>

alert ($ (document) .width ()); <span style = "color: rgb (0,128,0);"> // width of the browser window, the current document object </ span>

alert ($ (document.body) .width ()); <span style = "color: rgb (0,128,0);"> body height of the current document window of the browser // </ span>

alert ($ (document.body) .outerWidth (<span style = "color: rgb (0,0,255);"> true </ span>)); <span style = "color: rgb (0,128,0);" > the total width of the current window of the document body // browsers include border padding margin </ span>

12. The following HTML code shows a list of users: -

User 1 <button data-id = " 1"> Delete </ Button>

- User 2 <button data-id = " 2"> Delete </ Button>

- User 3 <button data-id = " 3"> Delete < / the button>

- user 4 <button data-id = " 4"> delete </ the button>

- user 5 <button data-id = " 5"> delete </ the button>

HTML
product manager expect administrator clicks "delete" button when you can delete a user, on the realization of the function which statements are true:

A, first of all need to bind each element button click event:. $ ( 'Button') on ( 'click', removeUser);

B, acquired by the user click time ID: $ (e.target) .attr ( "data-id");

C, before the page will be deleted from the list of items, you need to call the backend API, $. Delete ( '/ delete / user / xxx'). Then (() => {// the user is removed from the page})

D, in a one-page application, if the user dynamically add a new record, need to re-bind the event record of the delete button.

Reference answer: C

Answer Analysis:

13. With regard to the factory model, saying the error is?

A, creating a definition of an interface object, allowed to decide which instance of a subclass of the class of a factory, the factory model creation process so as to delay subclasses

B, created during the execution of the parent class

C, let the child class implements the factory interface, is the return of an abstract product

D, mainly to solve the problem of interface options

14. The following description about the box model is correct:

A, the standard box model: the total width of the box left margin + = left border + padding + width of about

B, IE box model are: the total width of the box left margin + = left border + width

C, the standard box model: the total width of the box left margin + = left border + width

D, IE box model: total width = width box

15.head tag will be a lot of ()

head tag will be a lot of ()

A、<meta>

B、<link>

C、<title>

D、<script>

16. The following notation does not belong to the operator is JavaScript ()

A、$#

B、&&

C、==

D、=

17. In the HTML page, insert CSS stylesheet does not include the form of ()

A, Embedded

B, indexed

C, external formula

D, inline

18. The following html elements which fall within the block-level element is

A、h3,ul,form,table,p

B、h2,table,ul,a,input

C、p,ul,form,div,strong

D、div,p,h1,table,span

19.JS closure usage scenario, the error is ()

A, iterators

B, generator

C, data cache

D, freeing memory

20. Move the mouse button and when clicked, what will be a series of events?

A、active hover focus

B、foucs hover active

C、hover active foucus

D、hover focus active

21. The following regular expression which matches a string?

re = /(?<=z)abc(?=:)/

A、z:abc:z

B、:abcz

C、zabc:

D、:zabc

Reference answer: C

Answer Analysis: (? <= Z) indicates matches (z) at the beginning of the string, and captured (stored) into packets

(? = :) indicates matches (:) end of the string, and is captured (stored) into packets

Second, multiple-choice questions (8 questions, each question 5 minutes)

1. About Web semantic argument, right there?

A, semantic meaning is to do the right things with the right label

B, semantic structured so that the page content, structure more clearly

C, semantic facilitate browser, easy to read the code, easy to maintain

D, semantic easy SEO, multi-page, put some H1 tag will increase the page ranking

Answer: A, B, C

Answer Analysis: h1 has the highest weight, the best on a page using a finger to highlight your content h1, h1 distract too much of its heavy weight of the entire page, the search engine is very unfriendly.

2.JavaScript the == operator to say right there?

A, if the same type of two values, are compared by the comparative method ===

B, wherein if a value is null, the other is undefined, they are equal

C, if the value is a number other is a string, the string will be converted to digital comparison

D, if a value of the object, the other is a number or string, the target value is then converted to the original rule continues comparative ==

Answer: A, B, C, D

Answer Analysis:

== operator is equal to the flow of determining how

If the two values are the same type, are compared by the comparison method ===
If the types are different, are compared using the following rules
if one value is null, the other is undefined, they are equal
if the other is a numeric value string, comparing string into a number
if the Boolean type, converts true 1, false is converted to 0, and then continue with the comparison rule ==
If a value of the object, the other is a number or string, converting the original target value then continue the comparison with == rule
all other cases are not considered equal to
3. given a regular expression, select it successfully matched items. () Re = / ^ [aeiou ] * d $ /

A、d

B、aeioud

C uoiead

D, harness

Answer: A, B, C, D

Answer Analysis: ^ represents the beginning of a certain character or string

* Represents 0 or a string comprising a plurality of front

$ Indicates the end of a certain character or string.

 

4. Which design patterns to reduce resource usage:

A、prototype

B、singleton

C、flyweight

D、abstract factory

 

5. Which of the following HTML tags are within the line elements:

A、`p`

B、`span`

C、`canvas`

D、`label`

E、`img`

 

6.JavaScript correct about === operators say?

A, if the two values ​​are null or are undefined, they are equal

B, if the two values ​​are all Boolean true or false, they are equal

C, wherein if there is a NaN, they are not equal

D, and if the numerical values ​​are equal, they are equal, equal to -0 0

 

7. given by the HTML code, the selector can be selected from the elements P is?

<div class="box"> <div> YY   </div> <p> 1231</p></div>

HTML
A、.box p

B、.box > p

C、.box + p

D、.box,p

8. common browser-side storage technologies What?

A、cookie

B、localStorage

C、session

D、userData

  Answer: A, B, D

Answer Analysis:

** browser: **

cookie

WebStorage(localStorage、sessionStorage)

userData

indexedDB

**Service-Terminal:**

session

 

Guess you like

Origin www.cnblogs.com/xsd1/p/11891887.html