Skip to content

D-Y-Innovations/interview-backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Test Problems

  1. 所有题目使用typescript 2.0以上版本来编写代码,不能采用javascript兼容模式

    提示:

    cd async-example
    npm install # 下载依赖,依赖定义在package.json
    node_modules/.bin/ts-node test.ts # 运行ts文件
  2. 请看async-example这个文件夹的例子

  3. 题目后面有相关提示可以参考

提交格式:

  1. 说明使用markdown文档在github提交
  2. 代码直接提交

1. 从多个网页爬取内容,然后进行解析

有10个网页,1.txt 到 10.txt

http:https://dy-public.oss-cn-shenzhen.aliyuncs.com/interviewTestData/1.txt

<abc> <de
f>data : 1992; name : agent 1 </def></abc>
  1. 格式有可能有区别
  2. 用 promise, async, await 分别实现并发、串行爬取
  3. 网页下载使用nodejs的http即可
  4. 使用正则表达式获取data后面的字段,将10个文件的data值全部获取,并相加

2. 编写 quicksort

参见QuickSort.ts文件,确保代码能在1000毫秒内通过测试

3. 实现一个二叉树,使插入、查询、删除的时间复杂度为O(logn)

class Tree {
// implement your code
}

let t = new Tree()
t.add(2)
t.hasValue(2)  // true
t.add(4)
t.add(4)
t.add(3)
t.print()      // 升序输出,[2, 3, 4]
t.remove(2)    // [3, 4]

node官方文档

typescript文档

建议使用visual studio code进行编写。

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published