聊聊跟三哥三姐面试和共事的经历

一亩三分地论坛

 找回密码
 Sign Up 注册获取更多干货
E轮2.5亿美元融资
K12教育独角兽一起作业
北京-诚聘人工智能/教育/大数据岗
坐标湾区
Games Startup
招聘游戏开发工程师
游戏初创公司招聘工程师、UIUX Designer和游戏策划
码农求职神器Triplebyte:
不用海投
内推多家公司面试
把贵司招聘信息放这里
查看: 2767|回复: 2
收起左侧

Cryptic Studios 新鲜的面经

[复制链接] |试试Instant~ |关注本帖
九号大头菜 发表于 2015-8-11 02:39:23 | 显示全部楼层 |阅读模式

2015(7-9月) 码农类General 硕士 全职@Cryptic Studios - 网上海投 - 在线笔试  | Other | fresh grad应届毕业生

注册一亩三分地论坛,查看更多干货!

您需要 登录 才可以下载或查看,没有帐号?Sign Up 注册获取更多干货

x
Cryptic Studios 新鲜的面经
网上海投[size=12.8000001907349px]Cryptic Studios[size=12.8000001907349px] 他们家的software engineer的职位,hr联系我说会有一个6~8小时的c test interview(OA), hr说最好能在5小时内完成,老师说被吓到了。昨天打开了链接, 题目确实是6~8小时的量,甚至是8+!做出了一道题,剩下一道木有时间了,于是草草交了。把题目发上来供大家参考,如果有面试它们家的小伙伴,可以提前看看题准备一两天,写出来了再面,个人觉得6~8小时搞定这两道题对于非大神级别的人来说还是很不科学的。
[size=12.8000001907349px]Speed is a factor, so the sooner you get it back to us, the better, but please do not send it back until it is complete.
[size=12.8000001907349px]

[size=12.8000001907349px]Standard C or C++ are the preferred languages for this test, but this is not an absolute requirement. Please use a compiler to test your code. Don't worry about dealing with illegal inputs or giant data sets. You should *not* use reference materials (other than language references) for this test.
[size=12.8000001907349px]
. 1point3acres
[size=12.8000001907349px]Additionally, please specify how your test was compiled and run. If we cannot compile and run your test with a minimum of modification, it will receive a failing grade.
[size=12.8000001907349px]

[size=12.8000001907349px]

[size=12.8000001907349px]1. Write a function that accepts a string of digits and a target value as input parameters. This function should output the two input values followed by a string with +'s and *'s between the digits so the result of evaluating the mathematical expression is the target value. Pay attention to operator precedence. Note there may be more than one answer, it doesn't matter which one you print.
[size=12.8000001907349px]. 一亩-三分-地,独家发布
.本文原创自1point3acres论坛
[size=12.8000001907349px]Examples: . more info on 1point3acres
[size=12.8000001907349px]"1231231234",11353 -> "12*3+1+23*123*4"
[size=12.8000001907349px]"3456237490",1185 -> "3*4*56+2+3*7+490"
[size=12.8000001907349px]"3456237490",9191 -> "no solution"
[size=12.8000001907349px]

.1point3acres网[size=12.8000001907349px]
. visit 1point3acres for more.
[size=12.8000001907349px]2. Write a function "void link(char **tiles)" that accepts a list of 'tiles' in the provided format below. It should link the tiles together sequentially in the order they are given, and print out the current count and arrangement of tiles at each step exactly as shown in the example output below, including the note about how far the tile had to be rotated.
[size=12.8000001907349px]. from: 1point3acres

[size=12.8000001907349px]A tile is a 2-by-2 square split into quadrants, where each quadrant has a number from 0 to 9. After the first tile, a tile can be legally placed if at least two of its quadrants match quadrants on adjacent tiles horizontally or vertically. A tile cannot be legally placed in a location if it would have fewer than two matching quadrants or has any quadrants that do not match horizontally or vertically. Tiles can be rotated, and tiles can be placed in offset positions as demonstrated with tile 9 in the third example. The inputs are always designed so there is only one place a tile will fit.
[size=12.8000001907349px]. 牛人云集,一亩三分地

