Twitter Interview Question for Software Engineer / Developers

Country: United States
Interview Type: Phone Interview

Comment hidden because of low score. Click to expand.
of 1 vote

Here's an pseudo algorithm that should solve the problem:
average = 0
bandwidth = 0
for each file
_tsv = convert file
_read tsv and populate tempLatency and tempBand
_delete tsv
_average += tempLatency
_bandwidth += tempBand
average /= number of files
return average and bandwidth

If you want to get spiffy, you could try some hashing or something like that if there is a chance the files could be identical or something like that. But I think the approach above is probably the best

- zortlord January 03, 2015 | Flag Reply
Comment hidden because of low score. Click to expand.
of 1 vote

I implemented that in Java more or less and didn't get through. I think the main takeaways were.

1) Ask a lot of clarifying questions. (How many values are in the file? Are the attributes sorted in any way? What are the attributes?)
2) Know how to do file io. I spent a lot of time trying to figure out what libraries to use and didn't get to implement all my subroutines because of it.

- haroldtreen January 03, 2015 | Flag
Comment hidden because of low score. Click to expand.
of 1 vote


Algorithmically, the problem seems easy so I would expect that they are not judging on slick algorithm things but rather on perfect, usable, tested code

If I were wrong about that then I guess there may be ways to speed that general approach up like:
1. Like you said, are the values in the tsvs in the same order and will they always have the same values (speed the extraction of tsv values)?
2. Are there alternative ways to compute the bandwidth/latency (speed extraction of tsv values)?
3. Is there some ordering to the bin values that could be exploited (filenames, date times, etc) (do all files need to be computed )?

There could be lots of reasons why you weren't selected which may have nothing to do with your performance. Don't sweat it- "sometimes you get the bear and sometimes the bear gets you"

- zortlord January 03, 2015 | Flag

Add a Comment

Writing Code? Surround your code with {{{ and }}} to preserve whitespace.


is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.

Learn More


CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.

Learn More

Resume Review

Most engineers make critical mistakes on their resumes -- we can fix your resume with our custom resume review service. And, we use fellow engineers as our resume reviewers, so you can be sure that we "get" what you're saying.

Learn More

Mock Interviews

Our Mock Interviews will be conducted "in character" just like a real interview, and can focus on whatever topics you want. All our interviewers have worked for Microsoft, Google or Amazon, you know you'll get a true-to-life experience.

Learn More