查看: 1670| 回复: 4
跳转到指定楼层
上一主题 下一主题
收起左侧

[其他] Onsite的时候可以选择非主流语言吗?

全局:

2021(10-12月)-CS硕士+5-10年 | 网上海投|BayArea湾区 码农类General全职@no idea

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

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

x
从3月份一直在用scala 刷LC。有多少公司phone screening / onsite的时候可以用 Scala 或者其他非主流语言来答?
比如说,如果让写个BST iterator (LC 173),然后我这么写会不会增加沟通成本?:

  1. class BSTIterator(_root: TreeNode) {
  2.   private def fold[A](root: TreeNode, z: A, f: (TreeNode, A, A) => A): A = {
  3.     @scala.annotation.tailrec
  4.     def go(n: TreeNode, cont: A => A): A = {
  5.       n match {
    . 1point 3acres
  6.         case null => cont(z)
  7.         case _    => go(n.left, lcont(n.right, n, cont))
  8.       }. 1point3acres.com
  9.     }. .и
  10. . 1point 3acres
  11.     def lcont(
  12.         n: TreeNode,
  13.         m: TreeNode,
  14.         cont: A => A
  15.     ): A => A = lr => go(n, rcont(m, lr, cont))

  16.     def rcont(.
  17.         m: TreeNode,. 1point3acres
  18.         lr: A,
  19.         cont: A => A
  20.     ): A => A = rr => cont(f(m, lr, rr))

  21.     go(root, identity).--
  22.   }

  23.   var stream: LazyList[Int] = fold(
  24.     _root,.--
  25.     LazyList[Int](),
  26.     (t: TreeNode, lr: LazyList[Int], rr: LazyList[Int]) =>
  27.       (lr #::: (t.value #:: rr))
  28.   )-baidu 1point3acres

  29.   def next(): Int = {
  30.     val r = stream.head
  31.     stream = stream.tail
  32.     r
  33.   }.--
  34. -baidu 1point3acres
  35.   def hasNext(): Boolean = {. check 1point3acres for more.
  36.     stream.headOption.isDefined. Waral dи,
  37.   }

  38. }. 1point 3acres
复制代码



上一篇:讲讲我了解的巨硬hiring event 和 team match(包你看了觉得不亏)
下一篇:请问BQ回答在不同轮能不能重复呢?
全局:
我感觉。。。可以但是没必要。。
感觉面试官能看懂但是得多花至少20%时间交流细节
回复

使用道具 举报

全局:
会…Python 大法好
回复

使用道具 举报

全局:
咋寻思的呢?
组面的时候
我是面试官,来了俩人 一个用我组语言java 一个用了个c#. check 1point3acres for more.
我必定挂c#因为我找的是java
现在的ng最大的短板就是 简历上 java js php python c++ 都会…
然后写代码 java能写出 string[i]这样的syntax…

选一门语言冲到底
回复

使用道具 举报

🔗
dorisH 2021-4-10 05:03:13 | 只看该作者
全局:
会。。如果要写抽象的让大家都看不懂的东西那我早用c++各种高级特性一锅乱炖了。。面试还是python大法好,简单直接,一看就懂。
回复

使用道具 举报

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

本版积分规则

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