[size=12.8000001907349px]Examples:
[size=12.8000001907349px]char *tiles1[] = {
[size=12.8000001907349px]        "11",     // 1
[size=12.8000001907349px]        "23",
[size=12.8000001907349px]        "",
[size=12.8000001907349px]        "44",     // 2
[size=12.8000001907349px]        "11",
[size=12.8000001907349px]        "",.本文原创自1point3acres论坛
[size=12.8000001907349px]        "16",     // 3
[size=12.8000001907349px]        "36",
[size=12.8000001907349px]        "",
[size=12.8000001907349px]        "51",     // 4. 牛人云集,一亩三分地
[size=12.8000001907349px]        "71",. 围观我们@1point 3 acres
[size=12.8000001907349px]        "",
[size=12.8000001907349px]        "46",     // 5-google 1point3acres
[size=12.8000001907349px]        "26",
[size=12.8000001907349px]        "",
[size=12.8000001907349px]        "14",     // 6
[size=12.8000001907349px]        "68",
[size=12.8000001907349px]        0};
[size=12.8000001907349px]

[size=12.8000001907349px]

[size=12.8000001907349px]link(tiles1) prints:
[size=12.8000001907349px]

[size=12.8000001907349px]6 tiles
[size=12.8000001907349px]link 1. 1point3acres
[size=12.8000001907349px]11.本文原创自1point3acres论坛
[size=12.8000001907349px]23
[size=12.8000001907349px]
[size=12.8000001907349px]link 2
[size=12.8000001907349px]44
[size=12.8000001907349px]11
[size=12.8000001907349px]11
[size=12.8000001907349px]23
[size=12.8000001907349px]
[size=12.8000001907349px]link 3
[size=12.8000001907349px]44
[size=12.8000001907349px]11
[size=12.8000001907349px]1116
[size=12.8000001907349px]2336
[size=12.8000001907349px]
[size=12.8000001907349px]link 4
[size=12.8000001907349px]  44
[size=12.8000001907349px]5111
[size=12.8000001907349px]711116
[size=12.8000001907349px]  2336
[size=12.8000001907349px]
[size=12.8000001907349px]link 5 // note this tile had to be rotated 180 degrees clockwise
[size=12.8000001907349px]  44. Waral 博客有更多文章,
[size=12.8000001907349px]5111.本文原创自1point3acres论坛
[size=12.8000001907349px]71111662
[size=12.8000001907349px]  233664
. Waral 博客有更多文章,[size=12.8000001907349px] . From 1point 3acres bbs
[size=12.8000001907349px]link 6 // note this tile had to be rotated 270 degrees clockwise
[size=12.8000001907349px]  4448
[size=12.8000001907349px]511116
[size=12.8000001907349px]71111662
[size=12.8000001907349px]  233664. 1point 3acres 论坛
[size=12.8000001907349px]
[size=12.8000001907349px] . Waral 博客有更多文章,
[size=12.8000001907349px]

[size=12.8000001907349px]

[size=12.8000001907349px]char *tiles2[] = {
[size=12.8000001907349px]        "12",        // 1. 留学申请论坛-一亩三分地
[size=12.8000001907349px]        "34",
[size=12.8000001907349px]        "",
[size=12.8000001907349px]        "36",        // 2
[size=12.8000001907349px]        "15",
[size=12.8000001907349px]        "",
[size=12.8000001907349px]        "56",        // 3
[size=12.8000001907349px]        "78",
[size=12.8000001907349px]        "",
[size=12.8000001907349px]        "78",        // 4
[size=12.8000001907349px]        "90",
[size=12.8000001907349px]        "",
[size=12.8000001907349px]        "46",        // 5
[size=12.8000001907349px]        "26",
[size=12.8000001907349px]        "",
[size=12.8000001907349px]        "88",        // 6
[size=12.8000001907349px]        "01",
[size=12.8000001907349px]        "",
[size=12.8000001907349px]        "93",        // 7
[size=12.8000001907349px]        "54",
[size=12.8000001907349px]        0};
[size=12.8000001907349px]

[size=12.8000001907349px].本文原创自1point3acres论坛

[size=12.8000001907349px]link(tiles2) prints:
[size=12.8000001907349px]

[size=12.8000001907349px]7 tiles
[size=12.8000001907349px]link 1-google 1point3acres
[size=12.8000001907349px]12
[size=12.8000001907349px]34
[size=12.8000001907349px]

[size=12.8000001907349px]link 2 // note this tile had to be rotated 180 degrees clockwise
[size=12.8000001907349px]5112.本文原创自1point3acres论坛
[size=12.8000001907349px]6334
[size=12.8000001907349px]
. 留学申请论坛-一亩三分地
[size=12.8000001907349px]link 3 // note this tile had to be rotated 90 degrees clockwise
[size=12.8000001907349px]755112
[size=12.8000001907349px]866334
[size=12.8000001907349px]

[size=12.8000001907349px]link 4 // note this tile had to be rotated 90 degrees clockwise. 一亩-三分-地,独家发布
[size=12.8000001907349px]97755112
. 1point 3acres 论坛[size=12.8000001907349px]08866334
[size=12.8000001907349px]

