回复: 18
跳转到指定楼层
上一主题 下一主题
收起左侧

zillow onsite总结

 
全局:

2016(1-3月) 码农类General 硕士 全职@zillow - 校园招聘会 - Onsite  | | Other | 应届毕业生

注册一亩三分地论坛,查看更多干货!

您需要 登录 才可以下载或查看附件。没有帐号?注册账号

x
写点啥回馈地里吧~~从这里收益不少,虽然不知道onsite结果如何,估计挂了?因为只有三轮,但是其中两轮都妥妥的顺利通过无bug,剩下一轮有一题没搞清楚面试官的意思,是关于hash collision的。大家回去看看基本概念,关于啥是linear hashing,quatratic hashing啥的。这里是我搜集的之前地里面试总结,有些leetcode有原题,有些我自己根据要求写的代码。总之不太难,大家加油
有米捧个米场,哈哈

zillow
Median of Two sorted Arrays

Product of Array Except Self

Question: A solution consists of four balls from a set of four different colors. The user tries to guess the solution.
If they guess the right color for the right spot, record it as being in the correct 'Location'. If it's the right color, but the wrong spot, record it as a correct 'Color'. For example: if the solution is 'BGRR' and the user guesses 'RGYY' they have 1 'Location' and 1 'Color'. A correct solution would be 4 'Location' and 0 'Color'.
Bulls and Cows

How would you discover a memory leak in a software product that contains thousands of lines?

You are given an array of integers and a sum. Find all pairs of integers that equal that sum.
Two sum

Factorial Trailing Zeroes

Given a 2^31 x 2^31 tic tac toe board, describe how you would store the state of the game to check if there is a winner.

Maximum Subarray


Find all subsets of a set

Swap nodes in pairs in a linked list

Lowest Common Ancestor of a Binary Search Tree
Lowest Common Ancestor of a Binary Tree
Find the Least Common Ancestor given two nodes of a binary tree. The nodes each have a reference to their parent node and you do not have the root node of the tree
??????????????????????????????????
public Node LCA(node A, node B){
        if(height(A) > height(B)){
                return LCA(B, A);
        }
        node t1 = A;
        node t2 = B;
        while(t1 != t2){
                if(t2.parent == null){
                        if(t1.parent == null){
                                return null;
                        }else{
                                t1 = t1.parent;
                        }
                }else{
                        t2 = t2.parent;
                }
        }
        return t1;
}

private int height(node A){
        int count = 0;
        while(A.parent != null){
                count++;
                A = A.parent;
        }
        return count;
}

class Node {
        int val;
        Node parent;
        Node(int x){
                val = x;
        }
}

Determine if two rectangular are overlapped
//check两个rectangle是否重叠
public class overlapRectangle {
        public static boolean check(Node topLeftA, Node topLeftB, Node bottomRightA, Node bottomRightB){
                //左右关系,用x
                if(bottomRightA.x <= topLeftB.x || bottomRightB.x <= topLeftA.x){
                        return false;
                }
                //上下关系,用y
                if(topLeftA.y <= bottomRightB.y || topLeftB.y <= bottomRightA.y){
                        return false;
您好!
本帖隐藏的内容需要积分高于 188 才可浏览
您当前积分为 0。
使用VIP即刻解锁阅读权限或查看其他获取积分的方式
游客,您好!
本帖隐藏的内容需要积分高于 188 才可浏览
您当前积分为 0。
VIP即刻解锁阅读权限查看其他获取积分的方式
Unlock interview details and practice with AI
Curated Interview Questions from Top Companies
(228, 175, 9)">                }
        }


        Collections.sort(count_map, new Comparator<Map.Entry<List<Integer>, Integer>>{
                public int compare(Map.Entry<List<Integer>, Integer> a, Map.Entry<List<Integer>, Integer> b){
                        return (b.getValue()).compareTo(a.getValue);
                }
        });

        int i = 0;
        List<Integer>[] result = new ArrayList<Integer>[10];
        for(Map.Entry<List<Integer>, Integer> entry : count_map){
                        result[i++] = entry.getKey();
                        if(i == 10){
                                break;
                        }
                }
        }
        return result;
}

class Log{
        date time;
        int userId;
        int pageId;
        public Log (date time, int userId, int pageId){
                this.time = time;
                this.userId = userId;
                this.pageId = pageId;
        }
}


fibonacci implementation
求那个斐波那契数列, 刚开始就写了简单的递归,然后他说给个index,是让返回这个数列所有斐波那契数的和。 只好在写个函数,把每个斐波那契数算出来,加入到一个arraylist里面,再去扫一遍arraylist加到一起。然后问怎么优化,就把算斐波那契数的函数里面改用DP做

判断一个node 是否是另一个 node 的 child 很简单一个 DFS 搞定
?????????????????????????????

Reverse Integer, 像这样:int reverse(1234), 返回4321

if (ret >= (Integer.MAX_VALUE - num % 10) / 10 && isPositive ||
    ret >= (Integer.MAX_VALUE - num % 10 + 1) / 10 && !isPositive) {
    throws new Exception;
}
I miss the edge case where you should check for max integer input, basically if input is larger then Max integer, the function should throws NumberFormatException

评分

