##一、实验内容对HDFS输入目录的路径解析出来,组成输出路径,这在业务上是十分常用的。这里其实是没有多文件名输出,仅仅是调用了MultipleOutputs的addNamedOutput方法一次,设置文件名为result. 同时为了保证计算的可重入性,每次都需要将已经存在的输出目录删除。
Programming interview questions, tips and knowledge, system design, big data.
2016-06-29
2016-06-29
##一、实验内容本节介绍如何使用HashPartitioner将Mapper的输出按照key进行分组后交给Reducer来处理。合理的分组策略将使得每个Reducer获得的计算负载差距不大,从而整体reduce的性能更加均衡。
2016-06-29
最近看完《琅琊榜》这不热播剧后,真心感觉其是一部国产的良心之作,完美的剧情,外加杠杠的特效,使得我这个不经常看电视剧的人也能追着看完。 通过整个剧的回顾,我们可以惊奇的发现:人称麒麟才子的梅长苏就是一个大数据的专家先驱有木有,琅琊阁就是一个数据中心有木有!
2016-06-29
##题目 ####Add and Search Word - Data structure design Design a data structure that supports the following two operations: void addWord(word) bool search(word) search(word) can search a literal word or a regular expression string containing only letters a-z or .. A . means it can represent any one le
2016-06-29
##引言MarkDown的目标是实现易读易写。它用来作为一种网络内容的写作语言。但是我们不是要用它来取代HTML,而是它能让文档更容易阅读、编写。 参考图灵社区MarkDown语言说明(详解版)。
2016-06-29
题目Two Sum Given an array of integers, find two numbers such that they add up to a specific target number. The function twoSum should return indices of the two numbers such that they add up to the target, where index1 must be less than index2. Please note that your returned answers (both inde
2016-06-29
##题目 ####ZigZag Conversion The string PAYPALISHIRING is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibility) P A H N A P L S I I G Y I R And then read line by line: PAHNAPLSIIGYIRWrite the c
2016-06-29
##题目 ####String to Integer (atoi) Implement atoi to convert a string to an integer. Hint: Carefully consider all possible input cases. If you want a challenge, please do not see below and ask yourself what are the possible input cases. Notes: It is intended for this problem to be specified vaguely
2016-06-29
##题目 ####Roman to Integer Given a roman numeral, convert it to an integer. Input is guaranteed to be within the range from 1 to 3999.
2016-06-29
##题目 ####Word Ladder Given two words (start and end), and a dictionary, find the length of shortest transformation sequence from start to end, such that: 1.Only one letter can be changed at a time2.Each intermediate word must exist in the dictionaryFor example, Given:start = "hit"end = &q
2016-06-29
##题目 ####Regular Expression Matching Implement regular expression matching with support for ‘.’ and ‘*’. '.' Matches any single character. '*' Matches zero or more of the preceding element. The matching should cover the entire input string (not partial). The function prototype
2016-06-29
##题目 ####Reverse Integer Reverse digits of an integer. Example1: x = 123, return 321 Example2: x = -123, return -321 ####Have you thought about this?Here are some good questions to ask before coding. Bonus points for you if you have already thought through this! If the integer’s last digit is 0, wh
2016-06-29
##题目 ####Palindrome Number Determine whether an integer is a palindrome. Do this without extra space. ####Some hints:Could negative integers be palindromes? (ie, -1) If you are thinking of converting the integer to string, note the restriction of using extra space. You could also try reversing an i
2016-06-29
##题目 ####Median of Two Sorted Arrays There are two sorted arrays A and B of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity should be O(log(m+n)).
2016-06-29
##题目 ####Longest Common Prefix Write a function to find the longest common prefix string amongst an array of strings.
2016-06-29
##题目 ####Longest Substring Without Repeating Characters Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters for “abcabcbb” is “abc”, which the length is 3. For “bbbbb” the longest substring is “b”, with
2016-06-29
##题目 ####Longest Palindromic 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.
2016-06-29
##题目 ####Integer to Roman Given an integer, convert it to a roman numeral. Input is guaranteed to be within the range from 1 to 3999.
2016-06-29
##题目 ####Container With Most Water Given n non-negative integers a1, a2, …, an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of line i is at (i, ai) and (i, 0). Find two lines, which together with x-axis forms a container, such that the
2016-06-29
##题目 ####Word Search II Given a 2D board and a list of words from the dictionary, find all words in the board. Each word must be constructed from letters of sequentially adjacent cell, where “adjacent” cells are those horizontally or vertically neighboring. The same letter cell may not be used mor