2017 interview summary, 2017 interview

Source: Internet
Author: User

2017 interview summary, 2017 interview

2017 from north to south. As an old programmer who has been working for more than four years. Each job also has a headache. But you still have to stick to it, don't you? Post the problems encountered during the interview. Hope to help you. I hope you can add more!

1. Differences between text, val, and html

Html ()Use the innerHTML in js corresponding to the HTML tag for reading and modifying elements

. Html (htmlhtmlhtmlhtmlhtmlhtmlhtml() is the HTML content used to read element content. When the. html () method is used on multiple elements, only the first element is read.

 

. Text ()The plain text content used to read or modify elements corresponds to innerText in js

Text () is used to read the plain text content of an element, including its descendant elements. The. text () method cannot be used on a form element.

 

. Val ()Used to read or modify the value of a form element.

. Val () is the "value" value used to read form elements.. val () can only be used on form elements.

 

2. Use one sentence to color the table

$ (Document). ready (function (){
$ ("Table"). attr ("bgColor", "#222222"); // you can specify the background color of a table.
$ ("Tr"). attr ("bgColor", "# 3366CC"); // set the background color for the table in the singular row
$ ("Tr: even" ).css ("background-color", "# CC0000"); // you can specify backcolor for a two-row table.
$ ("Table" ).css ("width", "300px"); // Add a style for the table and set the table length to 300 pixels.
});

 

3. Jequery has several selectors and priorities.

JQuery selectors can be divided into four types: Basic selector, hierarchical selector, filter selector, and form selector.
Improve jQuery's execution efficiency:
Selector performance ranking: $ ("# ID") >$ ("Tag") >$ (". Class") >$ ("[attribute = value]")
The jQuery selector has no priority and is executed from top to bottom.

4. What do Http status codes mean.

301: Redirection

404: the page is good

500: Internal Server Error

5. In what scenarios do I use delegation?

1. Processing multi-threaded

2. Lambda expressions can easily implement data filtering ~

3. event handling of user controls and controls

6. Let's talk about the differences between packing and unpacking, value types, and reference types.

Packing refers to converting a value type to a reference type or a value type (such as a structure) to implement any interface type. When the CLR loads the value type, the value is encapsulated into System. Object, and then stored on the managed stack.

Unpacking refers to the explicit conversion from the value type or interface type extracted from the object to the value type implemented by this interface. It is invisible during packing, and the unpacking is explicit.

Variables of the C # Value Type store data directly, while variables of the reference type hold data references, and data is stored in the data heap.

Value type: byte, short, int, long, float, double, decimal, char, bool, and struct are collectively referred to as value types. After a value type variable is declared, the compiler allocates memory for it no matter whether it has been assigned a value or not.

Reference type: string and class are collectively referred to as reference types. When declaring a class, allocate only one small piece of memory in the stack to accommodate one address.No memory space is allocated for the heap.. When a class instance is created using new, allocate the space on the stack and save the address of the stack space to the small slice space allocated on the stack.

7. Have you ever encountered concurrency at work? And how to handle it?

If you have never met one, you have to say yes. Haha!

1. Use a thread to delegate an event for processing and lock the data processing method.
2. Message Queue
3. Cache
Of course, the specific situation must be analyzed. Which method is used?

 

8. Differences between post and get

Get parameters are displayed in the browser address bar, while post parameters are not displayed in the browser address bar;

When you click the refresh button on the post submission page, the browser will usually prompt "whether to submit again", but get will not;

Pages with get can be crawled by search engines, but those with post cannot;

The amount of data that can be submitted using post is very large, while the amount of data that can be submitted using get is very small (2 k), limited by the length of the webpage address.

You can use post to submit files, but not get.

9. Talk about your familiar design patterns.

 

10. Some Experience in database optimization?

Internal indexing principle: As a Dictionary, the speed of insertion, deletion, and update is slow. In addition, the index occupies more space and the query speed is faster. After the index is added, the speed increases significantly.

(1) You can use indexes on frequently retrieved fields (select * from Person where Name = @ Name) to increase the query speed.

(2) Only necessary fields are listed in select, rather *.

(3) Avoid full table scanning caused by implicit type conversion. Using a function on the index will also cause full table scanning (because the index is only created for the field, once an expression or function is used, then the index is invalid. Of course, you can use "Function Index" and "expression Index" to solve this problem). Using indexes may not increase the query speed.

(4) Avoid using computation on index columns (where Name + 'A' = @ MyName)

 

Related Article

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.