pdd面试
​全程在手撕代码
​三道题,第二题还扩展功能了
​难得我抓耳挠腮
​比较想吐槽的是为啥编程界面不能自动提示啊,打错了好多字符😑
​果然,高强度高薪资的工作不好搞啊
全部评论
几面呀
点赞 回复 分享
发布于 2023-09-10 18:10 河北
一面吗
点赞 回复 分享
发布于 2023-09-04 10:02 广东
可以投华为车BU试试哦,笔试难度舒适,岗位多多,有意可私聊
点赞 回复 分享
发布于 2023-09-03 22:03 上海
我也是上来写三道题,简历一点没问。。。
点赞 回复 分享
发布于 2023-09-03 21:59 云南
拼多多开了吗家人 ?
点赞 回复 分享
发布于 2023-09-03 21:58 江苏

相关推荐

得物、拼多多经常考,倒计时组件1.倒计时组件2.如何实现精确计时(setInterval 1s先就update以前知道写但没考虑到为什么,时间戳同步)// Countdown.jsximport React, { useEffect, useState, useRef } from 'react';/*** props:*  - endAt: number (timestamp ms) 或 Date*  - onFinish?: () => void*  - tickMs?: number (minimal tick granularity, default 1000)*/export default function Countdown({ endAt, onFinish, tickMs = 1000 }) {const endTs = typeof endAt === 'number' ? endAt : endAt.getTime();const [remaining, setRemaining] = useState(Math.max(0, endTs - Date.now()));const mounted = useRef(true);useEffect(() => {mounted.current = true;// initial syncfunction update() {const now = Date.now();const rem = Math.max(0, endTs - now);if (!mounted.current) return;setRemaining(rem);if (rem === 0) {onFinish?.();return;}// Align next update to wall-clock second boundary (or tickMs)const delay = Math.min(tickMs,1000 - (now % 1000) // align to next second for nicer UX);// If <1s left, use requestAnimationFrame for smoothnessif (rem <= 1000) {requestAnimationFrame(update);} else {setTimeout(update, delay);}}update();return () => {mounted.current = false;};}, [endTs, onFinish, tickMs]);const sec = Math.ceil(remaining / 1000);const mm = Math.floor(sec / 60);const ss = sec % 60;return (<div>{mm}:{String(ss).padStart(2, '0')}</div>);}
查看2道真题和解析
点赞 评论 收藏
分享
评论
1
1
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务