自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

  • 博客(197)
  • 收藏
  • 关注

原创 告一段落。。。

跳槽告一段落,时间是刷题一个多月夹杂看一些书,感冒一周,出去玩一周,然后面一个月。一共面了 t, ub, zen, ap, g, l, mz, 其中ub挂在店面,l挂在on site, ap安排onsite太慢就cancel了,其他都拿到offer. abnb 和f 回复我太慢了是个遗憾,还有thumbtack, palantir, cloudera, sumo, quora, snapchat,

2015-07-31 07:06:05 531

原创 twitter面经

twitter 店面 1. 找前一百个质数. 一个一个check until找到100个, check的时候只需要from 2 to sqrt(n). 然后他说了另外一种方法: 用一个很大的array,每次cross out掉最后一个质数的倍数最后剩下的就是 2. 问median和mean的区别。我说了怎么算但是没有给出use case。。。他说工资啊,ceo的那么高,我们就用median不用m

2015-07-31 06:37:05 513

原创 on site 面经

g on site面经 1. 一群人排成一队,每个人记录下自己的身高和排在前面的比自己高的人數,现在把它们顺序打乱,如何恢复原来的顺序 (先按身高排序,再逆序做insertion) 2. 有一个matrix[m][n], 都是integer. 实现两个api update(x, y, v). 更新matrix[x][y]的值为v query(x1,y1,x2,y2) 。 计算这个矩形区域的

2015-07-22 06:22:31 478

原创 google 面经

1. input string:“+++–++-+” 游戏规则:每人每次可以 flip “++” to “–”(必须是相邻的) 第一问:generate all possible moves 第二问:determine if this player can will. 下一步没有连续的++2. 1.先写反转链表,然后第二题把链表变成a1->an->a2->an-1 2.第一题是path

2015-07-14 13:31:01 1096

原创 threadpool

infoQ中的聊聊并发, 来自方腾飞http://www.infoq.com/cn/articles/java-threadPool http://www.infoq.com/cn/articles/thread-pool-algorithm-realization

2015-07-08 12:35:38 219

转载 九章系统设计

第1章系统设计工具箱之(Distributed)Database System北京时间 2015-04-26 01:00 美西时间 2015-04-25 10:00 本节大纲全面复习面试需要掌握的数据库系统概念 理清主流分布式数据库(HBase, Cassandra, DynamoDB等)的设计思路及应用场景 熟悉基于分布式数据库的大数据处理 教你如何看懂MapReduce,BigTabl

2015-07-07 01:08:38 912

转载 hadoop 面试小结

原帖地址 http://blog.csdn.net/ludi7125/article/details/7561675入门:知道MapReduce大致流程,map, shuffle, reduce知道combiner, partition作用,设置compression搭建hadoop集群,master/slave 都运行那些服务HDFS,replica如何定位版

2015-07-07 01:06:39 206

转载 system-design-interview [github]

How to prepare system design questions for IT companySystem design is a very broad topic. Even a software engineer with many years of working experience at top IT company may not be an expert on syst

2015-07-07 00:58:39 2786

转载 Design复习

FLAG‎ > ‎Design复习如何秒掉99%的海量数据题!!! http://blog.csdn.net/v_july_v/article/details/7382693十道海量数据题: http://blog.csdn.net/v_july_v/article/details/6279498总而言之就是hash function写到小文

2015-07-06 15:25:40 625

原创 hadoop 面试

董老师hadoop面试list董的博客 hadoop面试mapreduce算法hadoop terasort实现15个java多线程面试题和回答coursera 课程 1

2015-07-06 13:56:46 260

原创 Leetcode Simplify path

Given an absolute path for a file (Unix-style), simplify it.For example, path = “/home/”, => “/home” path = “/a/./b/../../c/”, => “/c”corner case: "/a//b", "" 开始把/.. 理解错了…. /a/b/.. = /a, /../../

2015-07-06 08:24:48 180

原创 Leetcode Divide two integers

