Table of Contents
Part 1 Team Leader
1.URL structure
I have taken notes on the Fibonacci sequence, but I don’t know how to recurse. I am not good at learning data structures, but my iterative method is fine. 1 1 2 3 5….
This question leads to question 1. Give it to yourself. The summary before digging
I think maybe this answer is not wrong. What if the requested page is 'hello world' without css and pictures?
I talked about my own situation, that is, the front-end and back-end negotiate the interface, the front-end and front-end collaborate to develop, the front-end writes the baffle data, and finally adjusts the interface
I talked about the standard box model and the weird box model, but not common sense either
I’ve used backbone, vue, and talked about angular and react.
I won’t explain it anymore
The ant used by the company
webpack的常用配置
9.使用的vue其他生态库
10.说说vue-router的原理,怎么实现路由的
11.vue的生命周期
12.vue组件通信
13.说说JSONP的实现原理
14.职业规划
第二部分领导面
1.css盒模型
A.任何元素都可以设置border
B.行内元素设置padding,margin 上下是无效的,左右是有效的
2.position定位
(1)position的属性有哪些?默认的是什么?
(2)例子考察
(3)例子考察(事实证明,面试官这道题也错了)
3.BFC(块级格式化上下文)
4.flex(css3新特性)
5.JS原型和原型链
6.闭包
7.http
8.数组去重算法(时间/空间复杂度)
X.说说你做前端的优势
Home Web Front-end JS Tutorial Front-end interview experience summary

Front-end interview experience summary

Feb 18, 2017 pm 02:19 PM
front end interview

Do what you need to do today, share gluten, and make progress together. I'm sweating a lot, come on.

I have forgotten some parts. I will write whatever I remember. It may be a bit confusing.

Part 1 Team Leader

1.URL structure

URI—Universal Resource IdentifierUniversal Resource Identifier

Web Every resource available on the Internet, such as HTML documents, images, video clips, programs, etc., is located by a URI.
URI generally consists of three parts
①The naming mechanism for accessing resources
②The storage resource Host name
③The name of the resource itself, represented by the path, with emphasis on the resource.

URL—Uniform Resource Location Uniform Resource Locator

URL is a string used to describe information resources on the Internet. It is mainly used in various WWW client programs and servers. Programmatically, especially the famous Mosaic.
URLs can be used to describe various information resources in a unified format, including files, server addresses and directories, etc.
URL generally consists of three parts
①Protocol (or service method)
②The host IP address where the resource is stored (sometimes including the port number)
③The specific address of the host resource. Such as directories and file names, etc.

Example
URI = Composition
URL = Argumentative essay, narrative, poetry...

Then

1. When describing the macro, the teacher will ask: Everyone wrote well in the "composition" of today's test, but will not say that everyone wrote well in the "argumentation", although it refers to the same thing. .
2. When describing objectively, you will say to your deskmate: What I wrote today is "poetry", instead of saying that I wrote the composition in the form of poetry today.

Similarly

When you write a technical document specification, you will say that a certain parameter should be passed a URI, instead of saying that a certain parameter should be passed a URI "URL format string".

Front-end interview experience summary

  • ##Scheme: // Protocol part, ending with: Common protocols include HTTP, HTTPS, etc.

  • //: The hierarchical URL identifier can be understood as separating the protocol from the subsequent information

  • Login: password@: Identity authentication general protocols will use the default anonymous form for data Get

  • Address: The server address generally exists in the form of a domain name

  • port: Server port Different protocols have their own default port numbers

  • /path/to/resource: The file path points to the only certain resource

  • ##?query_string: Query string
  • /#fragment: Fragment ID This part of the content will not be passed to the server and is generally used as an anchor for the page. The button to return to the top at the bottom of the page is implemented using this
  • 2. Recursion

I have taken notes on the Fibonacci sequence, but I don’t know how to recurse. I am not good at learning data structures, but my iterative method is fine. 1 1 2 3 5….

