l*******e 发帖数: 309 | 1 能不能把路径给encode起来, 等最大数找出来以后,把路径decode出来,从array里面
找出被最大数打败的数? |
|
r****k 发帖数: 173 | 2
bottle
# 11,
mentioned
to
is
poisoned) ?
interviewer will like the answer.
Yes, I think your description is what I thought. It's a binary decoding
of the numbers less than decimal 1023. |
|
m****u 发帖数: 3915 | 3 给一堆string
如何encode它们到一个string
再decode它们恢复到这堆string
我看有说用xml, xml怎么做?
我更倾向于加一个特殊字符表示字符串的分隔,这个特殊字符应该怎么加才不会有问题
?(比如说原
string中就有这个字符,或者原string开头结尾有这个字符) |
|
n***m 发帖数: 127 | 4 Software Engineer - 586632
Description
In this position, you will be part of the Graphics Software Engineering
team in Visual and Parallel Computing Group and you will be working with
other talented software engineers to deliver DXVA driver and related/similar
supports for media algorithms design and verification for Intel integrated
graphics products. Your responsibilities will include but not be limited to:
- Design and implement Encoding/Decoding support for MPEG2, WMV9/VC1, H.264,
and other ... 阅读全帖 |
|
f*******4 发帖数: 1401 | 5 Imagine you've a sorted list of strings and its encoded into
another list, how do you determine the decoding scheme?
LZ没具体解释。下面有人给了个例子:
Sorted list:
abc
bcd
bcde
efghi
Encoded list:
bca
cdb
cdeb
fghie
如果encoding scheme可以是任何形式,比如调换次序,调换字母,甚至更复杂的
方式,有什么好办法么? |
|
y***m 发帖数: 7027 | 6 既然是排好序的,decoding直接把字母排序还原回去不行么?不知题意是否理解有误... |
|
s*****n 发帖数: 5488 | 7 I think by good design you don't need hash at all. simply increse the code
by one for a new link. than compute the index of long url by decoding the
cookie. |
|
z*****z 发帖数: 9 | 8 Please send your Chinese/English CV to zyijun AT cn.ibm.com
Band: 6/7
Locate: Beijing
No travel
Hire number: 5
Salary: 100K - 300K/year
Job Description:
System z Software Development organization (in CSTL) is seeking software
engineers taking the responsibilities for design, development and test of z/
OS and other System z software products. This team is an integral part of
the STG System z global team and support System z expansion and growth in
the China market.
Unicode System Services is... 阅读全帖 |
|
z*****z 发帖数: 9 | 9 Please send your Chinese/English CV to zyijun AT cn.ibm.com
Band: 7/8
Locate: Beijing
No travel
Hire number: 1
Job Description:
System z Software Development organization (in CSTL) is seeking software
engineers taking the responsibilities for design, development and test of z/
OS and other System z software products. This team is an integral part of
the STG System z global team and support System z expansion and growth in
the China market.
Unicode System Services is the Unicode environment on... 阅读全帖 |
|
v*****k 发帖数: 7798 | 10 DP记录全部路径后回溯。这就是传说中的Viterbi decoding啊,EE的同学们都知道。 |
|
v*****k 发帖数: 7798 | 11 DP记录全部路径后回溯。这就是传说中的Viterbi decoding啊,EE的同学们都知道。 |
|
S******n 发帖数: 3 | 12 就两道题。
1. 数组里找两数和为target.
2. 一个三叉树,要你写个函数把他encode成一个string.再写个函数把string decode
成树。
回答的还行。就是有一个followup问题没答上来。后来看自己的code也有几个typo.
明天还有第二面。但是这人已经说recruiter会跟我联系about next step. 感觉好像他
已经做了决定了。是不是很negative的feedback? |
|
|
|
b******c 发帖数: 70 | 15 碰到的题目都不难
prefix tree parsing
link list sorting
TRIE
matrix find word
utf8 format decoding
design a data structure to return array numbers in random order so that the
possibility will be proportional to the value of the number, also support
fast update numbers
some kind of word parsing and processing
还有一些小题目
基本上那本算法课本书看看,然后复习复习班上的题目,再加上看看leetcode,就差不
多了,当然,多想想可以怎么优化,变形什么的 |
|
d****o 发帖数: 1055 | 16 prefix tree parsing
TRIE
matrix find word
utf8 format decoding
这几个能不能展开说怎么考的?具体输入输出。
the |
|
l*******s 发帖数: 1258 | 17 Edit distance这种题目,用来考DP之类的挺好。也是个不错的white board coding问
题。
但是NLP类职位面试,其实好多算法只能是讲讲而已,因为不可能让你白板写个最大熵
的decoding算法,更不用提GIS,IIS这种training了。即便是viterbi,要当场写出来
,也得不少时间。
这种题目多是open question,比如让你给ebay设计一个classifier或者类似的东西,
看看每个哪个商品跟哪个是同一个但是不同描述等。问你涉及到哪些NLP技术,基本原
理是啥。
NLP |
|
l*****a 发帖数: 559 | 18 感觉中等。
对stdin,stdout不熟,写加调试用了3/4的时间。
碰上encode,decode的那一题,brute force解决了。 |
|
l*******s 发帖数: 1258 | 19 这些都是码工类型题目,兄弟我发一个research scientist\developer 类的题目吧,
ML和NLP方向的:
幼儿园:给一堆字符串,比如 {apple, bananab, beard, piep, pear},然后给一个
Regex,找出开头结尾相同字母的单词,比如output是piep,bananab。请问能不能?为
什么?。
小学:用一堆正则表达式实现一个简单的tokenizer。
初中:请实现Shortest Edit Distance算法
高中:说说Beam Search+MaxEntropy 和 CRF在做POS tagging时的区别,各自在什么情
况下适用,为什么。
大学:请实现Naive Bayes的training和decoding,包括 multinomial and
multivariate Bernoulli.
研究生:请实现IIS和GIS,并指出复杂度和区别。
博士:实现l-BFGS,注意,一定是limited哦,不能光是BFGS。说说哪些地方可以改进
? |
|
i**********e 发帖数: 1145 | 20 刚把这题加进 OJ "Decode Ways",有兴趣可以测试代码。 |
|
s*****n 发帖数: 5488 | 21 估计问你Viterbi decoder.
你面什么方向。这个不是随便问。
这题好像很简单。
整个matrix搞定。
state |
|
p********s 发帖数: 37 | 22 可能l可以为0的。。这样r[l-1]就挂了。。 |
|
b**a 发帖数: 1118 | 23 My code passed the small test but failed big test. Can anyone take a look
and suggest the reason? Thanks.
int numDecodings(string s) {
// Start typing your C/C++ solution below
// DO NOT write int main() function
if(s.size()==0)
return 0;
char first, second;
first=s[0];
if((first-'0')==0)
return 0;
int len= s.size();
int count=1;
for(int i=1; i
{
char second=s[i];
if(second=='0')
... 阅读全帖 |
|
p*****2 发帖数: 21240 | 24 我写了一个练练。
public int numDecodings(String s)
{
if(s==null || s.length()==0)
return 0;
int len=s.length();
int[] dp=new int[len+1];
dp[len]=1;
for(int i=len-1;i>=0;i--)
{
if(s.charAt(i)!='0')
{
dp[i]=dp[i+1];
if(i
dp[i]+=dp[i+2];
}
}
return dp[0];
} |
|
|
h********o 发帖数: 14 | 26 非常惭愧,犯了几个低级的错误:
1. 竟然没考虑到到遇到 ‘0’ 不能单独解码
2. vector 下标溢出。
以后要多加注意,谢谢各位的回复和指点。
buaa (ming), 你的code我没有看明白:每次 看 first 和 second 两个字符,如果能
解码就 count++,否则就 count--, 我不确定这样能得出正确的结果。 建议还是用
DP 更容易理解。
peking2 (myfacebook) 的java代码是对的
我修改后的c++代码和 peking2 (myfacebook)的是一个思路, 贡你参考,如下:
int numDecodings(string s) {
int l = s.size();
if (l==0) return 0;
vector r(l+1,0);
if (s[l-1]=='0') r[l-1] = 0; // 先考虑最后一个字符的情况
else r[l-1] = 1;
r[l]=1;
for (int i = l-2; i>=0; i--) { //然后从倒数第二个字符往... 阅读全帖 |
|
|
b**a 发帖数: 1118 | 28 Thanks. It seemed mine is not right. I tried but failed to work from start.
Both you guys start from the end. I was wondering, is this required by DP
since you are using it? or something else? Mind sharing your thought train?
Really appreciate it. |
|
|
h********o 发帖数: 14 | 30 Sorry for late rely. I don't think that DP requires the start from the end.
The idea is to solve the smallest and simplest sub-problem first, and then,
with that result, you can derive the larger sub-problems which are more
complicated. In this problem, i guess starting from the end gives you the
smallest and simplest sub-problem that you can solve right away.
. |
|
b**a 发帖数: 1118 | 31 I see. I learn quite some from this question. Really thx.
.
, |
|
w****a 发帖数: 710 | 32 感谢楼主分享
G onsite的第一轮integer encode/decode,这个能详细说一下么? |
|
f*******w 发帖数: 1243 | 33 在OJ上跑总是说internal error……
自己电脑上跑所有test case都没问题。
检查不出哪里错了……求助各位大牛
程序:
class Solution {
public:
int numDecodings(string s) {
// Start typing your C/C++ solution below
// DO NOT write int main() function
if (s.empty()) return 0;
int len = s.size();
if (len < 1) return 0;
int numarray[len];
int i = len - 1;
if (s[i] > '9' || s[i] < '0') return 0;
else {
numarray[i] = (s[i] == '0') ? 0 : 1;
i--;
... 阅读全帖 |
|
f*******w 发帖数: 1243 | 34 貌似OJ出问题了? 所有程序直接写return 0 都是Internal Error…… |
|
e******o 发帖数: 757 | 35 应该是出问题了。 hello world 都不成 |
|
d**e 发帖数: 6098 | 36 好像是我onsite G的一道题,encode/decode的问题。
我当时用dash连接各个string,但在注意escaping的问题 |
|
d**e 发帖数: 6098 | 37 比如可以用"\."来连接各个string,"\\"用来escape string中的"\",这个decode时就
不会遇到"\\\"的情况。
不过还是besmile的简单得体。 |
|
|
e***s 发帖数: 799 | 39 Node与Node之间插入分隔符吗?decode的时候再分开?
楼主,
第一题的题目我也没看懂,能不能讲解下。。。 |
|
g*******r 发帖数: 44 | 40 呵呵,对头。他没注意我那个空格。。
decode |
|
v*********t 发帖数: 7 | 41 我最近也在研究 DP的初始化
楼主能贴下你写的 Decode Ways的代码么 |
|
w****x 发帖数: 2483 | 42
//leetcode OJ --> get decode ways
int GetDecodeWays(const char* str)
{
assert(str);
int nLen = strlen(str);
if (nLen <= 0) return 0;
int a = 1;// 1 not 0
int b = (str[0] >= '1' && str[0] <= '9') ? 1 : 0;
for (int i = 1; i < nLen; i++)
{
int c = 0;
if ((str[i-1] == '1' && str[i] >= '0' && str[i] <= '9')
|| (str[i-1] == '2' && str[i] >= '0' && str[i] <= '6'))
c += a;
if (str[i] >= '1' && str[i] <= '9')
c += b;... 阅读全帖 |
|
h******3 发帖数: 351 | 43 Can you explain what is
"encode/decode binary tree" ?
受。
phone |
|
p*****2 发帖数: 21240 | 44
Id Question Difficulty Freqency Data Structures Algorithms
1 Two Sum 2 5
array
set
sort
two pointers
2 Add Two Numbers 3 4
linked list
two pointers
math
3 Longest Substring Without Repeating Characters 3 2
string
hashtable
two pointers
4 Median of Two Sorted Arrays 5 3
array
binary search
5 Longest Palindromic Substring 4 2
string
6 ZigZag Conversion 3 1
string
7 Reverse Integer 2 3
math
8 ... 阅读全帖 |
|
d******e 发帖数: 164 | 45 1. define format: header + body
specify length of data in header and put data in body
2. base64 encoding/decoding |
|
n*****8 发帖数: 19630 | 46 DSP, video encoding/decoding? |
|
u*****o 发帖数: 1224 | 47 LEETCODE上一道很像吧,好像是DECODE WAYS。。不记得了,反正LZ好人品,祝福LZ... |
|
d**e 发帖数: 6098 | 48 ☆─────────────────────────────────────☆
swjtuer (想归俺交的群272361847) 于 (Fri Jun 14 11:10:07 2013, 美东) 提到:
俺也是转行的,不过是十几年前转的,找工作时赶上了bubble的尾巴。有些一起转的就
没运气,晚毕业一学期,job market已经崩溃了。毕业一年还找不到工作基本就没戏了
,人家看一下简历就明白,钱和功夫都白搭,自己也没信心一直找下去,人生就此颓废
蹉跎都可能。
就目前的形势看,IT业还是非常需要人,但这个行业非常浮躁,又不差钱,大家都喜欢
要好的有经验的,不像以前,刚毕业的还有很多充当廉价劳动力的机会。
现在entry level主要是两大来源,一是小印,从印度直接过来,已经形成产业,培训
面试签证一条龙,各大公司基本都被老印把持,把这产业搞的风起云涌。当然小印的技
术还是糙一些,老印也清楚,所以还需要些聪明孩子来平衡。
但这事还是轮不到转行的国人,另一类就是ABC和小留,人家英文好,熟悉美国文化,
交流没问题,数学逻辑水平虽然不如国内的,但比小印和老美强。可能是年轻吧,... 阅读全帖 |
|
|
|