注册一亩三分地论坛,查看更多干货!
您需要 登录 才可以下载或查看附件。没有帐号?注册账号 
x
先讲一下timeline12.2 托人内推
12.4 打电话给我电话问我什么时候有空,,然后发了一个OA的tara链接,让我一周内做完(没想到这么快,不是一般都是要一两个月吗?)
插曲1:我当时发邮件和负责我recruiter说 is there any programming langauage preference。然后他们说java。那我说好吧,因为我最近刷题一直在用python,这就造成了后面的故事。
插曲2:HR中间给我发邮件提醒过我一次时间,然后我就回邮件给他说当初你们公司另外一个员工和我说by the end of Friday, but now you are saying by the end of this week, which due在处理,明天会给我答复。
于是就在今天我收到了move on的信,说实话我真的没想到第二题在没有完全做出来的情况居然让我pass了OA,让我约电面时间。
总结:多和负责招人的人沟通,HR和第一个联系的人都很重要。轻易不要换你平时刷题的语言,不然临场写一个卡壳可能就是10分钟没了。
顺便求大米求祝福通过下一轮
最后把两道题代码贴一下,都是PASS的
Q1:
- public class differentWords {
- public static void main(String[] args) {
- differnWords("awaglknagawybagwkwagkwagl",4);
- }
- public static List<String> differnWords(String input, int k) {
- if(k>input.length()) return null;
- List<String> result = new ArrayList<String>();
- for(int i=0;i<input.length()-k;i++) {
- String _temp = input.substring(i, i+k);
- // will need a menthod to determine if there is dulipcated chars
- Set<String> set= new HashSet<String>();
- for(int j =0; j<_temp.length();j++) {
- char c=_temp.charAt(j);
- set.add(Character.toString(c));
- }
- // if set size equals to k, then add the sub string into result
- if(set.size()==k && !result.contains(_temp)) {
- result.add(_temp);
- }
- }
- for(String str:result) {
- System.out.print(str+" " );
- }
- return result;
- }
- }
复制代码 Q2:
- public class CharPartition {
- public static void main(String[] args) {
- List<Character> l = new ArrayList<Character>();
-
- l.add('a');
- l.add('b');
- l.add('a');
- l.add('b');
- l.add('c');
- l.add('b');
- l.add('a');
- l.add('c');
- l.add('a');
- l.add('d');
- l.add('e');
- l.add('f');
- l.add('e');
- l.add('g');
- l.add('d');
- l.add('e');
- l.add('h');
- l.add('i');
- l.add('j');
- l.add('h');
- l.add('k');
- l.add('l');
- l.add('i');
- l.add('j');
- charPartition(l);
- }
-
- public static List<Integer> charPartition(List<Character> l) {
- List<Integer> result = new ArrayList<Integer>();
- for(int i=0;i<l.size();i++) {
- List<Character> l1 = l.subList(0, i);
- List<Character> l2 = l.subList(i,l.size());
-
- for(int j=0; j<l1.size();j++) {
- if(l2.contains(l1.get(j))){
- break;
- }else if(!l2.contains(l1.get(j)) && j==l1.size()-1){
-
- result.add(i);
- }
- }
-
- }
-
- List<Integer> _r = new ArrayList<Integer>();
- _r.add(result.get(0));
- if(result.size()>1) {
-
- for(int i=1;i<result.size();i++) {
- int _t =result.get(i)-result.get(i-1);
- _r.add(_t);
- }
- }
- _r.add(l.size()-result.get(result.size()-1));
-
- for(Integer i : _r) {
- System.out.println(i);
- }
-
- return _r;
- }
- }
复制代码 |