divisor增加的时候*2,减小/2. handle integer overflow常用trick: longpublic class Solution { public int divide(int a, int b) { if(a==Integer.MIN_VALUE && b==-1)return Integer.MAX_VALUE; long d

2015-06-22 08:24:51 154

原创 Leetcode Pow(x,n)

divide conquer. 注意正负,overflowpublic class Solution { public double myPow(double x, int n) { int sign= (n%2==0 || x>0) ? 1 :-1; x=Math.abs(x); if(x==0 ||x==1)return sign*x;

2015-06-22 07:52:37 145

原创 Leetcode sqrt(x)

考点在于binary search 结束条件和overflow. 用loop invariant来理解: 每次loop都保证 [low,high]左边是严格小的,右边是严格大的.public class Solution { public int mySqrt(int x) { int low=1, high=x; if(x==0 || x==1)retur

2015-06-22 07:34:34 249

原创 Distributed algorithm

Atomic committwo-phase commit protocol Coordinator Cohort QUERY TO COMMIT

2015-06-22 02:15:20 244

转载 关于WAL: Write ahead log

全文在这里 http://www.cnblogs.com/daduxiong/archive/2010/08/20/1804301.html 节选 11.1. 一般性描述   预写式日志 (WAL) 是一种实现事务日志的标准方法.有关它的详细描述可以在 大多数(如果不是全部的话)有关事务处理的书中找到.简而言之,WAL 的中心思想是对数据文件 的修改(它们是表和索引的载体)必须是只能发

2015-06-21 13:14:33 224

原创 Leetcode Implement stack using queues

Implement the following operations of a stack using queues.push(x) -- Push element x onto stack.pop() -- Removes the element on top of the stack.top() -- Get the top element.empty() -- Return whethe

2015-06-19 07:50:52 160

转载 Luncene 入门

Lucene是一款非常棒的搜索引擎,而Lucene.NET是Lucene的.NET版本,本入门文档将以Lucene.NET 3.03为例。1、介绍一下创建索引过程的核心类Directory类描述了Lucene索引存放的位置,它是一个抽象类,它的子类负责具体指定索引的存储路径。例如FSDirectory类是负责真实文件系统的存储。IndexWriter

2015-06-19 06:54:53 212

原创 Leetcode Longest palindrome substring

Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 1000, and there exists one unique longest palindromic substring.一个palindrome可以用 if odd, mi

2015-06-17 09:08:18 189

原创 Leetcode Repeated DNA sequences

All DNA is composed of a series of nucleotides abbreviated as A, C, G, and T, for example: “ACGAATTCCG”. When studying DNA, it is sometimes useful to identify repeated sequences within the DNA. Write

2015-06-17 08:43:11 193

原创 linkedin 电面

1. 第一题: public boolean canPlaceFlowers(List flowerbed, int numberToPlace). 如果flowerbed当中为true,说明已经栽过花了,附近两个不能再栽花。numberToPlace代表想再栽多少花到flowerbed里。让return是不是还能栽那么多谢花进去。 第二题: public int distance (Li

2015-06-12 15:51:47 1287

原创 java 并发

blockingqueue 1. 简单的synchronized 实现public class BlockingQueue { private List queue = new LinkedList(); private int limit = 10; public BlockingQueue(int limit){ this.limit = limit; } publi

2015-06-12 14:55:11 150

原创 Leetcode Valid number

public class Solution { public boolean isNumber(String s) { int len = s.length(); int i = 0, e = len - 1; while (i <= e && Character.isWhitespace(s.charAt(i))) i++;

2015-06-12 07:47:11 128

原创 binarytree serialization

序列化与反序列化,用前序遍历,因为inorder 和 postorder都找不到rootpublic class Serialization { static String serialize(TreeNode root) { if(root==null)return "#"; else { return roo

2015-06-09 10:55:02 153

原创 Leetcode letter combination of a phone number

public class Solution { public List<String> letterCombinations(String digits) { list=new ArrayList<String>(); if(digits.length()==0)return list; StringBuffer path=new String

2015-06-09 08:38:10 157

原创 Uber 面经

网上搜到的电面1.电面是一个美国小哥,开始聊了聊简历之后给了一道系统设计题,设计一个Service可以输入用户location查询附近的公交站台和所有即将到这些站台的公交车。我随便和他扯了一些系统设计的还有优化算法之类的东西,后来让我写一个控制访问API频率(Ratelimit)的function, 用了一个Queue写完就结束了。 solution google实现的guava rate li

2015-06-08 15:50:21 1710 1

转载 GeoHash核心原理解析

原帖地址  http://www.open-open.com/lib/view/open1417940079964.html引子机机是个好动又好学的孩子,平日里就喜欢拿着手机地图点点按按来查询一些好玩的东西。某一天机机到北海公园游玩,肚肚饿了,于是乎打开手机地图,搜索北海公园附近的餐馆,并选了其中一家用餐。饭饱之后机机开始反思了,地图后台如何根据自己所在

2015-06-08 08:12:10 191

原创 Leetcode Reverse Bits

Reverse bits of a given 32 bits unsigned integer.For example, given input 43261596 (represented in binary as 00000010100101000001111010011100), return 964176192 (represented in binary as 00111001011110

2015-06-07 10:37:17 141

原创 Leetcode Number of 1 bits

Write a function that takes an unsigned integer and returns the number of ’1’ bits it has (also known as the Hamming weight).For example, the 32-bit integer ’11’ has binary representation 0000000000000

2015-06-07 10:23:21 106

原创 Leetcode Bitwise AND of numbers range

Given a range [m, n] where 0 <= m <= n <= 2147483647, return the bitwise AND of all numbers in this range, inclusive.For example, given the range [5, 7], you should return 4.bitwise AND 的结果是left header

2015-06-07 10:13:25 125

原创 Leetcode Maximal square

Given a 2D binary matrix filled with 0’s and 1’s, find the largest square containing all 1’s and return its area.For example, given the following matrix:1 0 1 0 01 0 1 1 11 1 1 1 11 0 0 1 0Return 4.

2015-06-07 07:45:20 192

原创 Leetcode Shortest palindrome

Given a string S, you are allowed to convert it to a palindrome by adding characters in front of it. Find and return the shortest palindrome you can find by performing this transformation.For example:G

2015-06-07 04:24:09 165

原创 Leetcode Count complete tree node

Given a complete binary tree, count the number of nodes.Definition of a complete binary tree from Wikipedia: In a complete binary tree every level, except possibly the last, is completely filled, and

2015-06-07 02:59:28 154

原创 Leetcode Max Points on a line

Given n points on a 2D plane, find the maximum number of points that lie on the same straight line.[方法1]/** * Definition for a point. * class Point { * int x; * int y; * Point() { x =

2015-06-03 14:13:15 162

原创 Leetcode Minimum size subarray

Given an array of n positive integers and a positive integer s, find the minimal length of a subarray of which the sum ≥ s. If there isn’t one, return 0 instead.For example, given the array [2,3,1,2,4,

2015-06-02 12:35:39 95

原创 Leetcode Combination sum III

Find all possible combinations of k numbers that add up to a number n, given that only numbers from 1 to 9 can be used and each combination should be a unique set of numbers.Ensure that numbers within

2015-06-02 12:19:39 128

原创 Leetcode Kth Largetst element

Find the kth largest element in an unsorted array. Note that it is the kth largest element in the sorted order, not the kth distinct element.For example, Given [3,2,1,5,6,4] and k = 2, return 5.Note:

2015-06-02 10:55:16 177

原创 Leetcode Contains Duplicate I, II, III

I Given an array of integers, find if the array contains any duplicates. Your function should return true if any value appears at least twice in the array, and it should return false if every element

2015-06-02 10:40:31 285

原创 文章标题

http://www.educity.cn/wenda/450855.htmlhttp://www.ylzx8.cn/zonghe/other/316208.htmlhttp://www.cnblogs.com/redcreen/tag/jvm/

2015-05-30 08:22:38 119

转载 Java垃圾回收机制

本文非原创,翻译自Java Garbage Collection introduction 在Java中为对象分配和释放内存空间都是由垃圾回收线程自动执行完成的。和C语言不一样的是Java程序员不需要手动写垃圾回收相关的代码。这是使得Java如此流行,同时也是Java能帮助程序员写出更好的Java应用的优点之一。计划写一个介绍Java垃圾回收基础的系列文章,共分四部分:Java垃圾

2015-05-30 07:32:36 200

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除