
同学去面试, HR 出的一个题目:写一段能彰显你编码能力的代码。各位大大指点一二。
1 awolfly9 OP 我准备写一个 helloworld 。 |
2 500miles Oct 10, 2015 很抱歉 我这人没极限 (底线 = =,)...... 能写出多牛的代码 得看贵司业务复杂度了 |
3 yongzhong Oct 10, 2015 (lambda _, __, ___, ____, _____, ______, _______, ________: getattr( __import__(True.__class__.__name__[_] + [].__class__.__name__[__]), ().__class__.__eq__.__class__.__name__[:__] + ().__iter__().__class__.__name__[_____:________] )( _, (lambda _, __, ___: _(_, __, ___))( lambda _, __, ___: chr(___ % __) + _(_, __, ___ // __) if ___ else (lambda: _).func_code.co_lnotab, _ << ________, (((_____ << ____) + _) << ((___ << _____) - ___)) + (((((___ << __) - _) << ___) + _) << ((_____ << ____) + (_ << _))) + (((_______ << __) - _) << (((((_ << ___) + _)) << ___) + (_ << _))) + (((_______ << ___) + _) << ((_ << ______) + _)) + (((_______ << ____) - _) << ((_______ << ___))) + (((_ << ____) - _) << ((((___ << __) + _) << __) - _)) - (_______ << ((((___ << __) - _) << __) + _)) + (_______ << (((((_ << ___) + _)) << __))) - ((((((_ << ___) + _)) << __) + _) << ((((___ << __) + _) << _))) + (((_______ << __) - _) << (((((_ << ___) + _)) << _))) + (((___ << ___) + _) << ((_____ << _))) + (_____ << ______) + (_ << ___) ) ) )( *(lambda _, __, ___: _(_, __, ___))( (lambda _, __, ___: [__(___[(lambda: _).func_code.co_nlocals])] + _(_, __, ___[(lambda _: _).func_code.co_nlocals:]) if ___ else [] ), lambda _: _.func_code.co_argcount, ( lambda _: _, lambda _, __: _, lambda _, __, ___: _, lambda _, __, ___, ____: _, lambda _, __, ___, ____, _____: _, lambda _, __, ___, ____, _____, ______: _, lambda _, __, ___, ____, _____, ______, _______: _, lambda _, __, ___, ____, _____, ______, _______, ________: _ ) ) |
4 msdx123 Oct 10, 2015 你可以用 brainfuck 写个程序 |
7 gongpeione Oct 10, 2015 @yongzhong 233 花式 Hello World |
8 luman Oct 10, 2015 reboot |
11 loading Oct 10, 2015 via iPhone #下面是打印 hello world,如果你能看懂这行注释和下面无花哨的代码,就是我认为的好代码,这就是我的水平,写出团队能看懂的注释和代码 print "hello world" |
12 MadbookPro Oct 10, 2015 |
13 jaguar Oct 10, 2015 via Android 我一句话写个百度搜索引擎出来 <iframe width="100%" height="100%" src="http://www.baidu.com"></iframe> |
15 justjavac Oct 10, 2015 return a==b ? b : a; |
16 foruok Oct 10, 2015 printf("Hello World."); |
17 kmahyyg Oct 10, 2015 汇编 |
19 zpole Oct 10, 2015 via iPhone 翻转二叉树?@Max Howell |
20 faluo Oct 10, 2015 HR 让写代码?写完后他们评判么? |
21 6rzgeek Oct 10, 2015 @MadbookPro 没看懂 |
22 dallaslu Oct 10, 2015 所谓能力就是对语言的驾驭、对业务的精确实现吧?随便写点五脏俱全的小实现呗: https://gist.github.com/dallaslu/acc8f5b81ee4a7d9878d |
23 Sunyanzi Oct 10, 2015 <?php http://www.v2ex.com/t/226832 class message { private $_from_Sunyanzi = 'Hello World'; } echo current( new message ); 代码就四行 ... 关键点就两个 ... 为什么直接丢网址在程序里不报错和私有属性穿透的一百种办法 ... 这样就够了 ... 前两个关键点直接可以引出关于程序流程和思想的话题以及 php 对象实现的原理 ... 代码里额外还有个隐式类型转换 ... 就着这个可以再扯些弱类型语言的特点或者 php 的坑什么的 ... 由这些内容再发散出去可说的东西就太多了 ... 给我时间我能聊一宿 ... |
24 CodeDrift Oct 10, 2015 rm /f |
25 Cloudee Oct 10, 2015 public static void main(String[] args) throws Exception { Class<?> cache = Class.forName("java.lang.Integer$IntegerCache"); Field field = cache.getDeclaredField("cache"); field.setAccessible(true); Object value = field.get(null); Array.set(value, 130, 3); Integer result = 1 + 1; System.out.println("1 + 1 = " + result); } // 老梗了,哈哈 |
26 ffffwh Oct 10, 2015 via Android Quine? |