首页 > ZOOM前端笔经面经
头像
Red_Ferrari
发布于 2021-10-13 14:07
+ 关注

ZOOM前端笔经面经

求求给我一个外企offer吧,攒一波人品,base苏州

笔试

判断一个字符串是否为合法ISBN10

我的代码

/**
 * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可
 *
 * 
 * @param isbn string字符串 
 * @return bool布尔型
 */
 function validISBN10( isbn ) {
  // write code here
  if (!isbn || (typeof isbn !== 'string')) return false;
  if (isbn.length !== 10) return false;
  let sum = 0;
  for (let i = 0; i <= 8; i++) {
    sum += (i + 1) * Number(isbn[i]);
  }
  if (isbn[9] === 'X') {
    sum += 10 * 10;
  } else {
    sum += 10 * Number(isbn[9]);
  }
  return sum % 11 === 0;
}
module.exports = {
  validISBN10 : validISBN10
};

输入m,n计算m^n的末位

我的代码

/**
 * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可
 *
 * 
 * @param str1 string字符串 
 * @param str2 string字符串 
 * @return int整型
 */
 function lastDigit( str1 ,  str2 ) {
  // write code here
  if (Number(str2) === 0) return 1;
  let base = Number(str1[str1.length - 1]);
  let exp = 0;
  if (base === 0 || base === 1 || base === 5 || base === 6) return base;
  if (base === 4 || base === 9) {
    exp = (Number(str2[str2.length - 1]) - 1) % 2 + 1;
  } else {
    exp = (Number(str2.slice(-2)) - 1) % 4 + 1;
  }
  return Math.pow(base, exp) % 10;
}
module.exports = {
  lastDigit : lastDigit
};

一面

个人介绍,项目经历

Vue双向绑定

Object.definePropety和Proxy区别

v-if和v-show区别

HTTPS和HTTP区别

TLS三次握手

数字签名

浏览器缓存

cache-control

cookie和session

localStorage和sessionStorage

口述算法:一堆数中的前十大数

(小顶堆)

反问

更多模拟面试

全部评论

(9) 回帖
加载中...
话题 回帖

近期热帖

历年真题 真题热练榜 24小时
技术(软件)/信息技术类
查看全部

热门推荐