腾讯 csig 25 前端(一面)

面试官挺好的,比较友善,会引导问题;可能是开会迟来了比较久

因为 base 在杭州,西安有点远就没有接受二面了(二面大约一天后来的面试邀请

  1. 自我介绍
  2. 项目和实习介绍
  3. 做过什么开源项目吗?(翻出 GitHub 拷打了一波)
  4. doctype (没听清,以为是 document.pipe…)
  5. 盒模型 / 有哪些 box-sizing
  6. 讲讲 flex 布局
  7. 讲讲有哪些 position
  8. 了解 webgl 吗
  9. 讲讲 RxJS(项目用到)为什么在项目中用 RxJS
  10. 手撕函数,说出输出了啥(跟面试官大眼瞪小眼 10 分钟,面试的时候看晕掉了,面试完再看豁然开朗…)
function fun(n, o) {
  console.log(o);
  return {
    fun: (m) => {
      return fun(m, n);
    },
  };
}

const a = fun(0).fun(1).fun(2).fun(3);

const b = fun(0)(1)(2)(3);

const c = fun(0).fun(1);
c.fun(2);
c.fun(3);

写一个 url 解析(从上往下暴力写了,完全忘记了有 new URL() 这回事…)

  1. 面试官:你这代码还有哪些可以改进的?缺陷在哪里
  2. 我:不牢靠,换一个别的 url 来就跑不通了;可读性极低,模块化没有,变量乱用;忘记 path 是 url 里面的哪一部分了….
const src = "https://github.com/search?q=thisway.js&type=repositories";

/**
 *
 * @param {*} src
 * @returns
 */
const getRouteParams = (src) => {
  const protocal = src.substring(0, src.indexOf(":"));

  const withOutProtocal = src.substring(src.indexOf("//") + 2);
  const domainEnd = withOutProtocal.indexOf("/");
  const domain = withOutProtocal.substring(0, domainEnd);

  const path = withOutProtocal.substring(
    domainEnd + 1,
    withOutProtocal.indexOf("?")
  );
  const pathWithDomain = domain + "/" + path;

  const queries = withOutProtocal.substring(withOutProtocal.indexOf("?") + 1);
  const queryList = queries.split("&");
  const queryObj = queryList.map((q) => {
    const qs = q.split("=");
    return {
      [qs[0]]: qs[1],
    };
  });
  return {
    protocal,
    domain,
    path: pathWithDomain,
    getParams: queryObj,
  };
};

const ans = getRouteParams(src);
console.log(ans);

反问环节,具体记不清了,问了类似这样的问题: 面试官,请问你为什么选择现在这个岗位

  1. 离家近(?)
  2. 平台好(?)
全部评论
我也在杭州
点赞
送花
回复
分享
发布于 04-23 09:46 浙江
同学 考虑阿里巴巴钉钉的前端实习岗吗 可部门直推
点赞
送花
回复
分享
发布于 04-25 16:46 浙江
滴滴
校招火热招聘中
官网直投

相关推荐

3 10 评论
分享
牛客网
牛客企业服务