注册一亩三分地论坛,查看更多干货!
您需要 登录 才可以下载或查看附件。没有帐号?注册账号 
x
5月中旬投了google云的TSE(Technical Support Engineer)岗位,base在东京,本来想找纯engineer的岗位投的,无奈东京google根本没有open的HC。
投递完简历不到1周的样子,google的recruiter发来消息,邀请面试。
HR面会问一些general的问题,自我介绍,为什么跳槽?为什么来选择TSE?还会问一些基本的技术问题:
1. 给了一段代码,问你这个是干什么的?答案是冒泡排序;
2. http返回码都有啥?http method的都有啥?
3. Shell执行命令时在哪个路径下找command
4. 插入排序的worst time complexity
HR面完没过几天就是TSE的manager的technical screen,主要问一些Linux系统和troubleshoot相关的问题:
1. 客户那边ssh登录不上,error msg是connection timeout。回答iptables,security group,一些网络联通性探测工具,ping,telnet,nmap就差不多了
2. Linux下在哪看device相关信息,USB插入不成功,在哪debug。答:lsdev,dmesg
3. top命令输出都是什么意思?load average那3个数字都表示什么?答:CPU/MEM usage,process信息,load average表示running和uninterruptable sleeping的进程在1,5,15分钟内的平均数量
4. 给了一段java代码,让你解释这个代码是干什么的?并且找出其中潜在问题给出修正方案,第一轮面试的时候的java code(修改bug后的版本)放在本文最后
6月11过一个project,你怎么去建立流程,拆分工作。
终面完大概不到1周,recruiter过来联系我做catch up,说hiring committee认为coding部分的面试不够全,需要追加一轮面试,得知我这边有pending offer之后,追加面试之间放到了catch up的第二天。
追加面试很简单,主要考察你读code的能力,不考虑写。面试过程中碰到的coding题目我直接贴下面了。形式就是在一个shared doc上,面试官给你贴一段代码,让你脑编译执行出来结果。
面完没几天,recuriter邀请了我做offer call,package各项加起来大约1100 ~ 1200w日元一年。但考虑到工作性质偏support,技术成长性方面较差的因素,最后拒掉了这个offer
第一轮面试的时候的java code(修改bug后的版本)
- TSE code
- Java code review
- @ProcessElement
- public int processElement(DoFn<String, Integer>.ProcessContext context) throws Exception {
- String variantId = context.element();
- ExponentialBackOff backoff = new ExponentialBackOff.Builder().build();
- while (true) {
- try {
- genomics.variants().delete(variantId).execute();
- Metrics.counter(DeleteVariantFn.class, "Number of variants deleted").inc();
- context.output(1);
- return 0;
- } catch (Exception e) {
- if (e.getMessage().startsWith("429 Too Many Requests")) {
- LOG.warn("Backing-off per: ", e);
- long backOffMillis = backoff.nextBackOffMillis();
- if (backOffMillis == BackOff.STOP) {
- throw e;
- } else {
- return backOffMillis;
- }
- } else {
- throw e;
- }
- }
- }
- }
- -------
- try {
- Int backOffMillis = processElement(xxx);
- If (backOffMillis > 0) {
- sleep(backOffMillis);
- }
- dotask();
- } catch (Exception e) {
- processException(e);
- }
复制代码
code追加面试题目
- TSE coding part
- // Q1) What would be the output?
- public class Sample {
- public static void main(String[] args) {
- String str = "abc";
- char chars[] = str.toCharArray();
- for(int i= chars.length-1; i>=0; i--) {
- System.out.print(chars[i]);
- }
- }
- }
- // A1) cba
- // Q2) What would be the output?
- public class Sample {
- public static void main(String[] args) {
- String str = new String("aabcca");
- int count = 0;
- char[] chars = str.toCharArray();
- for (int i=0; i<str.length();i++) { // outer loop
- for(int j=i+1; j<str.length();j++) { // inner loop
- if (chars[i] == chars[j]) {
- System.out.println(chars[j]);
- count++;
- break;
- }
- }
- }
- }
- }
- //
- // A2
- // # i=0 (outer loop)
- // a
- // a
- // # i = 1
- // a
- // # i = 2
- // # i = 3
- // c
- // Q3) What would be the output?
- class Parent {
- public Parent()
- {
- System.out.println(“Parent class constructor called”);
- }
- }
- public class Child extends Parent
- {
- public Child()
- {
- System.out.println(“Child class constructor called”);
- }
- public static void main(String args[])
- {
- Child c = new Child();
- }
- }
- // A3
- // Parent class constructor called
- // Child class constructor called
- // Q4) What would be the output?
- import java.util.*;
- public class Example {
- public static void main(String args[]) {
- Map<String, String> map = new HashMap<String, String>();
- map.put("key1", "red");
- map.put("key2", "blue");
- map.put("key3", "green");
- for (String key : map.keySet()) {
- String value = map.get(key);
- System.out.println(value);
- }
- }
- }
- // A4
- // # the order may not exactly the same
- // red
- // blue
- // green
- // Q5) What would be the output?
- public class Change
- {
- public static int performSomething(int[] arrNumbers, int num)
- {
- if(num == 0 || num == 1)
- {
- return num;
- }
- int[] arrTemporary = new int[num];
- int b = 0;
- for(int a = 0; a < num - 1; a++)
- {
- if(arrNumbers[a] != arrNumbers[a + 1])
- {
- arrTemporary[b++] = arrNumbers[a];
- }
- }
- arrTemporary[b++] = arrNumbers[num - 1]; // b = arrTemporary.length, b = 8
- for(int a = 0; a < b; a++)
- {
- arrNumbers[a] = arrTemporary[a];
- }
- return b;
- }
- public static void main(String[] args)
- {
- int[] arrInput = {1, 2, 3, 3, 4, 5, 5, 6, 7, 8};
- int len = arrInput.length; // 10
- len = performSomething(arrInput, len);
- // printing elements
- for(int a = 0; a < len; a++)
- {
- System.out.print(arrInput[a] + "" "");
- }
- }
- }
- // A5
- // # ArraryTemporary = [1, 2, 3, 4, 5, 6, 7, 8]
- // 1 2 3 4 5 6 7 8
- // Q6) What would be the output?
- public class ExceptionTest {
- public static void main(String[] args) {
- System.out.println(exceptionTest());
- }
- public static int exceptionTest()
- {
- int i=6;
- try{
- throw new NullPointerException();
- }
- catch(NullPointerException e)
- {
- i=10;
- throw e;
- }
- finally
- {
- i=20;
- System.out.println("In finally block");
- return i;
- }
- }
- }
- // A6
- // In finally block
- // # 这里我答错了,面试后编译了跑了遍发现是i=20是会被return的
- // Q7) Please put comments to improve the readability.
- // this function will try to get the return value from the stopwatch thread until the following cases happen
- // 1) there is untriable execption happened during the execution of stopwatch thread
- // 2) the retry number exceed the maximum retry times
- // 3) the attempt number is greater then the minimum retry times but the execution of stopwatch thread is overtime
- // @return V output of stopwatch thread
- // @throw RetryHelperException
- private V doRetry() throws RetryHelperException {
- // start a new thread to do something
- stopwatch.start();
- while (true) {
- attemptNumber++;
- Exception exception;
- try {
- // trying to get result from thread we just executed
- V value = callable.call();
- return value;
- } catch (Exception e) {
- // let the exceptionHandler check if the exception is retriable, if not, then throw NonRetriableException
- if (!exceptionHandler.shouldRetry(e)) {
- // check the type of the exception, if the exception of the 3 types, then we propagate it
- if (e instanceof InterruptedException ||
- e instanceof InterruptedIOException ||
- e instanceof ClosedByInterruptException) {
- RetryInterruptedException.propagate();
- }
- throw new NonRetriableException(e);
- }
- exception = e;
- }
-
- // check if the attempt number exceed the maximum retry times
- if (attemptNumber >= params.getRetryMaxAttempts() || (
- // make sure the attempt number is greater then the minimum retry times, and if it is the case, then check if the exection of the
- // stopwatch thread is overtime
- attemptNumber >= params.getRetryMinAttempts()
- && stopwatch.elapsed(MILLISECONDS) >= params.getTotalRetryPeriodMillis())) {
- throw new RetriesExhaustedException(this + ": Too many failures, giving up", exception);
- }
-
- // estimate the time to sleep, wait a moment and try again
- long sleepDurationMillis = getSleepDuration(params, attemptNumber);
- try {
- Thread.sleep(sleepDurationMillis);
- } catch (InterruptedException e) {
- RetryInterruptedException.propagate();
- }
- }
- }
复制代码
|