Google 面经

Posted Keep walking

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Google 面经相关的知识,希望对你有一定的参考价值。

1. 給你兩個string 
if function(s1) == function(s2)  return true
else return false1point3acres.com/bbs

function做的事情  遇到b 就刪除前面一個字元  其他就不管  當b太多的時候 return ""


for example 
accc =>  accc
accb => ac
abdd => dd
. visit 1point3acres.com for more.
如果string 非常大  
無法fit memory 怎麼辦
. 鐣欏鐢宠璁哄潧-涓€浜╀笁鍒嗗湴

答案:
用iterator  然後從後面開始讀

 

2. 给三个function
String hash(String s)
String encrypt(String message)
String decrypt(String secret)


eg.
encrypt("secret") = "12345"
decrypt("12345") = "secret"
要设计一个信息加密serve,其实是写一个class 完成这两个function
void sendMessage(String id, String message)
String getMessage(String id)


eg.
sendMessage(‘Bob‘, ‘Hi‘)
getMessage(‘Bob‘) // ‘Hi‘

 

3. Robot Clearner

Givena robot cleaner in a room modeled as a grid. Each cell in the grid can be emptyor blocked. The robot cleaner can move forward, turn left or turn right. Whenit tries to move into a blocked cell, its bumper sensor detects the obstacleand it stays on the current cell.
 
Thecontrol API:
interfaceRobot {
  //returns true if next cell is open and robot moves into the cell.
  //returns false if next cell is obstacle and robot stays on the current cell.
  booleanMove();
 
  //Robot will stay on the same cell after calling Turn*. k indicates how
  //many turns to perform.
  voidTurnLeft(int k);
  voidTurnRight(int k);
 
  //Clean the current cell.
  voidClean();more.
  booleanMove(Direction d);
}
 
Sampleinput
++++++++++
+........+
+...^....+
+.+......+
++++.+++++
+.....+
+++++++

. 1point 3acres 璁哄

要求用定的API完所有empty格子。Timecomplexity, linear in term of room space.

 

以上是关于Google 面经的主要内容,如果未能解决你的问题,请参考以下文章

2019-1-17 google面经

XCode 十一大礼包 --2018 Google Onsite 面经最全总结

面经🎭

Android原生PDF功能实现含泪整理面经

请问如何Google.cn关闭的话,google.com还能正常访问吗?

“未安装以下 SDK 组件:sys-img-x86-addon-google_apis-google-22 和 addon-google_apis-google-22”