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

字节跳动挂经

全局:

2020(4-6月) 码农类General 硕士 全职@bytedance - 内推 - 技术电面  | | Fail | 在职跳槽

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

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

x
上周面的,应该是挂了所以没联系,分享一下挂经。想吐槽一下他家hr,首先是很难联系上,有任何问题发邮件过去问没回音。其次面试给我安排了两轮也不在邮件里说明,而且两轮之间还间隔了十分钟左右,还好我当时没关页面面试官上线我才知道还有一轮。

第一轮:给一个字符串,要求你把里面重复的字符删除,保证每个字符只能出现一次,如果结果有多种可能性的话,要
您好!
本帖隐藏的内容需要积分高于 188 才可浏览
您当前积分为 0。
使用VIP即刻解锁阅读权限或查看其他获取积分的方式
游客,您好!
本帖隐藏的内容需要积分高于 188 才可浏览
您当前积分为 0。
VIP即刻解锁阅读权限查看其他获取积分的方式
Unlock interview details and practice with AI
Curated Interview Questions from Top Companies
充内容 (2026-06-30 12:48 +08:00):
时隔六年,又要面tiktok,回来看发现这两题都是leetcode的原题,当年真的是自己学术不精。。。

评分

参与人数 4大米 +11 收起 理由
阿鲁宾 + 1 给你点个赞!
es999lol + 1 赞一个!
Camphorliage + 1 给你点个赞!
匿名用户-Q5SXZ + 8

查看全部评分


上一篇:Z00X 两轮电话面经
下一篇:玄学公司 Applied Scientist Intern 挂经
全局:
第一题是刷题网316

评分

参与人数 2大米 +3 收起 理由
麻倉枼 + 1 很有用的信息!
yimeichihuo2 + 2 给你点个赞!

查看全部评分

回复

使用道具 举报

推荐
tanj 2020-5-14 07:21:46 | 只看该作者
全局:
qiaofengmarco 发表于 2020-5-14 06:26
老哥你考虑一下 cbacbc 这个情况

他的解法好像没什么问题吧, 用他的方法解cbacbc的话先是 cba -> bac -> acb -> abc
回复

使用道具 举报

全局:
ozox 发表于 2020/05/14 07:13:52
if input is: cbacbc

1. first, result = cba
2. next, 'c' ...
Not work for cdacd
回复

使用道具 举报

全局:
分人吧
我之前面的时候hr回复很快 描述也很清楚
可惜我碰到了不咋地的面试官 虽然水平应该很好 但不喜欢讨论 态度很冷 也不care你的回答

补充内容 (2020-5-12 16:11):
第一题想到一种O(n)解法
第二题没什么思路 不知道能不能dfs
回复

使用道具 举报

🔗
vanbupt 2020-5-13 07:14:30 | 只看该作者
全局:
同面了两轮面试官人很好交流很顺畅,题目很快做出来followup也接住了,但是还是挂了。。。不知道为什么,收到的邮件是我的work experience太少???
回复

使用道具 举报

🔗
ozox 2020-5-13 13:26:36 | 只看该作者
全局:
本帖最后由 ozox 于 2020-5-13 13:51 编辑

First problem:

1. Use a map, key is the char, value is a node of a doubly linked list (or just the location of the char in the input array)
2. Traverse the array from left to right:
    a. For each char, if it is not in the map, push it back to the current result so far.
    b. If the char is in the map, we need to decide whether use the current one or use the old one by comparing the char after the old char.
    c. If the current one makes smaller dictionary order, we delete the old one from the result and use the current char. Also need to update the map for the current position.

As for the example: ccbadbc
1. visit 'c', map empty, so result = "c", map['c'] = node(c)
2. visit second 'c', map['c'] not empty, so decide whether to use the old 'c' or current 'c', in this case, result is only one char, so doesn't matter. Let's just keep the result = "c" and map['c'] = node(c)
3. visit 'b', map['b'] empty, so result = "cb", map['b'] = node(b)
4. visit 'a', result = "cba", map['a'] = node(a)
5. visit 'd', result = "cbad", map['d'] = node(d)
6. visit 'b', now since map['b'] = node(b), compare "b" with "a", so result = "cadb", map['b'] = node(b)
7. visit 'c', since map['c'] = node(c), compare "a" with "c", so result = "adbc", map['c']= node(c)

Time O(n), space O(n) or O(1) if in-place.
回复

使用道具 举报

全局:
ozox 发表于 2020/05/13 13:26:36
First problem:

1. Use a map, key is the char, value is a...
老哥你考虑一下 cbacbc 这个情况
回复

使用道具 举报

🔗
ozox 2020-5-14 07:13:52 | 只看该作者
全局:
if input is: cbacbc

1. first, result = cba
2. next, 'c' already in the result and char after 'c' is 'b', so use the this 'c' and delete the 'c' in the result, result = bac
3. similarly, 'b' ready in the result and char after 'b' is 'a', so use the this 'b' and delete the 'b' in the result, result = acb
4. last char is 'c', again, already exist and char after 'c' is 'b', so use this 'c' and delete the 'c' in the result, result = abc

return "abc"

新人求加米 :)
回复

使用道具 举报

🔗
 楼主| yimeichihuo2 2020-5-14 07:15:12 | 只看该作者
全局:
qiaofengmarco 发表于 2020-5-13 07:00
分人吧
我之前面的时候hr回复很快 描述也很清楚
可惜我碰到了不咋地的面试官 虽然水平应该很好 但不喜欢讨 ...

用bfs写的,有点长没写完
回复

使用道具 举报

🔗
xzx111 2020-5-14 07:50:15 来自APP | 只看该作者
全局:
ozox 发表于 2020/05/14 07:13:52
if input is: cbacbc

1. first, result = cba
2. next, 'c' ...
How about cdacd
回复

使用道具 举报

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

本版积分规则

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