2016-04-28 Apixio 服務(wù)端工程師面試題

Apixio 服務(wù)端工程師面試題

  1. Redis 和 sql數(shù)據(jù)庫 比較
  2. 怎樣做到load balance
  3. 分布式數(shù)據(jù)庫中數(shù)據(jù)庫同時(shí)讀寫怎么防止數(shù)據(jù)不同步
  4. kafka 和 graphite 實(shí)時(shí)數(shù)據(jù)監(jiān)控是怎么做的?
    5.編程題: 從起始點(diǎn)到終點(diǎn)的路徑,附實(shí)現(xiàn)方法
/*
# Bounded region of a graph that connects 's' to 'e' defined in terms of all
# paths between 's' and 'e'. 's' can have incoming links and 'e' can have
# outgoing edges.  The graph can have cycles in it.  Each node has at most two
# outgoing edges. Additional data-structures and methods may be defined.  
# Do not add new variables in the Node.
# Node has hashCode and equals defined.
#                   +---+         +---+
#             +---->|  g |<--------+ k  +---------+
#             |     +-+-+         +---+         |
#  |   +---+  |       |             ^           |
#--+-->| s +--+       |             |           |
#      +-+-+          v             |           v         ^
#        |          +---+           |         +---+       |
#        +--------->|   |-----------+-------->| e +-------+-->
#  
                 +---+                     +---+
*/
public class Node {
  public Node left;
  public Node right;
  public int data;
}

public class BoundedGraph {
  public Node s;
  public Node e;

  public BoundedGraph(Node s, Node e) {
    this.s = s;
    this.e = e;
  }

public void printGraph() {
  Set<Node> visited = new HashSet<Node>();
  innerPrintGraph(s, e, visited);
}

private void innerPrintGraph(Node s, Node e, Set<Node> visited) {
    if (visited.contains(s)) return;
    System.out.println(s.data);
    visited.add(s);
    if (s.left != null && s != e) 
innerPrintGraph(s.left, e, visited); 
}

后記: 知識(shí)點(diǎn)還不夠熟,另外,做編程題的時(shí)候,不要老想著leetcode的解答。 自己腦袋里面有思路最關(guān)鍵。我都想到了用hashmap來標(biāo)注訪問過的節(jié)點(diǎn)。沒想到直接用HashSet來標(biāo)注節(jié)點(diǎn)。 面試官都給了很充分的提示了,我當(dāng)時(shí)腦袋停止轉(zhuǎn)動(dòng)了,還沒能搞定。面試官直接給我說了解題思路。估計(jì)是把我掛掉了,我還比較遜色。

同門小師妹都拿到Google nyc的職位了。汗顏! 繼續(xù)努力吧!

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

  • Android 自定義View的各種姿勢1 Activity的顯示之ViewRootImpl詳解 Activity...
    passiontim閱讀 178,816評論 25 709
  • (一)Java部分 1、列舉出JAVA中6個(gè)比較常用的包【天威誠信面試題】 【參考答案】 java.lang;ja...
    獨(dú)云閱讀 7,241評論 0 62
  • 那些美好,就只能遙遠(yuǎn)地留在記憶里,放在遠(yuǎn)方了。
    無用之書閱讀 289評論 0 0
  • 意亂猶如海,風(fēng)催秋亦來。 無奈云卷舒,萬般難釋懷。 天涯路不斷,何曾化滄海。 借君三尺劍,斬罷歸塵埃。
    風(fēng)信子_55e0閱讀 219評論 0 0
  • 嗯從上周六開始 周六晚上常規(guī)會(huì)議之后和J在一起,感覺心情有點(diǎn)壓抑,到說不清是為什么,然后就馬上一起上出租去了一晚上...
    Ceeeeeeeee呀閱讀 212評論 4 2

友情鏈接更多精彩內(nèi)容