3 ms·
I'm confused... why specify a 1 TB disk? It doesn't seem that the problem's solution has any dependence on the aforementioned disk aside from the data it contai
by DannoHung 16y ago
I'm confused... why specify a 1 TB disk? It doesn't seem that the problem's solution has any dependence on the aforementioned disk aside from the data it contains unless I'm misreading how he's explaining the answer?
- ntoshev 16y agoYeah, I also thought he expected to serve it all from a single disk. Hopefully in real life it gets clear in the discussion. It's a problem when asking interview questions: there are many ways in which the question may be unclear and the interviewer is mislead that the applicant can't answer. Another problem may be that the interview interferes with the thinking style of the applicant: you try to discuss it with him while he needs time to think by himself, or just the opposite: he thinks better in a discussion and you stay quiet while he sweats in stress.
- user24 16y ago> there are many ways in which the question may be unclear and the interviewer is mislead that the applicant can't answer. yeah, when I was interviewed for my university, they asked me to design an algorithm to work out the n'th term of the fibonnacci sequence. They repeatedly said I didn't need to use recursion or loops. When I finally gave up, they said: well here's one way: f(n) = f(n-1)+f(n-2) I just looked at them and quietly said "well... yeah... I mean... obviously". By that point I was too depressed to say "but that's frickin' recursive, wtf?!?" but that's what I was screaming in my head. Amazingly I still got offered a place. edit: still bugs the crap out of me. Did I mis-hear them? Were they being deliberately misleading? Was it some kind of test to see how I reacted to an impossible problem[1]? Were they really expecting me to come up with some mathematical algorithm to calculate the nth term without recursion or looping? Argh!!! [1]: actually it's not impossible: http://mathworld.wolfram.com/BinetsFibonacciNumberFormula.html http://mathworld.wolfram.com/BinetsFibonacciNumberFormula.ht... but I don't have a background in mathematics and they knew that.
- ntoshev 16y agoThey were likely trying to help you and wanted to say they don't care whether you write an iterative or recursive solution.
- user24 16y agoI'm pretty sure I asked for clarification several times... It's possible I suppose. Here's the problem it started from: Eleven lily pads are numbered from 0 to 10. A frog starts on pad 0 and wants to get to pad 10. At each jump, the frog can move forward by one or two pads, so there are many ways it can get to pad 10. For example, it can make 10 jumps of one pad, 1111111111, or five jumps of two pads, 22222, or go 221212 or 221122, and so on. We'll call each of these ways different, even if the frog takes the same jumps in a different order. How many different ways are there of getting from 0 to 10? (source: http://www.comlab.ox.ac.uk/admissions/ugrad/Sample_interview_problems http://www.comlab.ox.ac.uk/admissions/ugrad/Sample_interview...)
- dedward 16y agoHow the applicant seeks clarification is just as important as how he answers.. he's going to be presented with problems all the time. When I pop the open-ended technical questions, there really is no right or wrong answer - it's just there to judge someone's real ability - I have some questions you can't fake your way through. You don't have to have every little detail right, but I can tell from how you answer whether or not you are afraid to ask for clarification, and whether you know the material, and to a good degree how well you know the material. It's a conversation - not a one-way thing (at least in my case). I can tell if someone's nervous - and that's okay, too, but the job is going to be stressful, so after I explain not to be nervous and don't worry about getting every detail right.... but if you can't even begin to describe the systems I'm asking about, you don't belong on the team... same goes for if you don't seek clarification.
- user24 16y agoyep, that totally threw me too. It kinda implies that you're going to be handed a physical disk with some sort of k/v store in it and you need to write some software to access it. I immediately started thinking about seek times and elevator algorithms and that kind of stuff, which really threw me off course.
- cperciva 16y agoI immediately started thinking about seek times and elevator algorithms and that kind of stuff, which really threw me off course. Not necessarily off-course. If you have 32 GB of RAM and you don't mind an average latency of 10000000 ms, a single 1 TB disk works just fine,
- madaxe 16y agoBecause when you specify a disk, you realise he's guiding you in the direction of a specific answer. Use the filesystem. It's what it's there for, particularly if the data never changes. Nice big cache, xfs, nested hierarchical datastore using folders based on keynames, 20 lines of code, job done. 5000 lookups a second is trivial throughput for a decent disk with a decent readahead cache.
- defen 16y agoI don't know of any hard drives that can do a seek+read in 0.2 milliseconds. Keep in mind that the reads are distributed randomly - you're almost certainly going to need more than one disk if you have less than a terabyte of RAM for your datastore.