//递归的方法
function test(n){
  if(n<2){
    return 1;
  }
  return test(n-1)+test(n-2)
}
alert(test(9))
Copy after login
//迭代的方法
function test(n){
  var num1 = 1;
  var num2 = 2;
  var num3 = 0;
  for(var i=0;i<n-2;i++){
    num3 = num1 + num2;
    num1 = num2;
    num2 = num3;
  }
}
alert(test(9))
Copy after login

I’m so nervous. Method 2 is written in a different way.

3. The browser sends a request to the page after the page is loaded. What happened?

This question leads to question 1. Give it to yourself. The summary before digging

was not in place. . Next

    The browser starts the thread, finds the DNS server based on the domain name of www/baidu.com, and resolves it to the corresponding IP address. For example, it is parsed into: http://www.php.cn/:80/login.aspx
  • After the browser parses the IP address, the second step is to parse the specified The URL is HTTP encapsulated and the URL is encapsulated into an http message. After the browser encapsulates the URL into an HTTP message, the third step is to send the HTTP request message to the server
  • (Note: How does the browser send the http request message to the server? Answer: The browser will create a Socket object internally, convert the http request message into byet[] bytes, and then call Socket.Sent( ) method to send these data to the server

Here is another question: Will there be requests during the page rendering process? My answer: Maybe

I think maybe this answer is not wrong. What if the requested page is 'hello world' without css and pictures?

In fact, there must be other requests for eg js, css, pictures, etc.

4. Understanding the separation of front-end and back-end

I talked about my own situation, that is, the front-end and back-end negotiate the interface, the front-end and front-end collaborate to develop, the front-end writes the baffle data, and finally adjusts the interface

The following is the quote

Now the front-end and back-end are separated. The role of the back-end server is more like an API Server. It receives requests and only returns them in the form of data. How to render and display the data is left to the front-end presentation layer. Achieve decoupling of front-end and back-end

5. Box model

I talked about the standard box model and the weird box model, but not common sense either

6. Understand or use the MV* framework

I’ve used backbone, vue, and talked about angular and react.

7. Modularization

I won’t explain it anymore

8. Talk about the packaging tools used in your company's projects (what is the good experience for both developers and users?)

The ant used by the company

I mentioned that other projects have recently used webpack,

(1) Hot loading

(2) File compression and packaging

问了webpack的基本配置,自己回答的:entery和output,感觉好浅薄。还是用的少,了解少的缘故吧

webpack的常用配置
  1. entry:{} //加载模块的入口点

  2. output:{}//打包文件的路径和名称

  3. module:{}//那些加载器来处理那些文件

  4. resolve:{}//设置模块的一些细节

  5. plugins:[]//系统插件和扩展插件


9.使用的vue其他生态库

使用了 vue-router、vue-resource,了解vuex

由此引出问题10,11,12

10.说说vue-router的原理,怎么实现路由的

平时做项目能正常跳转就可以了,没有想过路由怎么路由的,没答上来。。

SPA路由实现原理不知道面试官想得到的是不是类似这样的答案。

11.vue的生命周期

Front-end interview experience summary

12.vue组件通信

父子组件通信的机制,传递数据使用prop属性

  • 动态Prop

v-bind 动态绑定 props 的值到组件的数据中。每当父组件的数据变化时,该变化也会传导给子组件。

<p>
  <input v-model="parentMsg">
  <br>
  <child v-bind:my-message="parentMsg"></child>
</p>

<child :my-message="parentMsg"></child>
Copy after login
  • 单向数据流

prop 是单向绑定的:当父组件的属性变化时,将传导给子组件,但是不会反过来。这是为了防止子组件无意修改了父组件的状态——这会让应用的数据流难以理解。

通常有两种改变 prop 的情况:

  1. prop 作为初始值传入,子组件之后只是将它的初始值作为本地数据的初始值使用;

  2. prop 作为需要被转变的原始值传入。

13.说说JSONP的实现原理

JSONP : JSON with Padding

(1)script标签 src属性可以访问外部资源

(2)用script标签加载资源是没有跨域问题的

在资源加载进来之前定义好一个函数,函数接受一个参数,函数中包含 实现逻辑(要做什么事)

通过script标签加载远程文件资源,当远程文件被加载进来时,执行当前定义好的函数,数据就是函数传入的参数

14.职业规划

求职定位,到底想干啥?

第二部分领导面

每一点都非常深入。

1.css盒模型

  • 标准盒模型和怪异盒模型不再重复

  • box-sizing属性:content-box:标准盒模型,border-box:怪异盒模型

  • 行内元素同样具有盒模型


A.任何元素都可以设置border
<!-- 行内元素可以设置border 设置宽高无效-->
<span style="border:10px solid red;width:100px;height:100px">haha</span>
Copy after login

Front-end interview experience summary

B.行内元素设置padding,margin 上下是无效的,左右是有效的
<!-- 行内元素设置padding、margin-->
<p style="width:90px;height:100px;background:blue;">
    <span style="background:yellow;padding:5px;margin:20px;">1782</span>
    <p>
        woship
    </p>
</p>![Snip20170211_5](/Users/shenyuanyuan/Desktop/Snip20170211_5.png)
Copy after login

Front-end interview experience summary

行内元素的padding-top、padding-bottom从显示的效果上是增加的,但其实设置的是无效的。并不会对他周围的元素产生任何影响。

  • 黄色内边距5px

  • 左边黄色距离蓝色20px

  • 上下虽然显示padding,但是padding并没有影响其他元素

2.position定位

(1)position的属性有哪些?默认的是什么?

默认值:static

属性有5个分别是:relative、absolute、fixed、inherit、static

(2)例子考察

父元素p :width:500px;height:200px;position: static|absoluta|relative|fixed。 position分别取值,子元素怎么定位?

子元素p:width:200px;height:200px;position:absolute

<!-- 父元素默认static-->
<p style="background:red;width:500px;height:60px;">
    <p style="background:yellow;width:10px;height:10px;position:absolute;left:0px;top:0px;" >
    </p>
    <p style="background:blue;width:100px;height:20px;position:absolute;left:50px;top:30px;">
    </p>
</p>

<br>
<!-- 父元素默认relative-->
<p style="background:red;width:500px;height:60px;position:relative">
    <p style="background:yellow;width:10px;height:10px;position:absolute;left:0px;top:0px;" >
    </p>
    <p style="background:blue;width:100px;height:20px;position:absolute;left:50px;top:30px;">
    </p>
</p>
<br/>
<!-- 父元素默认fixed-->
<p style="background:gray;width:500px;height:60px;position:fixed">
    <p style="background:yellow;width:10px;height:10px;position:absolute;left:0px;top:0px;" >
    </p>
    <p style="background:blue;width:100px;height:20px;position:absolute;left:50px;top:30px;">
    </p>
</p>
<!-- 父元素默认absolute-->
<p style="background:red;width:500px;height:60px;position:absolute">
    <p style="background:yellow;width:10px;height:10px;position:absolute;left:0px;top:0px;" >
    </p>
    <p style="background:blue;width:100px;height:20px;position:absolute;left:50px;top:30px;">
    </p>
</p>
Copy after login

Front-end interview experience summary

发现:子元素绝对定位,按照除了属性为 static以外的第一个父元素定位。所以父元素设置为:absolute、relative、fixed,子元素定位表现一致;

(3)例子考察(事实证明,面试官这道题也错了)

如果子元素设置margin、border、padding呢?子元素左上角的点以margin、border、还是padding定位

<p style="background:red;width:500px;height:60px;position:relative">
    <p style="background:yellow;width:10px;height:10px;position:absolute;left:0px;top:0px;" >
    </p>
    <p style="background:blue;width:100px;height:20px;position:fixed;left:0px;top:30px;">
    </p>
</p>
<br/>
<!--  最原始-->
<p style="background:red;width:500px;height:60px;position:relative">
    <p style="background:yellow;width:10px;height:10px;position:absolute;left:0px;top:0px;" >
    </p>
    <p style="background:blue;width:100px;height:20px;position:absolute;left:10px;top:10px;">
    </p>
</p>
<br/>
<!--  最原始:添加margin-->
<p style="background:red;width:500px;height:60px;position:relative">
    <p style="background:yellow;width:10px;height:10px;position:absolute;left:0px;top:0px;" >
    </p>
    <p style="background:blue;width:100px;height:20px;position:absolute;left:10px;top:10px;margin:10px;">
    </p>
</p>
<br/>
<!--  最原始:添加padding-->
<p style="background:red;width:500px;height:60px;position:relative">
    <p style="background:yellow;width:10px;height:10px;position:absolute;left:0px;top:0px;" >
    </p>
    <p style="background:blue;width:100px;height:20px;position:absolute;left:10px;top:10px;padding:10px;">
    </p>
</p>
<br/>
<!--  最原始:添加botder-->
<p style="background:red;width:500px;height:60px;position:relative">
    <p style="background:yellow;width:10px;height:10px;position:absolute;left:0px;top:0px;" >
    </p>
    <p style="background:blue;width:100px;height:20px;position:absolute;left:10px;top:10px;border:10px solid yellow;margin:5px;">
    </p>
</p>
Copy after login

Front-end interview experience summary

RunJS上边分享的代码

3.BFC(块级格式化上下文)

  • 清除遮挡

    <p class="left"></p>
    <p class="right">    </p>
    .left {
    width: 100px;
    height: 100px;
    background: red;
    float: left;
    }
    .right {
    height: 200px;
    background: yellow;
    overflow:hidden;//属性清楚遮挡
    }
    Copy after login
  • 关闭浮动

  • 解决垂直双边距问题

    <p style="background:gray;width:300px;height:300px;overflow:auto">
        <p style="background:green;margin-top:10px;float:left;width:20px;height:20px">    
        </p>
        <p style="background:red;width:50px;height:50px;margin-top:40px;"></p>
    </p>
    Copy after login


BFC的作用

http://www.php.cn/

4.flex(css3新特性)

<p class="container">
  <p class="box"></p>
    <p class="box"></p>
    <p class="box"></p>
    <p class="box"></p>
</p>    
.container {
  display: flex;
  flex-flow: row;
    width:300px;
    height:100px;
    background:gray;
    justify-content:space-around
}
.box {
  width: 20px;
    background:yellow;
    height:20px;
}
Copy after login

Front-end interview experience summary

flex参考1

flex参考2

在线例子:http://www.php.cn/

5.JS原型和原型链

个人觉得讲的很好的js原型、原型链

原型链

function Foo(){
}
var a = new Foo();//new的操作做了什么
var a = new Object()
a.__proto__ = Foo.prototype
Foo.call(a)
Copy after login

6.闭包

闭包:当函数a的内部函数b被函数a外的一个变量引用的时候,就创建了一个闭包。

function a(){
  var i=0;
  function b(){
     alert(i);       
  }       
  return b;   
}   
var c = a();   
c();
Copy after login

7.http

请求头字段和状态码

Front-end interview experience summary

http状态码

8.数组去重算法(时间/空间复杂度)

数组去重

时间复杂度空间复杂度也不会啊。

X.说说你做前端的优势

除了技术,这个也问?感觉没啥优势,优势是移动端经验相对多一点

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
1 months ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

An article about memory control in Node An article about memory control in Node Apr 26, 2023 pm 05:37 PM

The Node service built based on non-blocking and event-driven has the advantage of low memory consumption and is very suitable for handling massive network requests. Under the premise of massive requests, issues related to "memory control" need to be considered. 1. V8’s garbage collection mechanism and memory limitations Js is controlled by the garbage collection machine

PHP and Vue: a perfect pairing of front-end development tools PHP and Vue: a perfect pairing of front-end development tools Mar 16, 2024 pm 12:09 PM

PHP and Vue: a perfect pairing of front-end development tools. In today's era of rapid development of the Internet, front-end development has become increasingly important. As users have higher and higher requirements for the experience of websites and applications, front-end developers need to use more efficient and flexible tools to create responsive and interactive interfaces. As two important technologies in the field of front-end development, PHP and Vue.js can be regarded as perfect tools when paired together. This article will explore the combination of PHP and Vue, as well as detailed code examples to help readers better understand and apply these two

Questions frequently asked by front-end interviewers Questions frequently asked by front-end interviewers Mar 19, 2024 pm 02:24 PM

In front-end development interviews, common questions cover a wide range of topics, including HTML/CSS basics, JavaScript basics, frameworks and libraries, project experience, algorithms and data structures, performance optimization, cross-domain requests, front-end engineering, design patterns, and new technologies and trends. . Interviewer questions are designed to assess the candidate's technical skills, project experience, and understanding of industry trends. Therefore, candidates should be fully prepared in these areas to demonstrate their abilities and expertise.

How to use Go language for front-end development? How to use Go language for front-end development? Jun 10, 2023 pm 05:00 PM

With the development of Internet technology, front-end development has become increasingly important. Especially the popularity of mobile devices requires front-end development technology that is efficient, stable, safe and easy to maintain. As a rapidly developing programming language, Go language has been used by more and more developers. So, is it feasible to use Go language for front-end development? Next, this article will explain in detail how to use Go language for front-end development. Let’s first take a look at why Go language is used for front-end development. Many people think that Go language is a

Is Django front-end or back-end? check it out! Is Django front-end or back-end? check it out! Jan 19, 2024 am 08:37 AM

Django is a web application framework written in Python that emphasizes rapid development and clean methods. Although Django is a web framework, to answer the question whether Django is a front-end or a back-end, you need to have a deep understanding of the concepts of front-end and back-end. The front end refers to the interface that users directly interact with, and the back end refers to server-side programs. They interact with data through the HTTP protocol. When the front-end and back-end are separated, the front-end and back-end programs can be developed independently to implement business logic and interactive effects respectively, and data exchange.

C# development experience sharing: front-end and back-end collaborative development skills C# development experience sharing: front-end and back-end collaborative development skills Nov 23, 2023 am 10:13 AM

As a C# developer, our development work usually includes front-end and back-end development. As technology develops and the complexity of projects increases, the collaborative development of front-end and back-end has become more and more important and complex. This article will share some front-end and back-end collaborative development techniques to help C# developers complete development work more efficiently. After determining the interface specifications, collaborative development of the front-end and back-end is inseparable from the interaction of API interfaces. To ensure the smooth progress of front-end and back-end collaborative development, the most important thing is to define good interface specifications. Interface specification involves the name of the interface

Can golang be used as front-end? Can golang be used as front-end? Jun 06, 2023 am 09:19 AM

Golang can be used as a front-end. Golang is a very versatile programming language that can be used to develop different types of applications, including front-end applications. By using Golang to write the front-end, you can get rid of a series of problems caused by languages ​​​​such as JavaScript. For example, problems such as poor type safety, low performance, and difficult to maintain code.

Golang framework interview questions collection Golang framework interview questions collection Jun 02, 2024 pm 09:37 PM

The Go framework is a set of components that extend Go's built-in libraries, providing pre-built functionality (such as web development and database operations). Popular Go frameworks include Gin (web development), GORM (database operations), and RESTful (API management). Middleware is an interceptor pattern in the HTTP request processing chain and is used to add functionality such as authentication or request logging without modifying the handler. Session management maintains session status by storing user data. You can use gorilla/sessions to manage sessions.

See all articles