今天面的第二轮。。。面完很伤心很失望,下午上了一下午班后,感觉好了点,开始觉
得自己发挥的好差,题也不容易,为啥别人都能碰到常见的常规的题,我就碰不到。。
。。不够难过的时候怪运气是太容易的事了,但现在冷静下来感觉,不过是给自己找借
口罢了。发面经上来,给自己差劲的人品增值,希望将来的面试顺利。
第一轮两道题
1. first missing positive
2. 写一个file line iterator
Implement a (Java) Iterable object that iterates lines one by one from a
text file..
/** A reference to a file. */
public class TextFile implements Iterable. From 1point 3acres bbs
{
public TextFile(String fileName) { // please implement this
/** Begin reading the file, line by li... 阅读全帖
【 以下文字转载自 Linux 讨论区 】
发信人: Ataraxia (静), 信区: Linux
标 题: how to use grep/sed to remove newlines?
发信站: BBS 未名空间站 (Sat Oct 18 10:48:52 2008)
i am trying grep some text from a file then return some words:
grep "^>start" textfile.txt
but it always returns results one each line:
A
B
C
I want to have it as: A B C ..., so I tried to use sed:
grep "^>start" textfile.txt | sed -e 's/\n//'
it doesn't work, anyone knows how to solve this?
Thanks.
spark beginner trying out the buzz tech
input 200GB uncompressed data file stored in hdfs
37 worker nodes, each has 24 cores
using java map reduce, 6-8 minutes
using spark, 37 minutes, 2 18 minute-stage
"lightning fast cluster computing, 100x faster" ???!!!!
Big bulls please advise!
#sortMapper sort values for each key, then do some iteration for the grouped
values
text = sc.textFile(input,1776) #24*37*2
text.map(mapper).filter(lambda x: x!=None).groupByKey().map(sortMapper).
filter(lambda x: x... 阅读全帖
can use programming, such as java:
make a 2D array, put excel sheet into the array.
for each value, find _ and select substring before _, put into a new array.
then for the new array, start with first value, use for loop, from i=1,if
find any value == this
value, delete that value, shift array contents one step up,reduce the
dimension by 1, increase i by 1, do it again. when i reaches 1million, put
this value into first position of a new 1D array, delete this value.
do it again with the second v... 阅读全帖
-- Hive queries for Word Count
drop table if exists doc;
-- 1) create table to load whole file
create table doc(
text string
) row format delimited fields terminated by 'n' stored as textfile;
--2) loads plain text file
--if file is .csv then in replace 'n' by ',' in step no 1 (creation of doc
table)
load data local inpath '/home/trendwise/Documents/sentiment/doc_data/
wikipedia' overwrite into table doc;
-- Trick-1
-- 3) wordCount in single line
SELECT word, COUNT(*) FROM doc LATERAL VIEW explo... 阅读全帖