📣 独立日限时特惠: VIP通行证立减$68
回复: 6
跳转到指定楼层
上一主题 下一主题
收起左侧

Tiktok MLE糟糕体验

🔗
匿名用户-DZVCU  2023-8-22 12:57:39 |倒序浏览

2023(10-12月) MachineLearningEng 硕士 全职@bytedance - 猎头 - 技术电面  | 🙁 Negative 😐 Average | Other | 在职跳槽

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

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

x
本帖最后由 匿名 于 2023-8-22 00:58 编辑

tt MLE第一轮VO,国内面试官

先问了一些ML的基本知识和做过的project,这部分就不多说了
您好!
本帖隐藏的内容需要积分高于 188 才可浏览
您当前积分为 0。
使用VIP即刻解锁阅读权限或查看其他获取积分的方式
游客,您好!
本帖隐藏的内容需要积分高于 188 才可浏览
您当前积分为 0。
VIP即刻解锁阅读权限查看其他获取积分的方式
Unlock interview details and practice with AI
Curated Interview Questions from Top Companies

评分

参与人数 1大米 +5 收起 理由
匿名用户-FH25I + 5

查看全部评分


上一篇:Meta RL 求System Design 以及 Domain Design面精题分享
下一篇:Cisco sde intern 新鲜oa
地里匿名用户
🔗
匿名用户-EBPIK  2023-8-23 11:01:58
请问楼主面得是哪一个组呀?
回复

使用道具 举报

地里匿名用户
🔗
匿名用户-RIYMY  2023-8-23 15:50:50
我面tt的时候面试官在打电话的那个界面直接开启一个在线的ide 我还以为都是这样
回复

使用道具 举报

🔗
TimTime2019 2023-8-26 12:09:51 | 只看该作者
全局:
关于coding 题,如果不用hashmap,是否可以先sort based on absolute value,然后two pointer 在头和尾做? 但是正负号的情况比较难判断。

lz 你是怎么做的?
回复

使用道具 举报

🔗
xbt123 2023-8-28 12:58:46 | 只看该作者
全局:
TimTime2019 发表于 2023-8-25 23:09
关于coding 题,如果不用hashmap,是否可以先sort based on absolute value,然后two pointer 在头和尾做? ...

我觉得2pointers确实可以做,复杂度**O(n)**,但确实要考虑很多情况,我写了一下你可以看下有没有edge case没有考虑到的。
  1. public class twoProduct {
  2.     public static int[][] twoProduct(int[] nums, int k) {
  3.         List<Integer> copy = new ArrayList<>();
  4.         for (int num : nums) {
  5.             copy.add(num);
  6.         }
  7.         // sort by abs, for the same abs, negative ones are always at left
  8.         copy.sort((a, b) -> Math.abs(a) == Math.abs(b) ? a - b : Math.abs(a) - Math.abs(b));
  9.         List<int[]> res = new ArrayList<>();
  10.         // two pointers
  11.         int i = 0, j = copy.size() - 1;
  12.         while (i < j) {
  13.             int product = copy.get(i) * copy.get(j), productAbs = Math.abs(product), kAbs = Math.abs(k);
  14.             if (productAbs < kAbs) {
  15.                 i++;
  16.             } else if (productAbs > kAbs) {
  17.                 j--;
  18.             } else {
  19.                 if (product == k) {
  20.                     res.add(new int[]{copy.get(i++), copy.get(j--)});
  21.                     // don't put the same pair in the result
  22.                     // NOTE that we need to consider 0 here
  23.                     while (i < copy.size() && copy.get(i).equals(copy.get(i - 1)) && copy.get(i - 1) != 0) {
  24.                         i++;
  25.                     }
  26.                     if (copy.get(i - 1) == 0) {
  27.                         i--;
  28.                     }
  29.                     while (j >= 0 && copy.get(j).equals(copy.get(j + 1))) {
  30.                         j--;
  31.                     }
  32.                 } else {
  33.                     // product == -k
  34.                     // Note that all the negatives ones are at the left
  35.                     if (copy.get(i) < 0 && copy.get(j) < 0) {
  36.                         // the only chance to get the k is to move i to the right to get the positive i++
  37.                         i++;
  38.                     } else if (copy.get(i) > 0 && copy.get(j) > 0) {
  39.                         // the only chance to get the k is to move j to the left to get the positive j--
  40.                         j--;
  41.                     } else {
  42.                         while (++i < copy.size() && copy.get(i).equals(copy.get(i - 1))) ;
  43.                         while (--j >= 0 && copy.get(j).equals(copy.get(j + 1))) ;
  44.                         if (copy.get(i) * copy.get(j) == -k) {
  45.                             res.add(new int[]{-copy.get(i), copy.get(j)});
  46.                             // if [i] and [j] are opposite number, we don't repeat
  47.                             // e.g. for 1 and -1, we don't need to repeat the pair
  48.                             if (copy.get(i) + copy.get(j) != 0) {
  49.                                 res.add(new int[]{copy.get(i), -copy.get(j)});
  50.                             }
  51.                         } else if (copy.get(i) * copy.get(j + 1) == k) {
  52.                             res.add(new int[]{copy.get(i), copy.get(j + 1)});
  53.                         } else if (copy.get(i - 1) * copy.get(j) == k) {
  54.                             res.add(new int[]{copy.get(i - 1), copy.get(j)});
  55.                         }
  56.                     }
  57.                 }
  58.             }
  59.         }
  60.         int[][] resA = new int[res.size()][2];
  61.         for (int l = 0; l < res.size(); l++) {
  62.             resA[l] = res.get(l);
  63.         }
  64.         return resA;
  65.     }

  66.     public static void main(String[] args) throws Exception {
  67.         int[] a = new int[]{2, -2, -2, 2, -1, 4, -4, 1};
  68.         System.out.println(Arrays.deepToString(twoProduct(a, 4)));
  69.     }
  70. }
复制代码
回复

使用道具 举报

🔗
TimTime2019 2023-8-29 02:33:02 | 只看该作者
全局:
xbt123 发表于 2023-8-28 00:58
我觉得2pointers确实可以做,复杂度**O(n)**,但确实要考虑很多情况,我写了一下你可以看下有没有edge ca ...

我run了一下发现这两个case 返回的不一样, 看是否需要去重复比如 [a,b]  和 [b,a]是重复的
case 1: {0,1,-6,6} target 0 ,返回 [[0, 6], [0, -6], [0, 1]]
case2: {-1,1,-6,6} target 6 ,返回 [[-1, -6], [1, 6], [6, 1], [-6, -1]]

按理说 case1, 应该返回 [[0, 6], [0, -6], [0, 1], [6, 0], [-6,0], [1, 0]]
或者说 case1 是对的, case2应该只返回 (-1,-6) , (1, 6)
回复

使用道具 举报

🔗
xbt123 2023-8-29 09:29:33 | 只看该作者
全局:
TimTime2019 发表于 2023-8-28 13:33
我run了一下发现这两个case 返回的不一样, 看是否需要去重复比如 [a,b]  和 是重复的
case 1: {0,1,-6, ...

嗯嗯,我也考虑这个了,这个问题感觉还是要看面试官怎么说,没在leetcode见过类似的题。感谢回复
回复

使用道具 举报

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

本版积分规则

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