1. 程式人生 > >百度秋招深圳-C++/PHP研發工程師面試雜記

百度秋招深圳-C++/PHP研發工程師面試雜記

引子

2018/09/19 晴
我參加了百度秋招面試, 期望方向是 PHP 研發
面試地點在廣東省深圳市百度國際大廈, 粗略估計了一下我那一場的面試大概有 15~20 來人蔘加
https://youtu.be/nXT_wz5Gcq4
No photography

面試

流程

到場直接被安排在旁邊坐下等候通知, 過了一會就有工作人員帶路去面試場地
由於深圳百度是新建的大樓, 可能沒有完全啟用, 本次面試被安排在 14 樓食堂層
所有人都在一個大場地裡, 就像高考一樣分開做好面試, 挺刺激的 xD
面試了兩輪, 面完二面後被告知先去等候區等候, 一會工作人員過來通知可以離場了

一面 (~ 45 min)

二面 (~ 35 min)

GET POST
BACK button/Reload Harmless Data will be re-submitted (the browser should alert the user that the data are about to be re-submitted)
Bookmarked Can be bookmarked Cannot be bookmarked
Cached Can be cached Not cached
Encoding type application/x-www-form-urlencoded application/x-www-form-urlencoded or multipart/form-data. Use multipart encoding for binary data
History Parameters remain in browser history Parameters are not saved in browser history
Restrictions on data length Yes, when sending data, the GET method adds the data to the URL; and the length of a URL is limited (maximum URL length is 2048 characters) No restrictions
Restrictions on data type Only ASCII characters allowed No restrictions. Binary data is also allowed
Security GET is less secure compared to POST because data sent is part of the URL Never use GET when sending passwords or other sensitive information! POST is a little safer than GET because the parameters are not stored in browser history or in web server logs
Visibility Data is visible to everyone in the URL Data is not displayed in the URL
  • 怎麼抓包 (fiddler) HTTPS 怎麼辦
    終於問到老本行了, 抓 HTTPS 給客戶端裝自簽名證書, 順便提了下代理抓包(Android)
  • 怎麼優化 SQL (explain) MySQL 優化有哪些手段
    稍微有點含金量的口水題, 我答了合理索引, 冗餘欄位, 快取
    面試官聽完接著問還有嗎, 當然有啊
  • Consistent Hashing
    沒答上, 尷尬
  • n 個數找出現次數大於 n/2 次的
    沒答上, 尷尬++
from collections import Counter


class Solution:
    def majorityElement(self, nums):
        """
        :type nums: List[int]
        :rtype: int
        """
        return Counter(nums).most_common()[0][0]

If this is asked in an interview, I think the interviewer probably
wants to see your problem solving process, not just your knowledge of
algorithms.

The description is quite general so maybe you can ask him the range or
meaning of these numbers to make the problem clear. Doing this may
impress an interviewer. If, for example, these numbers stands for
people’s age of within a country (e.g. China),then it’s a much easier
problem. With a reasonable assumption that nobody alive is older than
200, you can use an int array of size 200(maybe 201) to count the
number of people with the same age in just one iteration. Here the
index means the age. After this it’s a piece of cake to find 100
largest number. By the way this algo is called counting sort.

Anyway, making the question more specific and clearer is good for you
in an interview.

後記

說實話筆試做的挺爛的, 因為不允許跳出網頁用本地 IDE
又只能用 php 導致我很多函式不記得, 書到用時方恨少了
還是被傳喚去面試, 沒想到一面就是一下午, 當時還擔心簡歷帶的不夠
後來面完二面我簡歷剛好用完的時候把我趕走了, 也算是不幸中的萬幸???
問了下二面面試官目前 php 在百度的發展, 答曰需求不大, 多為老專案維護
也難怪崗位名稱大家都喊斜槓前面的而忽略掉斜槓後面的