LogoLogo
github
  • 💪Upupup
  • React
    • hook
    • redux
    • Router
    • umimax+nest.js 实现 权限管理系统
    • umimax + Nest.js 实现权限管理系统
  • Vue
    • effectScope 是干啥的
    • Object.assign()
    • 响应式理解
    • @babel/preset-env 问题
    • 自定义指令
    • 问题及解决
    • 🧐权限管理(动态路由)
  • docker
    • Docker 常用命令
    • Docker部署遇到的问题
    • Docker Compose 常用命令
    • docker修改daemon.json
    • jenkins
    • Jenkinsfile 语法进阶
    • nginx配置
    • 问题
    • 玩转Nginx:轻松为Docker部署的服务添加域名的完美指南
    • Docker部署前后端项目:经验分享与问题解决
  • git
    • command
    • problem
    • rebase实践
  • 前端开发面试题集
    • CSS 面试题
    • 前端工程化面试题
    • HTML 面试题
    • JavaScript 面试题
    • NestJS 面试题
    • Node.js 面试题
    • 性能优化面试题
    • React 面试题
    • 安全面试题
    • Vue 面试题
  • interviewer
    • 计算机网络
    • 性能优化
  • leetcode
    • 算法
      • 分治算法
      • 滑动窗口与双指针
        • 🦸定长滑动窗口
        • 🚴不定长滑动窗口
        • 🚴‍♂️单序列双指针
      • 回溯
      • 二分法
  • nestjs
    • mail
    • mini-order
    • nestjs
    • prisma
    • 登录注册
  • nextjs
    • 用 V0 和 Cursor 实现全栈开发:从小白到高手的蜕变
  • tauri
    • 思路
    • 自动通知应用升级
  • vite
    • vite实现原理
  • webpack
    • 资料
  • 工具
    • Eslint
    • jenkins
    • 关于cicd
  • 微信小程序
    • ScoreDeck
    • h5跳转小程序问题
  • 思路
    • carTool
  • 操作系统学习
    • Linux命令
    • 计算机是如何计数的
    • nginx
      • location
      • try_files
  • 浏览器
    • session、location
    • web crypto
    • 性能监控和错误收集与上报
    • 预请求
  • 知识点整理
    • 知识点整理
  • 面试
    • Promise
    • 备战
    • 数码3
    • 腾娱
    • 腾讯云智
    • 重复请求合并
  • 前端工程化
    • 在 pnpm Monorepo 中使用公共方法包
由 GitBook 提供支持
在本页
  • 📝 主旨内容
  • 一面
  • 1.如何实现埋点的
  • 2.如何在浏览器关闭时进行上报
  • 事件循环
  • 项目优化的点
  • promise
  • 闭包
  • 笔试题
  • 二面
  • 🤗 总结归纳

这有帮助吗?

在GitHub上编辑
  1. 面试

腾娱

上一页数码3下一页腾讯云智

最后更新于5个月前

这有帮助吗?

😀 腾娱面试总结

📝 主旨内容

一面

1.如何实现埋点的

2.如何在浏览器关闭时进行上报

navigator.sendBeacon

image-20240514111550606

事件循环

项目优化的点

promise

闭包

笔试题

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Bug排查练习</title>
</head>
<body>
  <div id="app">
    <h1>{{ message }}</h1>
    <button @click="changeMessage">Change Message<tton>
  </div>

  <script src="https://cdn.jsdelivr.net/npm/vue@2.6.14/dist/vue.js"></script>
  <script>
    new Vue({
      el: '#app',
      data() {
        return {
          message: 'Hello World'
        };
      },
      methods: {
        changeMessage() {
          const promise = new Promise(function(resolve, reject) {
            setTimeout(function() {
              resolve('New Message');
            }, 1000);
          });

          promise.then(function(newMessage) {
            this.message = newMessage;
          });
        }
      }
    });
  </script>
</body>
<html>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>indexOf</title>
</head>
<body>
  <script>
    String.prototype.indexOf = function(searchString,position){
        // 完成该函数的实现
        return -1;
    }
    const paragraph = "I think Ruth's dog is cuter than your dog!";

    const searchTerm = 'dog';
    const indexOfFirst = paragraph.indexOf(searchTerm);

    console.log(`The index of the first "${searchTerm}" is ${indexOfFirst}`);
    // Expected output: "The index of the first "dog" is 15"

    console.log(
    `The index of the second "${searchTerm}" is ${paragraph.indexOf(
        searchTerm,
        indexOfFirst + 1,
    )}`,
    );
  </script>
</body>
<html>

二面

笔试题

输入:“10 + 2 * 30 - 0.5” 输出:69.5

const suanshu = (flag, index, result, num) => {
  const pre = num[index] === null ? result : +num[index]
  const next = num[index + 1] === null ? result : +num[index + 1]

  switch (flag) {
    case '+': return pre + next;
    case '-': return pre - next;
    case '*': return pre * next;
    case '/': if (next === 0) throw new Error('除数不能为0');
      return pre / next;
    default: return 0;
  }
}
const caculate = (str) => {
  const flag = []
  const num = []
  let str1 = ""
  const reg = ["*", "+", "-", "/"]

  const precedence = { '+': 1, '-': 1, '*': 2, '/': 2 };

  for (let i in str) {
    const f = reg.findIndex(item => item === str[i])
    if (f !== -1) {
      flag.push(str[i])
      num.push(str1.trim())
      str1 = ""
    } else {
      str1 += str[i]
      if (i == str.length - 1) {
        num.push(str1.trim())
      }
    }
  }
  const flagSortArr = flag.map((item, index) => ({
    name: item,
    sortIndex: index
  })
  ).sort((a, b) =>
    precedence[b.name] - precedence[a.name]
  )
  let result = 0
  const clear = (index1) => {
    flag[index1] = null
    num[index1] = null
    num[index1 + 1] = null
  }
  for (flagItem of flagSortArr) {
    result = suanshu(flagItem.name, flagItem.sortIndex, result, num)
    clear(flagItem.sortIndex)
  }
  return result
}
const teststr = "10 - 20 * 30 / 10 +10"
console.log(caculate(teststr))//-40

笔试题 写的有点差劲了

🤗 总结归纳

笔试题相对以前 脑子很慢 还是转了一点 还是有所进步的

navigator.sendBeacon