Redian新闻
>
报点面经L & Square, 以及Netflix的recruiter经
avatar
报点面经L & Square, 以及Netflix的recruiter经# JobHunting - 待字闺中
l*g
1
报点最近的面经,都是电面中的,攒点rp顺便求bless!
L家的:
1. Given two (dictionary) words as Strings, determine if they are isomorphic
. Two words are called isomorphic if the letters in one word can be remapped
to get the second word. Remapping a letter means replacing all occurrences
of it with another letter while the ordering of the letters remains
unchanged. No two letters may map to the same letter, but a letter may map
to itself.
Example:
Given "foo", "app"; returns true
we can map 'f' -> 'a' and 'o' -> 'p'
Given "bar", "foo"; returns false
we can't map both 'a' and 'r' to 'o'
Given "turtle", "tletur"; returns true
we can map 't' -> 't', 'u' -> 'l', 'r' -> 'e', 'l' -> 'u', 'e' -'r'
Given "ab", "ca"; returns true
we can map 'a' -> 'c', 'b'
2. 输出整数分解的全部解,解要从大到小的输出
Example:
input: n = 12
output:
12*1
6*2
4*3
3*2*2
Square家的:
Design class Formula and all the required interfaces. 这个Formula是要
construct出a || (b && c)这样结构的,而evaluate function的第二个input para是a
=true; b=false; c= true这样的values的。
class Formula
public Formula or(Formula f1, Formula f2);
public Formula and(Formula f1, Formula f2);
public Formula not(Formula f);
public Formula init(String var);
public boolean evaluate(Formula f, Map values);
Netflix的recruiter:
第一次见到recruiter的information phone call就会问问题的。互相寒暄自己介绍和
讨论过CEO的那个culture slides之后,连问了四个问题。
1. Singleton pattern
2. Map有几种implementation
3. Linux command line
4. http error code, e.g. 500对应的error message, 404对应的error message
avatar
j*t
2
好久都没有看到square的面经了...
avatar
m*s
3
Zan and Bless

isomorphic
remapped
occurrences

【在 l********g 的大作中提到】
: 报点最近的面经,都是电面中的,攒点rp顺便求bless!
: L家的:
: 1. Given two (dictionary) words as Strings, determine if they are isomorphic
: . Two words are called isomorphic if the letters in one word can be remapped
: to get the second word. Remapping a letter means replacing all occurrences
: of it with another letter while the ordering of the letters remains
: unchanged. No two letters may map to the same letter, but a letter may map
: to itself.
: Example:
: Given "foo", "app"; returns true

avatar
r*e
4
L是第几轮啊?是new grad么?
avatar
n*a
5
赞啊,学习一下,楼主背景应该很强的,能拿到这几家的面试机会
avatar
l*g
6
第一轮,不是new grad,但也没比new grad多多少经验就是了。

【在 r*******e 的大作中提到】
: L是第几轮啊?是new grad么?
avatar
s*r
7
还是N家最实在,全是工作中的问题
avatar
s*r
8
对于第一轮店面有点偏难了,估计是刷题的太多,提高难度

【在 l********g 的大作中提到】
: 第一轮,不是new grad,但也没比new grad多多少经验就是了。
avatar
t*e
9
mark
avatar
M*l
10
bless

isomorphic
remapped
occurrences

【在 l********g 的大作中提到】
: 报点最近的面经,都是电面中的,攒点rp顺便求bless!
: L家的:
: 1. Given two (dictionary) words as Strings, determine if they are isomorphic
: . Two words are called isomorphic if the letters in one word can be remapped
: to get the second word. Remapping a letter means replacing all occurrences
: of it with another letter while the ordering of the letters remains
: unchanged. No two letters may map to the same letter, but a letter may map
: to itself.
: Example:
: Given "foo", "app"; returns true

avatar
l*g
11
呵呵,然后老美+烙印面试官第一题自己都没搞懂,为我的hashmap的containsKey和
containsValues是否应该都check而两人互相争论+让我举例解释了好久好久,最后第
二题没写完只好果断杯具了,呵呵。

【在 s*****r 的大作中提到】
: 对于第一轮店面有点偏难了,估计是刷题的太多,提高难度
avatar
d*a
12
这个45分钟这么两道题太狠了吧。。面试官没见过自己写估计都不行。。
这第二道题有啥好的解法没?

【在 l********g 的大作中提到】
: 呵呵,然后老美+烙印面试官第一题自己都没搞懂,为我的hashmap的containsKey和
: containsValues是否应该都check而两人互相争论+让我举例解释了好久好久,最后第
: 二题没写完只好果断杯具了,呵呵。

avatar
l*g
13
我当时自己想到的是按照素因子往下除着递归。。。或者反过来先用素因子做个因式分
解成绩形式2^n * 3^m * 5^l ...形式然后再组合输出吧。。。暂时没想到别的更好的
法子

【在 d******a 的大作中提到】
: 这个45分钟这么两道题太狠了吧。。面试官没见过自己写估计都不行。。
: 这第二道题有啥好的解法没?