[size=12.8000001907349px]link 5 // note this tile had to be rotated 270 degrees clockwise
[size=12.8000001907349px]97755112
[size=12.8000001907349px]08866334
[size=12.8000001907349px]   66
[size=12.8000001907349px]   42
[size=12.8000001907349px]

[size=12.8000001907349px]link 6 // note this tile had to be rotated 90 degrees clockwise
[size=12.8000001907349px]97755112
[size=12.8000001907349px]08866334
[size=12.8000001907349px]08 66
[size=12.8000001907349px]18 42
[size=12.8000001907349px]

[size=12.8000001907349px]link 7 // note this tile had to be rotated 270 degrees clockwise
[size=12.8000001907349px]97755112
[size=12.8000001907349px]08866334. From 1point 3acres bbs
[size=12.8000001907349px]08 66 34
[size=12.8000001907349px]18 42 95. Waral 博客有更多文章,
[size=12.8000001907349px]

[size=12.8000001907349px]

[size=12.8000001907349px]

[size=12.8000001907349px]

[size=12.8000001907349px]char *tiles3[] = {
[size=12.8000001907349px]        "11",     // 1
[size=12.8000001907349px]        "12",
[size=12.8000001907349px]        "",. 1point3acres
[size=12.8000001907349px]        "12",     // 2
[size=12.8000001907349px]        "93",
[size=12.8000001907349px]        "",
[size=12.8000001907349px]        "93",     // 3
[size=12.8000001907349px]        "99",
[size=12.8000001907349px]        "",
[size=12.8000001907349px]        "39",     // 4
[size=12.8000001907349px]        "98",. Waral 博客有更多文章,
[size=12.8000001907349px]        "",
[size=12.8000001907349px]        "95",     // 5
[size=12.8000001907349px]        "86",.本文原创自1point3acres论坛
[size=12.8000001907349px]        "",
[size=12.8000001907349px]        "57",     // 6
[size=12.8000001907349px]        "66",
[size=12.8000001907349px]        "",. visit 1point3acres for more.
[size=12.8000001907349px]        "77",     // 7
[size=12.8000001907349px]        "57",. 1point3acres
[size=12.8000001907349px]        "",
[size=12.8000001907349px]        "13",     // 8. Waral 博客有更多文章,
[size=12.8000001907349px]        "24",.留学论坛-一亩-三分地
[size=12.8000001907349px]        "",
[size=12.8000001907349px]        "45",     // 9
[size=12.8000001907349px]        "47",
[size=12.8000001907349px]        "",
[size=12.8000001907349px]        "24",     // 10. visit 1point3acres for more.
[size=12.8000001907349px]        "39",. 留学申请论坛-一亩三分地
[size=12.8000001907349px]        0};
[size=12.8000001907349px]
.留学论坛-一亩-三分地
[size=12.8000001907349px]link(tiles3) prints:
[size=12.8000001907349px]

[size=12.8000001907349px]10 tiles
[size=12.8000001907349px]link 1
[size=12.8000001907349px]11
[size=12.8000001907349px]12
[size=12.8000001907349px]
[size=12.8000001907349px]link 2
[size=12.8000001907349px]11
[size=12.8000001907349px]12
[size=12.8000001907349px]12. Waral 博客有更多文章,
[size=12.8000001907349px]93
[size=12.8000001907349px]
[size=12.8000001907349px]link 3
[size=12.8000001907349px]11
[size=12.8000001907349px]12
[size=12.8000001907349px]12. Waral 博客有更多文章,
[size=12.8000001907349px]93
[size=12.8000001907349px]93
[size=12.8000001907349px]99
[size=12.8000001907349px]
[size=12.8000001907349px]link 4
[size=12.8000001907349px]11
[size=12.8000001907349px]12
[size=12.8000001907349px]12
[size=12.8000001907349px]93
[size=12.8000001907349px]9339
[size=12.8000001907349px]9998
[size=12.8000001907349px]
[size=12.8000001907349px]link 5
[size=12.8000001907349px]11
[size=12.8000001907349px]12
[size=12.8000001907349px]12
[size=12.8000001907349px]93
[size=12.8000001907349px]933995
[size=12.8000001907349px]999886. 1point 3acres 论坛
[size=12.8000001907349px] . 1point 3acres 论坛
[size=12.8000001907349px]link 6. 1point 3acres 论坛
[size=12.8000001907349px]11
[size=12.8000001907349px]12
[size=12.8000001907349px]12
[size=12.8000001907349px]93
[size=12.8000001907349px]93399557
[size=12.8000001907349px]99988666
[size=12.8000001907349px]
[size=12.8000001907349px]link 7. Waral 博客有更多文章,
[size=12.8000001907349px]11
[size=12.8000001907349px]12
[size=12.8000001907349px]12    77
[size=12.8000001907349px]93    57
[size=12.8000001907349px]93399557
[size=12.8000001907349px]99988666
[size=12.8000001907349px]
[size=12.8000001907349px]link 8
[size=12.8000001907349px]1113
[size=12.8000001907349px]1224
[size=12.8000001907349px]12    77
[size=12.8000001907349px]93    57
[size=12.8000001907349px]93399557. visit 1point3acres for more.
[size=12.8000001907349px]99988666
[size=12.8000001907349px]
[size=12.8000001907349px]link 9. Waral 博客有更多文章,
[size=12.8000001907349px]1113
[size=12.8000001907349px]122445. from: 1point3acres
[size=12.8000001907349px]12  4777-google 1point3acres
[size=12.8000001907349px]93    57
[size=12.8000001907349px]93399557. visit 1point3acres for more.
[size=12.8000001907349px]99988666
[size=12.8000001907349px]
[size=12.8000001907349px]link 10
[size=12.8000001907349px]1113
[size=12.8000001907349px]122445
[size=12.8000001907349px]12244777
[size=12.8000001907349px]9339  57
[size=12.8000001907349px]93399557
[size=12.8000001907349px]99988666
[size=12.8000001907349px]祝各位好运~🍀
. 1point3acres