参与人数 20大米 +264 收起 理由
wzzdc1996 + 2 很有用的信息!
charsonlin + 3 很有用的信息!
aaaaaria + 3 给你点个赞!
Saki诗琪 + 3 很有用的信息!
钟瑾继 + 3 很有用的信息!

查看全部评分


上一篇:Uber 技术电面 growth 跪了。
下一篇:3.7 Amazon video 求过TAT

本帖被以下淘专辑推荐:

推荐
zsimath 2016-3-8 11:09:56 | 只看该作者
全局:
不一定是四场。 我是三场面试 没见CTO 然后过的。  祝lz好运气。
回复

使用道具 举报

推荐
dou.bupt 2016-5-3 06:36:11 | 只看该作者
全局:
log file 的题,最后sort比较奇怪,hashmap sort之后,也不能保证顺序吧。还是用最小堆吧。

user friends 应该用类似tree level order traverse的方法吧

public List<String> getEmail(Node node){
        List<String> result = new ArrayList<String>();
        Queue<Node> queue = new Queue<Node>();
        queue.add(node);
        int count = 2;
        while(!queue.isEmpty()){
               // 每一层
             int size = queue.size();
             for(int i = 0; i< size; i++){
                Node curr = queue.poll();
                for(Node neighbor : neighbors){
                        if(neighbor.user.lastname.equals(curr.lastname)){
                                result.add(neighbor.email);
                        }
                        queue.add(neighbor);
                }
          }
                count--;
                if(count == 0){
                        break;
                }
        }
        return result;
}

求交流
回复

使用道具 举报

全局:
Find the first Common Parent, 感觉下面这方法会更好,原答案一些edge case没有很好地cover:
node* LCA(node* nd1, node* nd2){

node* cur1 = nd1;
node* cur2 = nd2;

// calculate nd1 height
int nd1_height = 0;
while(cur1->parent!=NULL){
nd1_height++;
cur1 = cur1->parent;
}

// calculate nd2 height
int nd2_height = 0;
while(cur2->parent!=NULL){
nd2_height++;
cur2 = cur2->parent;
}

int diff = nd1_height - nd2_height;

cur1 = nd1;
cur2 = nd2;

if(diff>0){
while(diff--){
cur1 = cur1->parent;
}
} else{
diff = -diff;
while(diff--){
cur2 = cur2->parent;
}
}

while(1){
if(cur1==NULL || cur2==NULL) break;
if(cur1 == cur2)
return cur1;
cur1 = cur1->parent;
cur2 = cur2->parent;
}

return NULL;
}
回复

使用道具 举报

🔗
houqingniao 2016-3-8 09:10:08 | 只看该作者
全局:
赞lz。预祝offer!!!
回复

使用道具 举报

🔗
ningchris 2016-3-8 09:45:21 | 只看该作者
全局:
见到CTO就有机会过
没见到就是必挂
当然也有像我这种的 见了CTO依然挂
回复

使用道具 举报

🔗
izacuckoo 2016-3-8 10:37:30 | 只看该作者
全局:
lz辛苦了 贫农捧个人场
回复

使用道具 举报

🔗
brooks 2016-3-8 11:00:47 | 只看该作者
全局:
ningchris 发表于 2016-3-8 09:45
见到CTO就有机会过
没见到就是必挂
当然也有像我这种的 见了CTO依然挂

额,我就是没见到CTO过了的
回复

使用道具 举报

🔗
brooks 2016-3-8 11:04:00 | 只看该作者
全局:
ningchris 发表于 2016-3-8 09:45
见到CTO就有机会过
没见到就是必挂
当然也有像我这种的 见了CTO依然挂

好像他家bar比较奇怪,就当攒人品好了,其他一切加油
回复

使用道具 举报

🔗
ningchris 2016-3-8 11:22:30 | 只看该作者
全局:
brooks 发表于 2016-3-8 11:00
额,我就是没见到CTO过了的

当时还是我的dream company啊
你现在是在那里工作吗?
回复

使用道具 举报

🔗
brooks 2016-3-9 03:21:05 | 只看该作者
全局:
ningchris 发表于 2016-3-8 11:22
当时还是我的dream company啊
你现在是在那里工作吗?

今年暑假入职。
回复

使用道具 举报

🔗
zhangyijun166 2016-3-21 10:44:57 | 只看该作者
全局:
brooks 发表于 2016-3-9 03:21
今年暑假入职。

Hello, 你也是summer入职嘛 可以加我微信 zhangyijun166, 加zillow2016群
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册账号
隐私提醒:
  • ☑ 禁止发布广告,拉群,贴个人联系方式:找人请去🔗同学同事飞友,拉群请去🔗拉群结伴,广告请去🔗跳蚤市场,和 🔗租房广告|找室友
  • ☑ 论坛内容在发帖 30 分钟内可以编辑,过后则不能删帖。为防止被骚扰甚至人肉,不要公开留微信等联系方式,如有需求请以论坛私信方式发送。
  • ☑ 干货版块可免费使用 🔗超级匿名:面经(美国面经、中国面经、数科面经、PM面经),抖包袱(美国、中国)和录取汇报、定位选校版
  • ☑ 查阅全站 🔗各种匿名方法

本版积分规则

>
快速回复 返回顶部 返回列表