avatar
e*i
14
Post a C++ solution for problem 1, assuming letters are lower case.
Any suggestions to improve? thanks
/************************************/
#include
#include
#include
bool isIso(string s, string t)
{
if(s.length()!=t.length()) return false;
vector scounter(26,0);
vector tcounter(26,0);

for(int i=0;i{
scounter[s[i]-'a']++;
tcounter[t[i]-'a']++;
}
sort( scounter.begin(), scounter.end(), greater() );
sort( tcounter.begin(), tcounter.end(), greater() );
for(int i=0;i{
if(scounter[i]!=tcounter[i]) return false;
}
return true;
}
avatar
l*a
15
好人,很久没看到什么最新面经了

isomorphic
remapped
occurrences

【在 l********g 的大作中提到】
: 报点最近的面经,都是电面中的,攒点rp顺便求bless!
: L家的:
: 1. Given two (dictionary) words as Strings, determine if they are isomorphic
: . Two words are called isomorphic if the letters in one word can be remapped
: to get the second word. Remapping a letter means replacing all occurrences
: of it with another letter while the ordering of the letters remains
: unchanged. No two letters may map to the same letter, but a letter may map
: to itself.
: Example:
: Given "foo", "app"; returns true

avatar
l*a
16
直接dfs就好了吧

【在 l********g 的大作中提到】
: 我当时自己想到的是按照素因子往下除着递归。。。或者反过来先用素因子做个因式分
: 解成绩形式2^n * 3^m * 5^l ...形式然后再组合输出吧。。。暂时没想到别的更好的
: 法子

avatar
l*a
17
第二题有点小疑惑
为什么12需要*1
其他的不要,
这样似乎没法用一段code全支持
似乎12只能单独处理,大家什么意见

isomorphic
remapped
occurrences

【在 l********g 的大作中提到】
: 报点最近的面经,都是电面中的,攒点rp顺便求bless!
: L家的:
: 1. Given two (dictionary) words as Strings, determine if they are isomorphic
: . Two words are called isomorphic if the letters in one word can be remapped
: to get the second word. Remapping a letter means replacing all occurrences
: of it with another letter while the ordering of the letters remains
: unchanged. No two letters may map to the same letter, but a letter may map
: to itself.
: Example:
: Given "foo", "app"; returns true

avatar
l*a
18
I wonder whether the result of example 3 for Q1 is correct or not

isomorphic
remapped
occurrences

【在 l********g 的大作中提到】
: 报点最近的面经,都是电面中的,攒点rp顺便求bless!
: L家的:
: 1. Given two (dictionary) words as Strings, determine if they are isomorphic
: . Two words are called isomorphic if the letters in one word can be remapped
: to get the second word. Remapping a letter means replacing all occurrences
: of it with another letter while the ordering of the letters remains
: unchanged. No two letters may map to the same letter, but a letter may map
: to itself.
: Example:
: Given "foo", "app"; returns true

avatar
Q*F
19
第一题最后一个ab->ca怎么map?

isomorphic
remapped
occurrences

【在 l********g 的大作中提到】
: 报点最近的面经,都是电面中的,攒点rp顺便求bless!
: L家的:
: 1. Given two (dictionary) words as Strings, determine if they are isomorphic
: . Two words are called isomorphic if the letters in one word can be remapped
: to get the second word. Remapping a letter means replacing all occurrences
: of it with another letter while the ordering of the letters remains
: unchanged. No two letters may map to the same letter, but a letter may map
: to itself.
: Example:
: Given "foo", "app"; returns true

avatar
l*g
20
我觉得题意是不考虑loop问题而且只看前一个word对后一个word做map,所以就是a->c,
b->a. 我貌似copy的漏了最后那个->a了,不好意思。所以只要一个map就好了

【在 l*****a 的大作中提到】
: I wonder whether the result of example 3 for Q1 is correct or not
:
: isomorphic
: remapped
: occurrences

avatar
Q*F
21
所以这个是单向map?a->c 不能推出 c->a.

c,

【在 l********g 的大作中提到】
: 我觉得题意是不考虑loop问题而且只看前一个word对后一个word做map,所以就是a->c,
: b->a. 我貌似copy的漏了最后那个->a了,不好意思。所以只要一个map就好了

avatar
l*g
22
当时没来的及问,给出来的example就是这个样子的。倒是不是主要问题吧,就是缺失
没法子一段code全完成而只要>1的数上来第一个结果一定n*1好了

【在 l*****a 的大作中提到】
: 第二题有点小疑惑
: 为什么12需要*1
: 其他的不要,
: 这样似乎没法用一段code全支持
: 似乎12只能单独处理,大家什么意见
:
: isomorphic
: remapped
: occurrences

avatar
l*g
23
对的啊,只要单向的map。

【在 Q**F 的大作中提到】
: 所以这个是单向map?a->c 不能推出 c->a.
:
: c,

avatar
c*r
24
mark
avatar
l*u
25
bless

isomorphic
remapped
occurrences

【在 l********g 的大作中提到】
: 报点最近的面经,都是电面中的,攒点rp顺便求bless!
: L家的:
: 1. Given two (dictionary) words as Strings, determine if they are isomorphic
: . Two words are called isomorphic if the letters in one word can be remapped
: to get the second word. Remapping a letter means replacing all occurrences
: of it with another letter while the ordering of the letters remains
: unchanged. No two letters may map to the same letter, but a letter may map
: to itself.
: Example:
: Given "foo", "app"; returns true

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。