swing 发表于 2015-8-11 03:51:57 | 显示全部楼层
谢谢分享,虽然我不会C的面试~
回复 支持 反对

使用道具 举报

huangsilion 发表于 2015-8-12 03:44:52 | 显示全部楼层
public static String calculation(String str, int target) {                 String n = "no solution";                 if (str == null || str.length() == 0)                         return n;                 int len = str.length();                 int sum = 0;                 String result = "";                 List<String> list = new ArrayList<String>();                 rec(0, len, result, str, target, list);                 if (list.size() > 0)                         return list.get(0);                 else                         return n;          }          public static void rec(int s, int len, String result, String str,                         int target, List<String> list) {                 if (s == len && calculate(result) == target)                         list.add(new String(result));                 for (int i = s; i < len; i++) {                         String temp = str.substring(s, i + 1);                         if (i + 1 != len) {                                 rec(i + 1, len, result + temp + "+", str, target, list);                                 rec(i + 1, len, result + temp + "*", str, target, list);                         } else                                 rec(i + 1, len, result + temp, str, target, list);                  }          }          public static int calculate(String s) {                 if (s == null)                         return 0;                 s = s.trim().replaceAll(" +", "");                 int length = s.length();                  int res = 0;                 long preVal = 0; // initial preVal is 0                 char sign = '+'; // initial sign is +                 int i = 0;                 while (i < length) {                         long curVal = 0;                         while (i < length && (int) s.charAt(i) <= 57                                         && (int) s.charAt(i) >= 48) { // int                                 curVal = curVal * 10 + (s.charAt(i) - '0');                                 i++;                         }                         if (sign == '+') {                                 res += preVal; // update res                                 preVal = curVal;                         } else if (sign == '*') {                                 preVal = preVal * curVal; // not update res, combine preVal &                                                                                         // curVal and keep loop                         }                         if (i < length) { // getting new sign                                 sign = s.charAt(i);                                 i++;                         }                 }                 res += preVal;                 return res;         }
回复 支持 反对

使用道具 举报

本版积分规则

提醒:发帖可以选择内容隐藏,部分板块支持匿名发帖。请认真读完以下全部说明:

■隐藏内容方法: [hide=200]你想要隐藏的内容比如面经[/hide]
■意思是:用户积分低于200则看不到被隐藏的内容
■可以自行设置积分值,不建议太高(200以上太多人看不到),也不建议太低(那就没必要隐藏了)
■建议只隐藏关键内容,比如具体的面试题目、涉及隐私的信息,大部分内容没必要隐藏。
■微信/QQ/电子邮件等,为防止将来被骚扰甚至人肉,以论坛私信方式发给对方最安全。
■匿名发帖的板块和方法:http://www.1point3acres.com/bbs/thread-405991-1-1.html

关闭

一亩三分地推荐上一条 /5 下一条

手机版|小黑屋|一亩三分地论坛声明

custom counter

GMT+8, 2018-5-22 22:17

Powered by Discuz! X3

© 2001-2013 Comsenz Inc. Design By HUXTeam

快速回复 返回顶部 返回列表