滴滴:2019校招 安全研发工程师 一二面
题解:滴滴:2019校招 安全研发工程师 一二面
已拿offer
一面
- 一个算法题
There are a total of n courses you have to take, labeled from 0 to n-1.
Some courses may have prerequisites, for example to take course 0 you have to first take course 1, which is expressed as a pair: [0,1]
Given the total number of courses and a list of prerequisite pairs, return the ordering of courses you should take to finish all courses.
Input: 2, [[1,0]]
Output: [0,1]
Explanation: There are a total of 2 courses to take. To take course 1 you should have finished course 0. So the correct course order is [0,1] .
Input: 4, [[1,0],[2,0],[3,1],[3,2]]
Output: [0,1,2,3] or [0,2,1,3]
Explanation: There are a total of 4 courses to take. To take course 3 you should have finished both courses 1 and 2. Both courses 1 and 2 should be taken after you finished course 0. So one correct course order is [0,1,2,3]. Another correct ordering is [0,2,1,3].
二面
各种项目相关问题
数据结构中“树结构”常用来干嘛
说一说你知道的树结构
简单介绍一下红黑树
红黑树和二叉树的关系异同
文件系统中用到的树结构具体是怎么样的
介绍一下B+树
介绍一下死锁
怎么避免死锁
2019-11-3:所有题目及解析
#滴滴##校招##Java工程师#