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

Two Sigma Full Interview Questions: Onsite and Phone round - January 2022

全局:

2022(1-3月) 工程类 本科 全职@twosigma - 校园招聘会 - 技术电面 Onsite 视频面试  | 😐 Neutral 😣 Hard | Fail | 应届毕业生

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

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

x
本帖最后由 chickensoup2 于 2022-2-24 10:51 编辑

请给米饭。有关两个 Sigma 电话和现场的完整详细信息。

一月份有两个西格玛在现场,我得到了这些问题。
首先,我使用了 lintcode 和 leetcode 来准备。另外,1p3a。我浏览了整个带有两个 Sigma 标记的 leetcode 列表。对于我的电话回合,我期待随机数生成器,但是我被问到一个关于对字符串列表进行排序的问题。它比大多数 leetcode 问题更容易。您可以在编程语言中使用内置的排序算法。但是,在所有的面试中,你只能选择
您好!
本帖隐藏的内容需要积分高于 188 才可浏览
您当前积分为 0。
使用VIP即刻解锁阅读权限或查看其他获取积分的方式
游客,您好!
本帖隐藏的内容需要积分高于 188 才可浏览
您当前积分为 0。
VIP即刻解锁阅读权限 或 查看其他获取积分的方式
Unlock interview details and practice with AI
Popular Interview Questions from Top Companies
ng value
2.给出djb2哈希函数的伪代码
3.只需要支持put()和get()
4. 你的 hashmap 应该能够容纳大量的条目
5.编写自己的测试用例
--------
我无法通过所有问题的 100% 测试用例。这很艰难。我也没有睡好,所以在重要的采访之前一定要休息:)
祝你好运!
还有,请给米饭




























评分

参与人数 6大米 +18 收起 理由
mlee + 2 给你点个赞!
Leo_0201 + 1 楼主/层主请继续!
Chauncey + 1 给你点个赞!
1311553603 + 1 给你点个赞!
圆滚滚的panda + 1 谢谢分享!

查看全部评分


上一篇:微软OA
下一篇:亚麻 summer 2022 SDE intern 详细过经
推荐
 楼主| chickensoup2 2022-2-26 00:24:03 | 只看该作者
全局:
szy735 发表于 2022-2-25 12:00
xswl这个谷歌翻译。1p3a 有外国友人入侵了

帮助我,我会帮助你。:)
回复

使用道具 举报

🔗
heisenberg17 2022-2-25 01:38:45 | 只看该作者
全局:
非常感谢您的提问。关于 Q2,数字是字符串还是一个字符串和一个 int?
回复

使用道具 举报

🔗
szy735 2022-2-25 12:00:58 | 只看该作者
全局:
xswl这个谷歌翻译。1p3a 有外国友人入侵了
回复

使用道具 举报

🔗
 楼主| chickensoup2 2022-2-26 00:22:37 | 只看该作者
全局:
heisenberg17 发表于 2022-2-25 01:38
非常感谢您的提问。关于 Q2,数字是字符串还是一个字符串和一个 int?

它们都是字符串。 例如,s1 = "123" 和 s2 = "0"。 您需要获得 s1/s2。
回复

使用道具 举报

🔗
heisenberg17 2022-2-26 02:26:33 | 只看该作者
全局:
您好!
本帖隐藏的内容需要积分高于 100 才可浏览
您当前积分为 0。
使用VIP即刻解锁阅读权限或查看其他获取积分的方式
游客,您好!
本帖隐藏的内容需要积分高于 100 才可浏览
您当前积分为 0。
VIP即刻解锁阅读权限 或 查看其他获取积分的方式
Unlock interview details and practice with AI
Popular Interview Questions from Top Companies
回复

使用道具 举报

🔗
kevindx1120 2022-2-26 23:37:13 | 只看该作者
全局:
我写了一个简单的 string divider. 可能效率不是很高。但似乎凑合能用
  1. struct StringDivide {
  2.     bool nonsmaller(const std::string& s1, const std::string& s2) {
  3.         int n1 = s1.size();
  4.         int n2 = s2.size();
  5.         if (n1 != n2) return n1 > n2;
  6.         for (int i = 0; i < n2; i++) {
  7.             if (s1[i] != s2[i]) {
  8.                 return s1[i] > s2[i];
  9.             }
  10.         }
  11.         return true;
  12.     }

  13.     std::string substract(const std::string& s1, const std::string& s2) {
  14.         int n1 = s1.size();
  15.         int n2 = s2.size();
  16.         int carry = 0;
  17.         std::string ans;
  18.         for (int i = 0; i < n2; i++) {
  19.             int d = s1[n1-1-i] + carry - s2[n2-1-i];
  20.             if (d < 0) {
  21.                 carry = -1;
  22.                 ans.push_back('0' + 10 + d);
  23.             } else {
  24.                 ans.push_back('0' + d);
  25.                 carry = 0;
  26.             }
  27.         }
  28.         if (n1 == n2 + 1 && s1[0] + carry != '0') {
  29.             ans.push_back(s1[0] + carry);
  30.         }
  31.         std::reverse(ans.begin(), ans.end());
  32.         return ans;
  33.     }

  34.     std::pair<std::string, int> divide(std::string& s1, const std::string& s2) {
  35.         int ans = 0;
  36.         while (nonsmaller(s1, s2)) {
  37.             s1 = substract(s1, s2);
  38.             ans++;
  39.             std::cout << "inside loop " << s1 << "|" << ans << std::endl;
  40.         }
  41.         int j = 0;
  42.         while(j < s1.size() && s1[j] == '0') j++;
  43.         s1 = s1.substr(j, s1.size()-j);
  44.         return {s1, ans};
  45.     }

  46.     std::string solve(const std::string& s1, const std::string& s2) {
  47.         int n1 = s1.size(), n2 = s2.size();
  48.         if (s2 == "0") throw std::invalid_argument("divide by 0");
  49.         std::string ans;
  50.         std::string remain;
  51.         for (int i = 0; i < n1; i++) {
  52.             auto prefix = remain + s1.substr(i, 1);
  53.             std::cout << i << "|" <<  remain << "|" << prefix << "|" << ans << std::endl;
  54.             auto r = divide(prefix, s2);
  55.             remain = r.first;
  56.             ans.push_back('0' + r.second);
  57.         }
  58.         int j = 0;
  59.         while (j < ans.size() && ans[j] == '0') j++;
  60.         ans = ans.substr(j, ans.size()-j);
  61.         return ans.empty() ? "0" : ans;
  62.     }
  63. };
复制代码
回复

使用道具 举报

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

本版积分规则

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