This is my first article on getting started

Recently, all the junior students have been on vacation. In order to enter dafang as senior students, many students have started to look for front-end internship jobs. This article mainly talks about some HTML, CSS, JavaScript relatively basic interview questions, after all, the front-end three musketry, and their own level is not high (laugh), and other technical growth will be updated

What happens when the browser enters the URL into the rendering page?

  1. Perform address resolution to resolve the host, domain name, port number, parameters and so on in the string address

  2. Perform DNS resolution based on the resolved domain name (1). First, search the browser for the CORRESPONDING IP address in the DNS cache. If yes, use the IP address directly. Check whether the DNS cache in the operating system has the corresponding IP address. If yes, use it directly. If no, go to step 3 (3). When sending a request to the local DNS service provider, the IP address corresponding to the DNS is displayed. If no final query is made to the RootServer service provider

  3. Search for the target server based on the queried IP address. (1) Establish a connection with the server; (2) Enter the server and look for the corresponding request

  4. The browser receives the response code and begins to process it

  5. The browser starts rendering the DOM, downloading CSS, images, and other resources. Until this request is completed

Like this concept of the topic, students do not have to follow my or other online answers to the back, this is mainly to investigate the students to grasp the concept, as long as the general steps can be said.

[,,,].join(“, “)

  1. “,,”

  2. “undefined, undefined, undefined, undefined”

  3. “,,”

  4. “”

When creating an array using literals in JavaScript, a comma ‘, ‘at the end is omitted, so the array actually has only three elements (all empty) :

console.log([,,,].length); / / 3

The three elements use the join method, and only need to be added twice, so the result is “,, “, select 3

This array can be created with array(3), which means creating an array with three empty elements

Which of the following statements is true about HTML semantics? (a)

  1. Semantic HTML is good for machine reading, such as PDA handheld devices, search engine crawlers; But not good for reading

  2. Table is an outdated tag. When you encounter a list of data, try to use div to simulate the Table

  3. Semantic is a new concept brought about by HTML5, and previous versions of HTML were unable to do so

  4. Header, article, and address are all semantically explicit tags

1. The mistake lies in the fact that semantic is produced for the benefit of human reading. 2, error Table tag semantic clear is originally used to do data list, using div simulation does not meet the semantic use of the tag. 3, semantic is to facilitate people to read whether HTML or HTML5 or XML can be as semantic as possible. The correct answer is 4

To sort an integer sequence into ascending order, which becomes 10,12,21,9,7,3,4,25 after two runs of processing, the sorting algorithm may be (3).

  1. Insertion sort
  2. Quick sort
  3. Selection sort
  4. Heap sort

Insertion sort: Incrementing elements by inserting one element at a time, based on the order in which the sequence is already arranged

Quicksort: Needed to sort through a trip to sort the sequence of the elements of the split into two large, among them, the part of the elements should be less than or equal to another part of the sequence of elements, and then still according to the method of dividing the two pieces of the sequence of elements again a quick exhaust sequence algorithm, sort of implementation of the whole process can be recursive to call, Finally, we can change the unordered sequence elements to an ordered sequence

Select sort: first from the data elements to be sorted, and then to the end of the sorted sequence. And so on until the total number of data elements to be sorted is zero. Selection sort is an unstable sort method

Heap sort: refers to the use of heap data structure designed a sort algorithm. The heap is an approximate complete binary tree structure and satisfies the property of the heap that the index is always less than (or greater than) its parent node. The maximum value in the heap is always at the root node (the minimum value in the heap is at the root node if the heap is used in the priority queue).

What is the difference between the opacity effect of RBGA () and Opacity?

Both rgba() and Opacity can be achieved, but the biggest difference is that opacity applies to an element and all contents within the element; Rgba () only works on the color of an element or its background color. (RGBA transparent element children will not inherit the transparency effect)

What is the difference between title and h1, b and strong, I and em?

Title for site information title, highlight site title or keywords, a site can have multiple title, SEO weight higher than H1; H1 summarizes the topic of the article, a page is best to use only one H1, SEO weight is lower than the title

From the point of view of the website, title is more important than the website information title, highlight the website title or keyword with title, an article, a page is best to use only one H1, H1 too much, will dilute the theme; A site can have more than one title, preferably a single page with a title to highlight the site page theme information.

From the point of view of the article, H1 summarizes the theme of the article and highlights the theme of the article. With H1, users should highlight their visual effects.

A) in b) in C) in D) in B) This label is bold, which is just for displaying text in bold, as a style/style requirement; The strong tag means to reinforce the tone of the character, indicating that the text is important and alerting the reader/terminal to it. To achieve this, terminals such as browsers display it in bold

I is italic for italics, em is italic for emphasis, and strong and em are more important to search engines than b and I

Why initialize CSS styles?

(1) Because of browser compatibility issues, different browsers have different default values for some tags. If the CSS is not initialized, the page will display differently between browsers.

(2) Of course, the initialization style will have some impact on SEO, but you can’t have your cake and eat it, but try to initialize with the least impact.

* {padding: 0; margin: 0; } (Strongly not recommended)

Taobao style initialization code:

body, h1, h2, h3, h4, h5, h6, hr, p, blockquote, dl, dt, dd, ul, ol, li, pre, form, fieldset, legend, button, input, textarea, th, td { margin:0; padding:0; } body, button, input, select, textarea {font:12px/1.5tahoma, arial, \5b8b\4f53; } h1, h2, h3, h4, h5, h6{ font-size:100%; } address, cite, dfn, em, var { font-style:normal; } code, kbd, pre, samp { font-family:couriernew, courier, monospace; } small{ font-size:12px; } ul, ol { list-style:none; } a { text-decoration:none; } a:hover { text-decoration:underline; } sup { vertical-align:text-top; } sub{ vertical-align:text-bottom; } legend { color:#000; } fieldset, img { border:0; } button, input, select, textarea { font-size:100%; } table { border-collapse:collapse; border-spacing:0; }Copy the code

What are shockproof and throttling? What’s the difference?

** Debounce: ** The function is executed only once for n seconds after the high frequency event is triggered. If the high frequency event is triggered again within n seconds, the time is recalculated.

For example: as if in Baidu search, every time after input there are associative words pop up, the method of controlling associative words can not be triggered by a change in the input box content, he must be when you end the input after a period of time will trigger.

** Throttling (thorttle) : ** High frequency events are triggered, but only once in n seconds, so throttling will dilute the frequency of function execution.

For example, a function is scheduled to be executed only for periods greater than or equal to the execution period, and calls within the period are not executed. Just like when you snap up a limited amount of hot goods on Taobao, you keep clicking the refresh point to buy, but there is always a period of time when you click the point is ineffective, here is the use of throttle, is afraid of too fast to cause bugs in the system.

** Differences: ** anti-jitter turns multiple executions into the last execution, and throttling turns multiple executions into intervals.

Write so much for the time being, just in the interview recently, there will be time to update. Or that sentence, the students do not recite the answer, must have their own understanding!! Very important!! Understand that there is no need to back! I just couldn’t remember QAQ when I didn’t understand it at first

When you answer questions in the interview, you can expand your answers a little, or add a little understanding of your own, and you can also say questions that arise when you write a demo or a project. Do not just answer what the interviewer asks you. Some students who are not very good at expression will lose a happy job because of this! (When communicating with the interviewer, I learned that some students are capable, but they were not good at the interview.) Everyone is not good at something, it is very normal, so we must find out what is missing and make up for what is missing.