Click here to Skip to main content
16,020,622 members
Home / Discussions / C#
   

C#

 
GeneralRe: How would you store this data (interview question) Pin
SledgeHammer013-Feb-12 13:22
SledgeHammer013-Feb-12 13:22 
GeneralRe: How would you store this data (interview question) Pin
PIEBALDconsult3-Feb-12 4:18
mvePIEBALDconsult3-Feb-12 4:18 
GeneralRe: How would you store this data (interview question) Pin
SledgeHammer013-Feb-12 5:14
SledgeHammer013-Feb-12 5:14 
AnswerRe: How would you store this data (interview question) Pin
BobJanova3-Feb-12 4:42
BobJanova3-Feb-12 4:42 
AnswerRe: How would you store this data (interview question) Pin
BillWoodruff3-Feb-12 4:47
professionalBillWoodruff3-Feb-12 4:47 
GeneralRe: How would you store this data (interview question) Pin
SledgeHammer013-Feb-12 5:19
SledgeHammer013-Feb-12 5:19 
GeneralRe: How would you store this data (interview question) Pin
BillWoodruff3-Feb-12 5:59
professionalBillWoodruff3-Feb-12 5:59 
GeneralRe: How would you store this data (interview question) Pin
SledgeHammer013-Feb-12 7:06
SledgeHammer013-Feb-12 7:06 
BillWoodruff wrote:
I think the very simple reason for the focus on the "license plate" issue is:
that's what you told us the actual question was
.


That's my whole point. The question given was very specific. A senior / principle / lead software engineer who makes $120k to $150k / yr should not have to be told that he is allowed to generalize a problem or how to generalize it Smile | :) . I'm sorry if that comes out bad, its not intended as an attack on you or anybody else. Its just how they expect you to think. Think of the problem in generic terms and then, hey, maybe you can do something specific for this type of data that wouldn't work for other types of data, even in the same problem type.

BillWoodruff wrote:
To that (hypothetical) question, I would have replied: "what is the correlation
of adding an unused license number of a car from a set of all permutations, to
adding a new user, book review, to Amazon, or to adding a new link-listing to
Google: are you asking about the issue of generating unique identification
indexes in master databases (GUIDS, or some hash) ?"


Again, you are focusing on specifics Smile | :) . None of that matters to the hypothetical question. It's just "given this data and the vast amount of it, how would you store / work with it?". Thats just a question to see if you come back and say "I can't, its too hard", or "I can do it, but my algorithm requires 10TB of hard drive space and 5 days of processing per request". Maybe Amazon and Google don't issue license plates today, but they are planning to in the future? It doesn't really matter, that wasn't the point of the question.

One responder came back and said he would just store a flat list of used license plates. Ok. Awesome. Lets say 50B of the 78B plates were taken. Thats 50B x 6 bytes = 279GB. Unless you maintain the list in sorted order, your search time to check a plate # could be O ( n ). 279GB and worst case O ( n ) for only 64% of the data. Through discussion, we have already found a solution for O ( 1 ) for ALL operations and 9GB worst case storage requirements for 100% of the data and actually, you would only need to read/write a SINGLE BYTE out of the 9GB file so your memory requirements are 0. What's the better solution? Smile | :)

BillWoodruff wrote:
Note my assumption (which you have every right to be skeptical about) that: in
technical interviews, where you know the people interviewing you are "smart,"
and informed about what they are asking you about: that they respect someone who
responds to vague, overly-broad, questions, by pro-actively demanding they be
clarified: in the process of which you reveal your awareness of the issues and
factors that surround real-world implementations.


You are certainly allowed to ask questions. HOWEVER... are you a sr. / principle / lead software engineer in real life? I am, and I can tell you that if my boss came to me and asked me to implement feature X and I started asking him to clarify / solve the problem / lead me to water / etc. whatever you want to call it... he'd probably get annoyed and say "I'm paying you to solve the technical problems, thats your job, its not mine". That is actually true. As senior / lead software engineers, its our job to take a problem and make it work Smile | :) .

