📣 黑五价提前开抢|VIP一年通行证5折,蓝莓、Offer多多同步特惠
回复: 7
跳转到指定楼层
上一主题 下一主题
收起左侧

FB一轮店面

全局:

2016(7-9月) 码农类General 本科 全职@meta - 内推 - 技术电面  | | Pass | 应届毕业生

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

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

x
一轮店面, 两道题, 第二题拖得有点久, 不知不觉就到时间了。
1. 2Sum
2. Remove invalid parentheses, 只需要返回一个结果。 本来刷过的lc那个hard的版本, 结果忘了怎么做的了, 出了好多bug, fix了一个又一个, 最
您好!
本帖隐藏的内容需要积分高于 188 才可浏览
您当前积分为 0。
使用VIP即刻解锁阅读权限或查看其他获取积分的方式
游客,您好!
本帖隐藏的内容需要积分高于 188 才可浏览
您当前积分为 0。
VIP即刻解锁阅读权限 或 查看其他获取积分的方式
Unlock interview details and practice with AI
Popular Interview Questions from Top Companies
补充内容 (2016-7-19 10:32):
对了Onsite之后又给我发了coding puzzle, 做了之后又等了一周才给offer。 从店面到offer等了一个半月

评分

参与人数 3大米 +43 收起 理由
lefthook + 3 很有用的信息!
laonawuli + 10 感谢分享!
Jester_Z + 30

查看全部评分


上一篇:有没有小伙伴知道Alere这个公司?收到他家Data Analyst面试通知,求经验分享~
下一篇:Amazon onsite面经 + 选组求助
🔗
laonawuli 2016-6-2 14:15:11 | 只看该作者
全局:
谢谢楼主 希望onsite后 回来update面经~~!!!
回复

使用道具 举报

🔗
 楼主| netfish 2016-7-19 10:15:17 | 只看该作者
本楼:
全局:
onsite:
回复

使用道具 举报

🔗
mulberry 2016-7-20 07:08:54 | 只看该作者
全局:
感谢更新onsite面经,恭喜拿到offer
回复

使用道具 举报

全局:
谢谢lz。
lz有被问道什么设计题吗?
回复

使用道具 举报

🔗
 楼主| netfish 2016-7-22 05:48:44 | 只看该作者
全局:
hunter12345654 发表于 2016-7-22 05:40
谢谢lz。
lz有被问道什么设计题吗?

没有。 本科的new grad是没有设计题的。只有2轮coding和一轮behav
回复

使用道具 举报

全局:
写了个答案。。感觉好丑陋。。
  1. public class FBparenthese {
  2.     public ArrayList<String> parenses(String s){
  3.         ArrayList<String> rst = new ArrayList<>();
  4.         ArrayList<Character> path = new ArrayList<>();
  5.         helper(s,rst,path,0,0);
  6.         int len = 0;
  7.         for(String ss : rst){
  8.             if(ss.length() > len){
  9.                 len = ss.length();
  10.             }
  11.         }
  12.         ArrayList<String> newrst = new ArrayList<>();
  13.         for(String ss : rst){
  14.             if(ss.length() == len){
  15.                 newrst.add(ss);
  16.             }
  17.         }
  18.         return newrst;
  19.     }
  20.     private void helper(String s, ArrayList<String> rst,ArrayList<Character> path, int pos,int leftcount) {
  21.        if(pos == s.length()){
  22.            String ss ="";
  23.            for(Character c: path){
  24.                ss = ss + c;
  25.            }
  26.            if(!rst.contains(ss) && leftcount == 0){
  27.                rst.add(ss);
  28.            }
  29.            return;
  30.        }
  31.        if(s.charAt(pos) == '('){
  32.            //加到path
  33.            path.add('(');
  34.            helper(s,rst,path,pos+1,leftcount+1);
  35.            path.remove(path.size()-1);
  36.            //不加到path
  37.            helper(s,rst,path,pos+1,leftcount);
  38.        }else if(s.charAt(pos)==')'){
  39.            if(leftcount > 0){
  40.                //加
  41.                 path.add(')');
  42.                 helper(s,rst,path,pos+1,leftcount-1);
  43.                 path.remove(path.size()-1);
  44.                 //不加
  45.                 helper(s,rst,path,pos+1,leftcount);
  46.            }else{
  47.                 helper(s,rst,path,pos+1,leftcount);
  48.            }
  49.        }else{
  50.            path.add(s.charAt(pos));
  51.            helper(s,rst,path,pos+1,leftcount);
  52.        }
  53.     }
  54.     public static void main(String[] args) {
  55.         FBparenthese fb = new  FBparenthese();
  56.         System.out.println(fb.parenses("(a)())()").toString());
  57.     }
  58. }
复制代码
回复

使用道具 举报

🔗
豆小凡 2016-12-14 05:07:34 | 只看该作者
全局:
楼主方便说一下你coding puzzle的题目嘛。。。然后做完之后下一步是啥
回复

使用道具 举报

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

本版积分规则

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