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

求大米 DevRev new grad software engineer OA

🔗
匿名用户-NY09M  2023-2-10 18:28:41 |倒序浏览

2023(1-3月) 码农类General 硕士 全职@devrev - 网上海投 - 技术电面 在线笔试  | 😐 Neutral 😣 Hard | WaitList | 应届毕业生

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

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

x
16道题:

4道coding:
第一题:
Given a string word, count the minimum number of characters that needs to be added to word to make it anadrome - a string which is an anagram of some palindrome.

For example, if word = "apple", it's possible to add two letters 'a' and 'e', which makes the resulting string an anadrome: "appleae" letters can be rearranged to become "apelepa", which is a palindrome.

Example

For word = "abcb", the output should be solution(word) = 1.

One can add either 'a' or 'c' to the string word: "abcba" is a palindrome already, "abcbc" is an anagram of a palindrome "cbabc".

For word = "abab", the output should be solution(word) = 0.

The string "abab" is already an anagram of a palindrome "abba".

For word = "abc", the output should be solution(word) = 2.

One can add, for example, characters 'a' and 'b' to the string word: "abcab" is an anagram of a palindrome "abcba".

For word = "apple", the output should be solution(word) = 2.

Input/Output

[execution time limit] 3 seconds (java)

[input] string word

A string consisting of lowercase English letters, which should be adjusted to become an anadrome.

Guaranteed constraints:
1 ≤ word.length ≤ 106.

[output] integer

The minimum number of characters that can be added to word to make it anadrome.



第二题:
You know what they say: "time is money." In today's markets, the price of a stock that you see on your computer might not be the price that you end-up trading at, since by the time your request reaches the exchange the price might have changed. Therefore, the quicker you can get your order to the exchange, the better the chances that you will trade at your expected price.

Picture a peer-to-peer computer network of n nodes that's supposed to route your request from your computer to a computer where the trade is actually registered. Let's assume that the network is not optimized yet, so it's your task to implement an algorithm that computes the shortest path from the source at index 1 (your computer) to the destination at index n.

Example

For n = 4 and

network = [[1, 4, 200],
           [1, 2, 5],
           [1, 3, 10],
           [2, 3, 4],
您好!
本帖隐藏的内容需要积分高于 188 才可浏览
您当前积分为 0。
使用VIP即刻解锁阅读权限或查看其他获取积分的方式
游客,您好!
本帖隐藏的内容需要积分高于 188 才可浏览
您当前积分为 0。
VIP即刻解锁阅读权限查看其他获取积分的方式
Unlock interview details and practice with AI
Curated Interview Questions from Top Companies
time s
lowest duration of execution d
lowest index in the input
The input will consist of three arrays s, d, and p, all consisting of n elements (1 ≤ n ≤ 1000), where index i specifies the value for task i. The output should be an array of length n consisting of the order in which the tasks will be run, where a task is identified by its index i in the input.

For example, the input:

s: [0, 2, 2]
d: [1, 1, 1]
p: [0, 0, 1]
Defines three tasks. Task 0 is run first at time 0. Both task 1 and 2 can be run at time 2, however since task 2 has a higher priority, it's run next, followed by task 1. Therefore, the expected output is:

[0, 2, 1]
[execution time limit] 3 seconds (java)

[input] array.integer s

An array of length n, where task i's earliest start time is 0 ≤ s[i] ≤ 9999999.

[input] array.integer d

An array of length n, where task i's duration of execution is 1 ≤ d[i] ≤ 10000000.

[input] array.integer p

An array of length n, where task i's priority of execution is 0 ≤ p[i] ≤ 3.

[output] array.integer

An array of length n consisting of the order in which the tasks were run, where a task is identified by its index in the input.


其他都是data structure and algorithm,直接搜就可以

求大米哦

评分

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

查看全部评分


上一篇:Wells Fargo React Contractor/可内推有sponsor
下一篇:Nextdoor onsite
🔗
XWL100 2023-2-11 01:28:02 来自APP | 只看该作者
全局:
请问他们家还开放NG岗位吗,官网上好像没看到..
回复

使用道具 举报

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

本版积分规则

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