系统设计有用链接

2016-07-30
阅读 1 分钟
2.7k
大数据处理:[链接] [链接] system design:[链接]

Amazon 面试准备

2016-07-28
阅读 3 分钟
6.2k
[链接]1.Product of Array Except Self2.给两天的用户log数据,求两天均登陆Amazon的用户,follow up - log很大不可以放入内存相关问题,统计访问量最高的前10个ip,内存不够怎么办。统计最高的单词,内存不够。

Reverse Words in a String

2016-06-10
阅读 1 分钟
2.2k
Given an input string, reverse the string word by word. For example, Given s = "the sky is blue", return "blue is sky the".

Palindrome Partitioning(131)

2016-06-08
阅读 2 分钟
2.4k
Given a string s, partition s such that every substring of thepartition is a palindrome. Return all possible palindrome partitioning of s. For example, given s = "aab", Return [ ["aa","b"], ["a","a","b"] ]

Combination Sum

2016-06-02
阅读 2 分钟
2.1k
Given a set of candidate numbers (C) and a target number (T), find allunique combinations in C where the candidate numbers sums to T. The same repeated number may be chosen from C unlimited number oftimes. Note:All numbers (including target) will be positive integers. Elements ina combination (a1...

Subsets

2016-06-02
阅读 1 分钟
1.7k
Given a set of distinct integers, nums, return all possible subsets. Note: Elements in a subset must be in non-descending order. Thesolution set must not contain duplicate subsets. For example, If nums= [1,2,3], a solution is: [ [3], [1], [2], [1,2,3], [1,3], [2,3], [1,2], [] ]

Generate Parentheses(22)

2016-05-29
阅读 1 分钟
3.3k
Given n pairs of parentheses, write a function to generate allcombinations of well-formed parentheses. For example, given n = 3, a solution set is: "((()))", "(()())", "(())()", "()(())", "()()()"

Permutations(46)

2016-05-29
阅读 2 分钟
2.8k
Given a collection of distinct numbers, return all possiblepermutations. For example, [1,2,3] have the following permutations: [1,2,3],[1,3,2], [2,1,3], [2,3,1], [3,1,2], and [3,2,1].

Word Search(79)

2016-05-27
阅读 2 分钟
3.6k
Given a 2D board and a word, find if the word exists in the grid. The word can be constructed from letters of sequentially adjacentcell, where "adjacent" cells are those horizontally or verticallyneighboring.The same letter cell may not be used more than once. For example, Given board = [ ['A','B...

Java interview question

2016-05-27
阅读 1 分钟
1.8k
Override: is a language feature that allows a subclass to provide a specific implementation of a method. The overriding method in subclass has same name, same parameters and same return type as the method in the parent class. static, private and final methods are not overridden in Java.

Letter Combinations of a Phone Number(17)

2016-05-25
阅读 2 分钟
2.3k
Given a digit string, return all possible letter combinations that the number could represent. A mapping of digit to letters (just like on the telephone buttons) is given below. Input:Digit string "23" Output: ["ad", "ae", "af", "bd", "be", "bf","cd", "ce", "cf"]. Note: Although the above answer ...

singleton pattern & MVC pattern

2016-05-24
阅读 4 分钟
2k
This pattern involves a single class which is responsible to create an object while making sure that only single object gets created. This class provides a way to access its only object which can be accessed directly without need to instantiate the object of the class.

Maximum Product Subarray (152)

2016-05-19
阅读 2 分钟
2.6k
Find the contiguous subarray within an array (containing at least one number) which has the largest product. For example, given the array[2,3,-2,4], the contiguous subarray [2,3] has the largest product = 6.

Maximum Subarray (53)

2016-05-18
阅读 1 分钟
2.4k
Find the contiguous subarray within an array (containing at least one number) which has the largest sum. For example, given the array [−2,1,−3,4,−1,2,1,−5,4], the contiguous subarray [4,−1,2,1] has the largest sum = 6.

Climbing Stairs(70)

2016-05-18
阅读 1 分钟
1.9k
You are climbing a stair case. It takes n steps to reach to the top. Each time you can either climb 1 or 2 steps. In how many distinct wayscan you climb to the top?

Best Time to Buy and Sell Stock(121)

2016-05-17
阅读 1 分钟
1.6k
Say you have an array for which the ith element is the price of a given stock on day i. If you were only permitted to complete at most one transaction (ie, buy one and sell one share of the stock), design an algorithm to find the maximum profit.

Best Time to Buy and Sell Stock(121)

2016-05-17
阅读 1 分钟
1.6k
Say you have an array for which the ith element is the price of a given stock on day i. If you were only permitted to complete at most one transaction (ie, buy one and sell one share of the stock), design an algorithm to find the maximum profit.

House Robber(198)

2016-05-17
阅读 2 分钟
2.5k
You are a professional robber planning to rob houses along a street.Each house has a certain amount of money stashed, the only constraint stopping you from robbing each of them is that adjacent houses have security system connected and it will automatically contact the police if two adjacent hous...

Range Sum Query - Immutable (303)

2016-05-17
阅读 1 分钟
2.4k
Given an integer array nums, find the sum of the elements betweenindices i and j (i ≤ j), inclusive. Example: Given nums = [-2, 0, 3, -5, 2, -1] sumRange(0, 2) -> 1 sumRange(2, 5) -> -1 sumRange(0, 5) -> -3 Note:You may assume that the array does not change. There are many calls tosumRan...

Paint Fence(276)

2016-05-17
阅读 2 分钟
3.6k
There is a fence with n posts, each post can be painted with one of the k colors. You have to paint all the posts such that no more than two adjacentfence posts have the same color. Return the total number of ways you can paint the fence. Note: n and k are non-negative integers.

Reverse Vowels of a String(345)

2016-05-14
阅读 1 分钟
4.1k
Write a function that takes a string as input and reverse only the vowels of a string. Example 1: Given s = "hello", return "holle". Example 2: Given s = "leetcode", return "leotcede".

Symmetric Tree (101)

2016-05-12
阅读 1 分钟
2.3k
Given a binary tree, check whether it is a mirror of itself (ie,symmetric around its center).

Same Tree(100)

2016-05-12
阅读 1 分钟
2.3k
Given two binary trees, write a function to check if they are equal or Two binary trees are considered equal if they are structurally and the nodes have the same value.

Binary Tree Level Order Traversal (leetcode 102/103/107)

2016-05-12
阅读 4 分钟
2.9k
Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level).