l********g 发帖数: 372 | 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 |
j*******t 发帖数: 223 | |
m******s 发帖数: 1469 | 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
|
r*******e 发帖数: 971 | |
n******a 发帖数: 83 | 5 赞啊,学习一下,楼主背景应该很强的,能拿到这几家的面试机会 |
l********g 发帖数: 372 | 6 第一轮,不是new grad,但也没比new grad多多少经验就是了。
【在 r*******e 的大作中提到】 : L是第几轮啊?是new grad么?
|
s*****r 发帖数: 43070 | |
s*****r 发帖数: 43070 | 8 对于第一轮店面有点偏难了,估计是刷题的太多,提高难度
【在 l********g 的大作中提到】 : 第一轮,不是new grad,但也没比new grad多多少经验就是了。
|
t*******e 发帖数: 274 | |
M****l 发帖数: 416 | 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
|
|
|
l********g 发帖数: 372 | 11 呵呵,然后老美+烙印面试官第一题自己都没搞懂,为我的hashmap的containsKey和
containsValues是否应该都check而两人互相争论+让我举例解释了好久好久,最后第
二题没写完只好果断杯具了,呵呵。
【在 s*****r 的大作中提到】 : 对于第一轮店面有点偏难了,估计是刷题的太多,提高难度
|
d******a 发帖数: 238 | 12 这个45分钟这么两道题太狠了吧。。面试官没见过自己写估计都不行。。
这第二道题有啥好的解法没?
【在 l********g 的大作中提到】 : 呵呵,然后老美+烙印面试官第一题自己都没搞懂,为我的hashmap的containsKey和 : containsValues是否应该都check而两人互相争论+让我举例解释了好久好久,最后第 : 二题没写完只好果断杯具了,呵呵。
|
l********g 发帖数: 372 | 13 我当时自己想到的是按照素因子往下除着递归。。。或者反过来先用素因子做个因式分
解成绩形式2^n * 3^m * 5^l ...形式然后再组合输出吧。。。暂时没想到别的更好的
法子
【在 d******a 的大作中提到】 : 这个45分钟这么两道题太狠了吧。。面试官没见过自己写估计都不行。。 : 这第二道题有啥好的解法没?
|
e*******i 发帖数: 56 | 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;
} |
l*****a 发帖数: 14598 | 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
|
l*****a 发帖数: 14598 | 16 直接dfs就好了吧
【在 l********g 的大作中提到】 : 我当时自己想到的是按照素因子往下除着递归。。。或者反过来先用素因子做个因式分 : 解成绩形式2^n * 3^m * 5^l ...形式然后再组合输出吧。。。暂时没想到别的更好的 : 法子
|
l*****a 发帖数: 14598 | 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
|
l*****a 发帖数: 14598 | 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
|
Q**F 发帖数: 995 | 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
|
l********g 发帖数: 372 | 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
|
|
|
Q**F 发帖数: 995 | 21 所以这个是单向map?a->c 不能推出 c->a.
c,
【在 l********g 的大作中提到】 : 我觉得题意是不考虑loop问题而且只看前一个word对后一个word做map,所以就是a->c, : b->a. 我貌似copy的漏了最后那个->a了,不好意思。所以只要一个map就好了
|
l********g 发帖数: 372 | 22 当时没来的及问,给出来的example就是这个样子的。倒是不是主要问题吧,就是缺失
没法子一段code全完成而只要>1的数上来第一个结果一定n*1好了
【在 l*****a 的大作中提到】 : 第二题有点小疑惑 : 为什么12需要*1 : 其他的不要, : 这样似乎没法用一段code全支持 : 似乎12只能单独处理,大家什么意见 : : isomorphic : remapped : occurrences
|
l********g 发帖数: 372 | 23 对的啊,只要单向的map。
【在 Q**F 的大作中提到】 : 所以这个是单向map?a->c 不能推出 c->a. : : c,
|
c********r 发帖数: 107 | |
l*********u 发帖数: 19053 | 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
|