However, since you are skeptical about how Google interviews and probably think I made this whole scenario up Smile | :) ... I *DID* really have an interview there and one of the questions was "we have millions of servers in production running millions of queries & processes per second... lets say your piece was not working properly (memory leak was the exact scenario), how would you go about debugging it?"

Me: If I did not instantly know what the issue was, I would first try to reproduce it on my own 1 or 2 PC test environment
Him: Lets say it was not an issue that showed up on 1 or 2 PCs and you needed say 10,000 PCs to see the issue?
Me: I would put logging information in the suspect areas
Him: What would you log?
Me: memory allocations and deletions
Him: Ok, but remember, we are talking about 10,000 machines doing millions of allocations and deletions, do you really think you could make sense of a log file with billions of entries?
Me: good point (chuckle)
Me: Well, I've always been a big fan of what Microsoft did with MFC. They overloaded the new and delete operators and kept track of allocated memory in a linked list or whatever and when the process would exit dump out the list of leaked memory and its contents. That way it would solve the billion entry log file issue and you would only get a log file with the leaks and nothing else and your code wouldn't be cluttered with logging writes since it all happened automatically.
Him: Cool, that would work in theory, but remember, these are production servers and you are not allowed to deploy test code to production servers since a programming error could bring down the entire site.
Me < at this point, I started to get annoyed and headed down your road Smile | :) >... hmm... well, I'm assuming you have a smaller scale test lab or a procedure in place for testing scenarios like that?
Him: Yeah, we have a test lab with 1000 machines, but your leak or issue only shows up with 10,000+ machines
Me: And you don't have a procedure in place for testing large scale issues?
Him: Yeah, we do. Assume we don't and that you are responsible for coming up with one.

etc. and it went on and on like that.
GeneralRe: How would you store this data (interview question) Pin
BillWoodruff3-Feb-12 7:36
professionalBillWoodruff3-Feb-12 7:36 
GeneralRe: How would you store this data (interview question) Pin
SledgeHammer013-Feb-12 8:19
SledgeHammer013-Feb-12 8:19 
GeneralRe: How would you store this data (interview question) Pin
BillWoodruff3-Feb-12 13:33
professionalBillWoodruff3-Feb-12 13:33 
GeneralRe: How would you store this data (interview question) Pin
SledgeHammer013-Feb-12 13:53
SledgeHammer013-Feb-12 13:53 
Questionevents Pin
michaelgr12-Feb-12 8:08
michaelgr12-Feb-12 8:08 
AnswerRe: events Pin
SledgeHammer012-Feb-12 8:19
SledgeHammer012-Feb-12 8:19 
Generallots of license plates Pin
Luc Pattyn2-Feb-12 8:27
sitebuilderLuc Pattyn2-Feb-12 8:27 
GeneralRe: lots of license plates Pin
SledgeHammer012-Feb-12 8:30
SledgeHammer012-Feb-12 8:30 
AnswerRe: lots of license plates Pin
Luc Pattyn2-Feb-12 8:31
sitebuilderLuc Pattyn2-Feb-12 8:31 
GeneralRe: lots of license plates Pin
BillWoodruff3-Feb-12 5:02
professionalBillWoodruff3-Feb-12 5:02 
AnswerRe: events Pin
Luc Pattyn2-Feb-12 8:22
sitebuilderLuc Pattyn2-Feb-12 8:22 
AnswerRe: events Pin
Bernhard Hiller2-Feb-12 21:29
Bernhard Hiller2-Feb-12 21:29 
GeneralRe: events Pin
michaelgr13-Feb-12 23:18
michaelgr13-Feb-12 23:18 
GeneralRe: events Pin
BobJanova4-Feb-12 1:39
BobJanova4-Feb-12 1:39 
GeneralRe: events Pin
michaelgr14-Feb-12 2:32
michaelgr14-Feb-12 2:32 
QuestionBlind Watermarking With DWT Pin
fidelis jamboreoog2-Feb-12 5:58
fidelis jamboreoog2-Feb-12 5:58 
AnswerRe: Blind Watermarking With DWT Pin
Mycroft Holmes2-Feb-12 14:02
professionalMycroft Holmes2-Feb-12 14:02 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.