当前位置: 首页 > 面试经验 >

网易有道秋招二面

优质
小牛编辑
111浏览
2023-03-28

网易有道秋招二面

2022/9/21 16:00 1小时
这一面属实是被面试官拷打了,答的都不太好,等感谢信了

自我介绍

monorepo和multirepo的区别

monorepo技术方案有哪些

pnpm解决了什么问题

为什么包和依赖要放到同一个目录下

.pnpm/<packagename>@<version>/node_modules/<packagename>

讲项目

react里面如何用redux

connect原理

React Hooks 和 Vue Hooks的区别

TypeScript获取数据类型的方法

手写:实现类型PromiseResType,如下面的例子

// 验证
async function strPromise() {
  return "string promise";
}

interface Person {
  name: string;
  age: number;
}
async function personPromise() {
  return {
    name: "p",
    age: 12,
  } as Person;
}

type StrPromise = ReturnType<typeof strPromise>; // Promise<string>
// 反解
type StrPromiseRes = PromiseResType<StrPromise>; // str

type PersonPromise = ReturnType<typeof personPromise>; // Promise<Person>
// 反解
type PersonPromiseRes = PromiseResType<PersonPromise>; // Person

下面代码的输出结果
async function async1() {
  console.log('async1 start');
  await async2();
  console.log('async1 end');
}
async function async2() {
  console.log('async2 start');
  return new Promise((resolve, reject) => {
    resolve();
    console.log('async2 promise');
  })
}
console.log('script start');
setTimeout(function () {
  console.log('setTimeout');
}, 0);
async1();
new Promise(function (resolve) {
  console.log('promise1');
  resolve();
}).then(function () {
  console.log('promise2');
}).then(function () {
  console.log('promise3');
});
console.log('script end');

大文件上传

手写:金额格式化

反问

===================
9.26 收到感谢信



#网易##前端##前端工程师##23届秋招笔面经#
 类似资料: