由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
JobHunting版 - 请问除了刷题还能怎样提高编程
相关主题
请教github上1道编程题的题意贡献Rocket Fuel 4 hour online test
facebook programming challenge难度如何?急求rocket fuel 3小时的online test!!!
hackerrank的xor题目公司要发个hacker rank的链接做做题目
好吧,继续hackerrank讨论。weekly contest, walking on gridshackerrank 的interface 做得很傻x
求问hackerrank的lego blocks题stock maximize 不能 pass tests, 求正确 java code
hackerrank上的A journey to the Moon大家讨论下如何写出clean concise的code吧
Leetcode test cases 怎么获取?问道G 的题
xor cipher面试题求解请教一道算法题
相关话题的讨论汇总
话题: location话题: int话题: room话题: next话题: input
进入JobHunting版参与讨论
1 (共1页)
b*******n
发帖数: 847
1
leetcode也刷过两遍了,但前两天找人帮忙mock interview,人家上来就说你这code太
academic style了,一看就是没什么经验的人写的.就是说算法都对,但有些coding习惯
在有经验的人看来很刺眼.请问这应该怎么提高呢?去哪里可以看比较规范的code?还有
如果想增加一些现在比较热门技术的经验像hardoop或big data,有没有什么open
source之类的project可以参加?谢谢!
z*********8
发帖数: 2070
2
你不妨把你的academic code贴给大家看看?
l*n
发帖数: 529
3
贴出sample来大家看看是不是真觉得有问题。也许大家都给你一样academic也说不定,
哈哈。

【在 b*******n 的大作中提到】
: leetcode也刷过两遍了,但前两天找人帮忙mock interview,人家上来就说你这code太
: academic style了,一看就是没什么经验的人写的.就是说算法都对,但有些coding习惯
: 在有经验的人看来很刺眼.请问这应该怎么提高呢?去哪里可以看比较规范的code?还有
: 如果想增加一些现在比较热门技术的经验像hardoop或big data,有没有什么open
: source之类的project可以参加?谢谢!

w**z
发帖数: 8232
4
刷了两遍还找不到工作?

【在 b*******n 的大作中提到】
: leetcode也刷过两遍了,但前两天找人帮忙mock interview,人家上来就说你这code太
: academic style了,一看就是没什么经验的人写的.就是说算法都对,但有些coding习惯
: 在有经验的人看来很刺眼.请问这应该怎么提高呢?去哪里可以看比较规范的code?还有
: 如果想增加一些现在比较热门技术的经验像hardoop或big data,有没有什么open
: source之类的project可以参加?谢谢!

l*******m
发帖数: 1096
5
写个app, 搞个web

【在 b*******n 的大作中提到】
: leetcode也刷过两遍了,但前两天找人帮忙mock interview,人家上来就说你这code太
: academic style了,一看就是没什么经验的人写的.就是说算法都对,但有些coding习惯
: 在有经验的人看来很刺眼.请问这应该怎么提高呢?去哪里可以看比较规范的code?还有
: 如果想增加一些现在比较热门技术的经验像hardoop或big data,有没有什么open
: source之类的project可以参加?谢谢!

f********4
发帖数: 988
6
找人给你做code review啊
g*********e
发帖数: 14401
7
leetcode刷半遍 大部分工作都拿下了吧?general码工的话
z****e
发帖数: 54598
8
代码贴出来看看
b**********5
发帖数: 7881
9
... 我leetcode看了刷了二年了, 一个工作都找不到

【在 g*********e 的大作中提到】
: leetcode刷半遍 大部分工作都拿下了吧?general码工的话
s*****r
发帖数: 43070
10
蛋不能这么扯,能写好quicksort而且bug-free,大多数公司都qualify了。

【在 g*********e 的大作中提到】
: leetcode刷半遍 大部分工作都拿下了吧?general码工的话
相关主题
hackerrank上的A journey to the Moon贡献Rocket Fuel 4 hour online test
Leetcode test cases 怎么获取?急求rocket fuel 3小时的online test!!!
xor cipher面试题求解公司要发个hacker rank的链接做做题目
进入JobHunting版参与讨论
b**********5
发帖数: 7881
11
我能写quicksort啊, 没一个公司要我的

【在 s*****r 的大作中提到】
: 蛋不能这么扯,能写好quicksort而且bug-free,大多数公司都qualify了。
z****e
发帖数: 54598
12
定义“大多数公司”

【在 s*****r 的大作中提到】
: 蛋不能这么扯,能写好quicksort而且bug-free,大多数公司都qualify了。
s*********n
发帖数: 191
13
你的coding style是可以出卖你的,如果你的代码量不大,仅仅刷题刷出来的。
去GITHUB做一些开源的项目能提高一些。

【在 b*******n 的大作中提到】
: leetcode也刷过两遍了,但前两天找人帮忙mock interview,人家上来就说你这code太
: academic style了,一看就是没什么经验的人写的.就是说算法都对,但有些coding习惯
: 在有经验的人看来很刺眼.请问这应该怎么提高呢?去哪里可以看比较规范的code?还有
: 如果想增加一些现在比较热门技术的经验像hardoop或big data,有没有什么open
: source之类的project可以参加?谢谢!

z****e
发帖数: 54598
14
这样说很没有意思
代码贴出来,别人才能告诉你,怎样写显得professional
b**********5
发帖数: 7881
15
怎么做github open source?

【在 s*********n 的大作中提到】
: 你的coding style是可以出卖你的,如果你的代码量不大,仅仅刷题刷出来的。
: 去GITHUB做一些开源的项目能提高一些。

p*****2
发帖数: 21240
16
膜拜academic style
s*****r
发帖数: 108
17
刷题就能提高代码质量
关键是做完自己有兴趣去思考优化自己的程序,和读别人的好程序
经典的语言书也教你怎么些好程序
像楼主描述的情况 写程序不注意质量 也不读别人的 多半就是不喜欢 CS
k*********6
发帖数: 738
18
能推荐一下经典的预言书吗?特别是java的?谢谢!

【在 s*****r 的大作中提到】
: 刷题就能提高代码质量
: 关键是做完自己有兴趣去思考优化自己的程序,和读别人的好程序
: 经典的语言书也教你怎么些好程序
: 像楼主描述的情况 写程序不注意质量 也不读别人的 多半就是不喜欢 CS

l*n
发帖数: 529
19
感觉好的代码不用读,“扫”就行,逻辑流淌在字里行间了。那种要“读”的代码,就
跟paper draft一样,感觉逻辑都没有理顺。

【在 s*****r 的大作中提到】
: 刷题就能提高代码质量
: 关键是做完自己有兴趣去思考优化自己的程序,和读别人的好程序
: 经典的语言书也教你怎么些好程序
: 像楼主描述的情况 写程序不注意质量 也不读别人的 多半就是不喜欢 CS

w**z
发帖数: 8232
20
quick sort bug free 不容易吧。人James 写了一个,若干年后,还给人抓了bug

