Skip to content

D-Y-Innovations/interview_xzl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 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

3. 以排序二叉树为基础,实现 TreeMap,使增删改查节点的时间复杂度为O(logn)

class TreeMap {
// implement your code
}

let t = new TreeMap()
t.put(1, "v1")
t.put(2, "v2")
t.put(3, "v3")
t.get(2)  // "value2"
t.print()      // 按key升序输出,[{1: "v1"}, {2: "v2"}, {3: "v3"}]
t.delete(key1)
t.print()      // 按key升序输出,[{2: "v2"}, {3: "v3"}]

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

Contributors 4

  •  
  •  
  •  
  •