1. binary tree inorder traversal 不能用recursive写 (LC原题)
2. 比如有个数组F={1,3, 4, 5, 2, 0}, A=3, 那么F[A]=5, F[F[A]]=0, F[F[F[A]]]=1....这样下去求第N个数是多少. from: 1point3acres.com/bbs 
3. first missing positive(LC原题)
4. 不用写代码,问得hashmap和hashcode的知识

1.Round Robin
一个处理器要处理一堆request,一次只能处理一条,每次执行一个任务最多执行时间q,接着执行等待着的下一个任务。若前一个任务没执行完则放到队尾,等待下一次执行
假设只要有任务开始以后cpu是不会空闲的,也就是说cpu开始后如果空闲了就说明没有任务了,另外Robin Round最后返回值是float
    public static float waitingTimeRobin(int[] arrival,int[] run, int q)
 
2.Rotate Matrix (
    把一个m*n的矩阵旋转90度,给一个flag规定是向左转还是向右转
. 1point3acres.com/bbs
3.Binary search tree minimum sum from root to leaf
    跟BST没啥关系,不要看到BST就以为是最左边的路径之和(左边路径可以很长,右边路径可以很短),用递归做很简单
 
4.insert into cycle linked list
    插入一个新的节点到一个sorted cycle linkedlist,返回新的节点。给的list节点不一定是最小节点
 
5.Greatest Common Divisor
    就是给一个数组找这些数的最大公约数
 
6.Shorted job first
    一个处理器要处理一堆request,一次只能处理一条,如果它有几个积压着的requests,它会先执行持续时间短的那个;对于持续时间相等的requests,先执行最早到达处理器的request。问平均每个request要等多久才能被处理。input:requestTimes[],每个request到达处理器的时间; durations[] 每个request要处理的持续时间。 两个数组是一一对应的,并已按requestTimes[] 从小到大排序过
    public double CalWaitingTime(int requestTimes[], int[] durations[]){}
    用priorityqueue做,地里有一个两层循环的答案,没仔细看,做完round robin以后发现思路很相似。注意用priorityqueue写comparator的时候,要先判断两者的execute time,如果execute time相同,则返回arrival time之差,即先按执行时间排序,若执行时间相同则按到达的时间排。
 
7.Valid Parenthesis
    给你一个str,里面只有 '('和‘)’,让你数valid pairs一共有多少,如果不是valid就返回-1. (判断是不是valid的parenthesis string,不是的话返回-1,是的话返回valid pair个数,即String.length() / 2 )
 
8.LRU Cache count miss
    实现以下LRU Cache再判断啥时候miss就好了,返回miss数。建议看看用LinkedHashMap实现lru cache, 代码很简洁。
 
9.Day chang(cell growth)
    int[] dayChange(int[] cells, int days), cells 数组,有8个元素,每天的变化情况是 当前位置 cell == (cell[i - 1] == cell[i + 1]) ? 0 : 1, 左右相等,当前位置为0, 不等为1, 默认 cells[0]左边 和 cells[cells.length - 1]右边的位置元素都是0, 求days天后的变化.
-google 1point3acres
10.Maze
    给个array,其中只有一格是9,其他格子是0或1,0表示此路不通,1表示可以走,判断从(0,0) 点开始上下左右移动能否找到这个是9的格子
 
11.subtree
 
12.sametree
    判断两棵树是否相同(结构和值)
.1point3acres缃�
另外,1. 若是用Java,用到queue, list啥的记得前面手动import java.util.*   2.所有函数都是static的,所以自己写其他helper函数的时候记得加上static

OA1的coding是two sum pair
                OA2的coding是Shortest Job First 和 循环链表插入元素

interview collect的更多相关文章

  1. UNIX command Questions Answers asked in Interview

    UNIX or Linux operating system has become default Server operating system and for whichever programm ...

  2. Cracking Digital VLSI Verification Interview 第四章

    目录 Hardware Description Languages Verilog SystemVerilog 对Cracking Digital VLSI Verification Intervie ...

  3. Pramp mock interview (4th practice): Matrix Spiral Print

    March 16, 2016 Problem statement:Given a 2D array (matrix) named M, print all items of M in a spiral ...

  4. WCF学习系列二---【WCF Interview Questions – Part 2 翻译系列】

    http://www.topwcftutorials.net/2012/09/wcf-faqs-part2.html WCF Interview Questions – Part 2 This WCF ...

  5. WCF学习系列一【WCF Interview Questions-Part 1 翻译系列】

    http://www.topwcftutorials.net/2012/08/wcf-faqs-part1.html WCF Interview Questions – Part 1 This WCF ...

  6. Amazon Interview | Set 27

    Amazon Interview | Set 27 Hi, I was recently interviewed for SDE1 position for Amazon and got select ...

  7. Java Swing interview

    http://www.careerride.com/Swing-AWT-Interview-Questions.aspx   Swing interview questions and answers ...

  8. Oracle forall bulk collect批量数据更新

    对于数据量较大的插入操作可采用此种方法操作,注意: limit减少内存占用,如果数据量较大一次性全部加载到内存中,对PGA来说压力太大,可采用limit的方法一次加载一定数量的数据,建议值通常为100 ...

  9. Pramp - mock interview experience

    Pramp - mock interview experience   February 23, 2016 Read the article today from hackerRank blog on ...

随机推荐

  1. Windows 应用程序结构

    Windows 应用程序结构

  2. 添加“返回顶部”小图标按钮的JS(JavaScript)代码详解

    如何给自己的网站添加方便快捷的"返回顶部"小图标按钮呢?如下图: JS源代码: /** * JavaScript脚本实现回到页面顶部示例 * @param acceleration ...

  3. DropdownList的处理总结

    创建一: List<SelectListItem> items = new List<SelectListItem>() { new SelectListItem(){Text ...

  4. HDU 1020 Encoding POJ 3438 Look and Say

    Encoding Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Su ...

  5. linux自旋锁

    一.前言 在linux kernel的实现中,经常会遇到这样的场景:共享数据被中断上下文和进程上下文访问,该如何保护呢?如果只有进程上下文的访问,那么可以考虑使用semaphore或者mutex的锁机 ...

  6. Tomjson - json 解析库

    Tomjson - 一个"短小精悍"的 json 解析库 Tomjson,一个"短小精悍"的 json 解析库,tomjson使用Java语言编写,主要作用是把 ...

  7. webstrom 常用快捷键

    最近在学习javascript,同时发现了一款非常好用的IDE webstrom 现在记录改IDE的快捷键 1. ctrl + shift + n: 打开工程中的文件,目的是打开当前工程下任意目录的文 ...

  8. 开源语音识别系统 Simon

    http://www.lupaworld.com/proj.php?mod=view&cid=&id=824 语音识别系统 Simon:Simon 是一个开源的语音识别系统,它不仅可以 ...

  9. iOS5系统API和5个开源库的JSON解析速度测试

    iOS5系统API和5个开源库的JSON解析速度测试 iOS5新增了JSON解析的API,我们将其和其他五个开源的JSON解析库进行了解析速度的测试,下面是测试的结果和工程代码附件. 我们选择的测试对 ...

  10. Painting Storages(ZOJ)

    There is a straight highway with N storages alongside it labeled by 1,2,3,...,N. Bob asks you to pai ...