【在 s*****r 的大作中提到】
: 蛋不能这么扯,能写好quicksort而且bug-free,大多数公司都qualify了。
相关主题
hackerrank 的interface 做得很傻x问道G 的题
stock maximize 不能 pass tests, 求正确 java code请教一道算法题
大家讨论下如何写出clean concise的code吧Apple 电面
进入JobHunting版参与讨论
s*****b
发帖数: 8
21
我来贴一个。
Rocket fule (Software Engineer - Machine Learning Scientist ) 技术电面后code
test. code通过了所有test cases. 人家看过code 后就拒了。问题在哪里呢?请各位
牛人不吝赐教。题目本版以前贴过
You are standing in a rectangular room and are about to fire a laser toward
the east wall. Inside the room a certain number of prisms have been placed.
They will alter the direction of the laser beam if it hits them. There
are north-facing, east-facing, west-facing, and south-facing prisms. If the
laser beam strikes an east-facing prism, its course will be altered to be
East, regardless of what direction it had been going in before. If it hits
a south-facing prism, its course will be altered to be South, and so on. You
want to know how far the laser will travel before it hits a wall.
INPUT
Your program must read the room description from standard input. The room
is represented as a character array. Each line of input from STDIN
represents a row of the array. The width and height of the array are the
width and height of the room. The characters inside the array denote the
placement of the prisms and the laser's starting position.
The number of rows and columns in the array will not be explicitly specified
in the input, so your program will have to keep reading from STDIN until
there are no more lines to read and determine the total number of rows and
columns based on the input. However, the number of lines of input will be
at most 50. Each line will contain the same number of characters.
The resulting character array will contain exactly one '@' character,
representing the laser's position in the room, and any number of characters
from the set {"^", "V", "<", ">", "-"}. The first four of these represent
prisms that are guaranteed to direct the laser in the direction in which
they are pointing. The "^" character directs the laser north, "<" directs
it to the west, and so on. The "-" character represents empty space.
OUTPUT
Your program should print to standard out a single string, terminated by a
newline, representing the distance that the laser will travel before hitting
a wall. For example, if the laser travels a distance of 14 cells before
hitting a wall, then your program should print the string "14" to STDOUT.
Your program should treat the "@'"symbol the same as the "-" character, that
is, as empty space. So the laser will pass through the original location
from which it was fired.
If the laser will get caught in an infinite loop, then your program should
print "-1" to STDOUT.
1 #include
2 #include
3 #include
4 #include
5 using namespace std;
6
7 //read from STDIN to charater array room
8 void read_stdin(vector>& room, int start[2]) {
9 string input_line;
10 int line =0;
11 while(!cin.eof()){
12 getline(cin, input_line);
13 int col =0;
14 while(col 15 {
16 if(input_line[col] == '@')
17 {
18 start[0] = line;
19 start[1] = col;
20 }
21 room[line][col] = input_line[col];
22 col++;
23 }
24 if (line>0 && !cin.eof() && col != room[line-1].size())
25 {
26 throw "input data colum numbers are not aligned" ;
27 }
28 room[line].resize(col);
29 line++;
30 };
31 room.resize(line);
32 }
33
34 //find coordinates of the next location
35 void GetNextLocation(int current_location[2], char sign, int next_
location[2])
36 {
37 switch (sign)
38 {
39 case '>':
40 next_location[0] = current_location[0];
41 next_location[1] = current_location[1] +1;
42 break;
43 case '<':
44 next_location[0] = current_location[0];
45 next_location[1] = current_location[1] -1;
46 break;
47 case '^':
48 next_location[0] = current_location[0]-1;
49 next_location[1] = current_location[1];
50 break;
51 case 'V':
52 case 'v':
53 next_location[0] = current_location[0] +1;
54 next_location[1] = current_location[1];
55 break;
56 default: throw "wrong direction sign";
57 break;
58 }
59
60 }
61
62 //determine new travel direction
63 char ChangeDirection(vector>& room, int new_location[2],
char previous_sign)
64 {
65 if (room[new_location[0]][ new_location[1]] == '@' ||room[new_
location[0]][ new_location[1]] == '-' )
66 return(previous_sign);
67 else
68 return(room[new_location[0]][ new_location[1]]);
69 }
70
71 //calculate the length of the path
72 int LaserPathLength(vector>& room, int start[2])
73 {
74 map prism_loc_hitnumber; //key=location, value = number
hits.
75 int m = room.size();
76 int n = room[0].size();
77 char direction = '>';
78 int location[2] = {start[0], start[1]};
79 int next_location[2];
80 int path = 0;
81 do{
82 path++;
83 GetNextLocation( location, direction, next_location);
84 if (next_location[0] >= m || next_location[1] >= n || next_
location[0] < 0 || next_location[1] < 0)
85 return(path);
86 direction = ChangeDirection(room, next_location, direction);
87 location[0] = next_location[0];
88 location[1] = next_location[1];
89 if (room[location[0]][location[1]] != '@' && room[location[0]
][location[1]] != '-' )
90 {
91 if (prism_loc_hitnumber[next_location[0]*n + next_
location[1]] > 0)
92 return(-1);
93 else
94 prism_loc_hitnumber[next_location[0]*n + next_
location[1]]++;
95 }
96 }while(1);
97 }
98
99 //convert interger to string
100 string Int_to_String(int number_input)
101 {
102 string returnvalue;
103 int number = abs(number_input);
104 if (number == 0)
105 return "0";
106 string temp="";
107 if (number_input < 0)
108 returnvalue="-";
109 else
110 returnvalue="";
111 while (number>0)
112 {
113 temp+=number%10+48;
114 number/=10;
115 }
116 for (int i=0;i 117 returnvalue+=temp[temp.length()-i-1];
118 return returnvalue;
119 }
120
121 int main() {
122 vector> room(150, vector(150));
123 int start[2];
124 int path_length=0;
125 string out_path;
126 //read from STDIN
127 try {
128 read_stdin( room, start);
129 }
130 catch (const char* msg)
131 {
132 cout << msg << endl;
133 }
134 //calculate path length
135 try
136 {
137 path_length = LaserPathLength(room, start);
138 }
139 catch (const char* msg)
140 {
141 cout << msg < 142 }
143 //convert to string and output to stdout
144 out_path = Int_to_String( path_length);
145 cout << out_path << endl;
146 return(0);
147 1}1

【在 z****e 的大作中提到】
: 代码贴出来看看
f****l
发帖数: 8042
22
界个是电面中写的code?

code
toward
placed.
the
hits

【在 s*****b 的大作中提到】
: 我来贴一个。
: Rocket fule (Software Engineer - Machine Learning Scientist ) 技术电面后code
: test. code通过了所有test cases. 人家看过code 后就拒了。问题在哪里呢?请各位
: 牛人不吝赐教。题目本版以前贴过
: You are standing in a rectangular room and are about to fire a laser toward
: the east wall. Inside the room a certain number of prisms have been placed.
: They will alter the direction of the laser beam if it hits them. There
: are north-facing, east-facing, west-facing, and south-facing prisms. If the
: laser beam strikes an east-facing prism, its course will be altered to be
: East, regardless of what direction it had been going in before. If it hits

g****o
发帖数: 547
23
rocket fuel是不是用interview street?
你怎么知道你过了所有test cases而不是只通过了它提供的sample test case?
你把题目的constrain也贴出来看看
interview street会有对算法速度很高的test case,说不定你超时之类

code
toward
placed.
the
hits

【在 s*****b 的大作中提到】
: 我来贴一个。
: Rocket fule (Software Engineer - Machine Learning Scientist ) 技术电面后code
: test. code通过了所有test cases. 人家看过code 后就拒了。问题在哪里呢?请各位
: 牛人不吝赐教。题目本版以前贴过
: You are standing in a rectangular room and are about to fire a laser toward
: the east wall. Inside the room a certain number of prisms have been placed.
: They will alter the direction of the laser beam if it hits them. There
: are north-facing, east-facing, west-facing, and south-facing prisms. If the
: laser beam strikes an east-facing prism, its course will be altered to be
: East, regardless of what direction it had been going in before. If it hits

l*n
发帖数: 529
24
老实说,感觉你搞复杂了吧。用个set记录到过的位置(视matrix为array),直接开枪就
是了,反正就四个方向。

code
toward
placed.
the
hits

【在 s*****b 的大作中提到】
: 我来贴一个。
: Rocket fule (Software Engineer - Machine Learning Scientist ) 技术电面后code
: test. code通过了所有test cases. 人家看过code 后就拒了。问题在哪里呢?请各位
: 牛人不吝赐教。题目本版以前贴过
: You are standing in a rectangular room and are about to fire a laser toward
: the east wall. Inside the room a certain number of prisms have been placed.
: They will alter the direction of the laser beam if it hits them. There
: are north-facing, east-facing, west-facing, and south-facing prisms. If the
: laser beam strikes an east-facing prism, its course will be altered to be
: East, regardless of what direction it had been going in before. If it hits

l*n
发帖数: 529
25
你怎么还自己搞了个intToString的函数?

code
toward
placed.
the
hits

【在 s*****b 的大作中提到】
: 我来贴一个。
: Rocket fule (Software Engineer - Machine Learning Scientist ) 技术电面后code
: test. code通过了所有test cases. 人家看过code 后就拒了。问题在哪里呢?请各位
: 牛人不吝赐教。题目本版以前贴过
: You are standing in a rectangular room and are about to fire a laser toward
: the east wall. Inside the room a certain number of prisms have been placed.
: They will alter the direction of the laser beam if it hits them. There
: are north-facing, east-facing, west-facing, and south-facing prisms. If the
: laser beam strikes an east-facing prism, its course will be altered to be
: East, regardless of what direction it had been going in before. If it hits

M**a
发帖数: 848
26
代码就是语言。
个人认为是找茬。
s*****b
发帖数: 8
27
谢谢了!面试官可能从这里断定我不熟练。
interviewstreet, 3小时, 没超时。 只有8组测试数据。
要求:
Whichever language you code in, please use best coding practices. We are
looking for clear, concise, well-documented, modular code that reflects good
design, object-oriented principles, and an understanding of appropriate
data structures. It is not enough to write code that is merely correct, or
even code that is merely terse and correct. We want to see code that is as
beautiful as you can make it according to your personal coding aesthetic.

【在 l*n 的大作中提到】
: 你怎么还自己搞了个intToString的函数?
:
: code
: toward
: placed.
: the
: hits

b*******n
发帖数: 847
28
哪里找人去做code review?

★ 发自iPhone App: ChineseWeb 7.8

【在 f********4 的大作中提到】
: 找人给你做code review啊
b*******n
发帖数: 847
29
好,回头我贴一下,让大家见见传说中的academic style~

★ 发自iPhone App: ChineseWeb 7.8

【在 z****e 的大作中提到】
: 代码贴出来看看
h********g
发帖数: 496
30
坐等
相关主题
bloomberg assessment的机经,c语言的(20道题)facebook programming challenge难度如何?
Palantir面经2hackerrank的xor题目
请教github上1道编程题的题意好吧,继续hackerrank讨论。weekly contest, walking on grids
进入JobHunting版参与讨论
n******d
发帖数: 386
31
没事谁去背个quicksort
工作中编程的东西比面试题目简单太多了

【在 s*****r 的大作中提到】
: 蛋不能这么扯,能写好quicksort而且bug-free,大多数公司都qualify了。
G***l
发帖数: 355
32
这不是熟练的问题,真正的project跟做题不是一回事,99.9%以上的code,除了不
出错之外,最最重要的是人容易看懂和要添加/修改功能的时候容易不容易。人家都说
了It is not enough to write code that is merely correct。
就提到的这些要求,看看你的code满足了多少?
clear,concise:
你觉得
if (room[new_location[0]][ new_location[1]] == '@' ||room[new_
location[0]][ new_location[1]] == '-' )
66 return(previous_sign);
67 else
68 return(room[new_location[0]][ new_location[1]]);
这样的code clear&concise么?如果你读别人这样的code,会不会觉得烦人?clear&
concise的code不需要看题目一眼看过去就能大概明白是在干嘛。
well documented:
别的不说了,至少你的方法要给个完整的注释吧,每个参数是干嘛的,做什么事情,返
回什么。
modular, design:
你觉得你的code有清晰的模块吗?输入,输出,中间的动作,都有模块没有?如果输入
格式/来源改了,另外一种格式,从数据库读入。如果输出的要求变了,举个例子,不
只是要路程长度,还有别的信息转弯的次数等等。如果激光的动作方式变了,镜子的功
能变了。还有很多如果,你能在尽量不要改变class/method的接口和参数,原先调用现
在的方法的地方都能工作,只是添加一些class/subclass,method来达到目的吗?
oo:
你连一个自定义的class都没有。。。更别提封装组合继承多态这些oo最基本的东西了。
再比如错误的处理,输入格式不对怎么办?激光在房间里死循环了怎么办?等等。
还有很多方面。不可能做到完美,特别是经验少的,勉强做到都很难。但就算没有这个
能力,面试的人至少想看到有这个意识。

are
good
as

【在 s*****b 的大作中提到】
: 谢谢了!面试官可能从这里断定我不熟练。
: interviewstreet, 3小时, 没超时。 只有8组测试数据。
: 要求:
: Whichever language you code in, please use best coding practices. We are
: looking for clear, concise, well-documented, modular code that reflects good
: design, object-oriented principles, and an understanding of appropriate
: data structures. It is not enough to write code that is merely correct, or
: even code that is merely terse and correct. We want to see code that is as
: beautiful as you can make it according to your personal coding aesthetic.

s*****b
发帖数: 8
33
说得好极了!这样的点评对我等菜鸟太重要了。谢过了。
希望看到更多点评, 也很想看看他人的“学院派”代码。

【在 G***l 的大作中提到】
: 这不是熟练的问题,真正的project跟做题不是一回事,99.9%以上的code,除了不
: 出错之外,最最重要的是人容易看懂和要添加/修改功能的时候容易不容易。人家都说
: 了It is not enough to write code that is merely correct。
: 就提到的这些要求,看看你的code满足了多少?
: clear,concise:
: 你觉得
: if (room[new_location[0]][ new_location[1]] == '@' ||room[new_
: location[0]][ new_location[1]] == '-' )
: 66 return(previous_sign);
: 67 else

1 (共1页)
进入JobHunting版参与讨论
相关主题
请教一道算法题求问hackerrank的lego blocks题
Apple 电面hackerrank上的A journey to the Moon
bloomberg assessment的机经,c语言的(20道题)Leetcode test cases 怎么获取?
Palantir面经2xor cipher面试题求解
请教github上1道编程题的题意贡献Rocket Fuel 4 hour online test
facebook programming challenge难度如何?急求rocket fuel 3小时的online test!!!
hackerrank的xor题目公司要发个hacker rank的链接做做题目
好吧,继续hackerrank讨论。weekly contest, walking on gridshackerrank 的interface 做得很傻x
相关话题的讨论汇总
话题: location话题: int话题: room话题: next话题: input