注册一亩三分地论坛,查看更多干货!
您需要 登录 才可以下载或查看附件。没有帐号?注册账号 
x
Recruiter推的,第一轮是一个线上测试,总共三题
第一题是- /**
- * Test One: Find an ID in a simple tree
- *
- * Given a tree of items with the interface `TreeNode` above,
- * Implement a method which returns the ID of the first node where `values`
- * in the node matches `value` passed into the method
- *
- Example tree:
- const items = [
- {id: 1, values: [100, 101], children: [
- {id: 10, values: [1000, 1001]}
- ]},
- {id: 2, values: [200, 201]},
- {id: 3, values: [300, 301], children: [
- {id: 11, values: [1100, 1101]},
- {id: 9, values: [900, 901]},
- {id: 8, values: [800, 801], children: [
- {id: 7, values: [700, 701]},
- {id: 6, values: [600, 601]}
- ]}
- ]}
- ]
- findIdInTreeByValue(items, 601) // => 6
- * See `index.spec.tsx` for basic test cases
- */
复制代码 UZ_CODE_3 ]总体还是挺简单的 还在等结果。 |