原创 Triangle Count

Given an array of integers, how many three numbers can be found in the array, so that we can build an triangle whose

原创 Zigzag Iterator

Given two 1d vectors, implement an iterator to return their elements alternately. Have you met this question in a r

原创 GBDT算法解析

在網上看到一篇對從代碼層面理解gbdt比較好的文章,轉載記錄一下:              GBDT(Gradient Boosting Decision Tree) 又叫 MART(Multiple Additive Regressi

原创 百度抽樣算法面試題(部分)

1.  給你一個長度爲N的鏈表。N很大,但你不知道N有多大。你的任務是從這N個元素中隨機取出k個元素。你只能遍歷這個鏈表一次。你的算法必須保證取出的元素恰好有k個,且它們是完全隨機的(出現概率均等)。解:先選中前k個, 從第k+1個元素到

原创 Copy Books

Given n books and the ith book has A[i] pages. You are given k people to co

原创 主機和docker之間互傳文件

主機和容器之間傳輸文件的話需要用到容器的ID全稱。 獲取方法如下: 1.先拿到容器的短ID或者指定的name。 2.然後根據這兩項的任意一項拿到ID全稱。 有了這個長長的ID的話,本機和容器之間的文件傳輸就簡單了。 do

原创 Binary Tree Preorder Traversal python

二叉樹的前序遍歷(非遞歸)(小米雲計算一面)java/** * Definition of TreeNode: * public class TreeNode { * public int val; * publi

原创 Expression Expand

Given an expression s includes numbers, letters and brackets. Number represents the number of repetitions inside the

原创 阿里巴巴(電面一)

阿里巴巴(電面一)在之前的一天約定時間進行電話面試,第二天面試官非常準時的打來電話。因爲需要進行在線的寫代碼,所以在教室裏進行的電面。首先自我介紹,然後介紹項目,面試官根據項目提出了一些問題。主要包括推薦系統的異常值的處理、svd的表示、

原创 Top k Largest Numbers II

Implement a data structure, provide two interfaces: add(number). Add a new number in the data structure.topk(). Retur

原创 High Five

There are two properties in the node student id and scores, to ensure that each student will have at least 5 points,

原创 strStr II

Implement strStr function in O(n + m) time. strStr return the first index of the target string in a source string. T

原创 3Sum Closest

Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Retu

原创 經典二分法

Find any position of a target number in a sorted array. Return -1 if target does not exist.java實現public class Solution

原创 滴滴大數據面經

地點:西二旗文思海輝2月11日面試完百度之後,看到手機的未接電話,感覺應該是面試邀約,但是沒有接到,打回去後對方又一直不接,於是秉承着不要臉的精神一直打了5個電話,對方終於接通。接通後簡單的談了一些項目中的問題,又問了問所學的課程,可能是