Click here to Skip to main content
15,886,963 members
Home / Discussions / C#
   

C#

 
AnswerRe: Best method for putting a wait Pin
OriginalGriff2-Feb-12 21:18
mveOriginalGriff2-Feb-12 21:18 
GeneralRe: Best method for putting a wait Pin
Subin Mavunkal2-Feb-12 21:26
Subin Mavunkal2-Feb-12 21:26 
AnswerRe: Best method for putting a wait Pin
OriginalGriff2-Feb-12 21:40
mveOriginalGriff2-Feb-12 21:40 
AnswerRe: Best method for putting a wait Pin
BobJanova3-Feb-12 4:48
BobJanova3-Feb-12 4:48 
AnswerRe: Best method for putting a wait Pin
Eddy Vluggen3-Feb-12 6:22
professionalEddy Vluggen3-Feb-12 6:22 
QuestionPlay DVD and cut a Video in WPF Pin
Alessio Elia2-Feb-12 9:46
Alessio Elia2-Feb-12 9:46 
AnswerRe: Play DVD and cut a Video in WPF Pin
Dean Oliver3-Feb-12 6:52
Dean Oliver3-Feb-12 6:52 
QuestionHow would you store this data (interview question) Pin
SledgeHammer012-Feb-12 8:28
SledgeHammer012-Feb-12 8:28 
Now remember, this is an interview question Smile | :) , so stuff like databases, etc. are irrelevant... they were testing my data structure knowledge Smile | :) .

Say you are working for the DMV and need to write a function that checks available license plates. Valid #'s are 0000000 to ZZZZZZZ (no variable length plates). That means there will be 36^7 = 78B possible #'s. Storing that in a packed bit array would require 9GB, so thats out Smile | :) .

Thought about storing a linked list of ranges, but if the range struct is ~20 to 30 bytes, once you get above around ~200M ranges, the packed bit array starts to look better.

Oh yeah, you can not assume they are handing out #'s sequentially, so it is possible that you'll end up with every other # taken = 39B ranges * 30 bytes = like 1000GB or something like that haha.

Point was, they didn't like the linked list answer too much because it didn't scale to handle the worst case or even beyond 200M ranges.

I had heard of interval trees before, but didn't know if they would solve the scaling issue.
AnswerRe: How would you store this data (interview question) Pin
Luc Pattyn2-Feb-12 8:30
sitebuilderLuc Pattyn2-Feb-12 8:30 
GeneralRe: How would you store this data (interview question) Pin
SledgeHammer012-Feb-12 8:32
SledgeHammer012-Feb-12 8:32 
AnswerRe: How would you store this data (interview question) Pin
Luc Pattyn2-Feb-12 8:42
sitebuilderLuc Pattyn2-Feb-12 8:42 
GeneralRe: How would you store this data (interview question) Pin
SledgeHammer012-Feb-12 9:07
SledgeHammer012-Feb-12 9:07 
AnswerRe: How would you store this data (interview question) Pin
Luc Pattyn2-Feb-12 9:30
sitebuilderLuc Pattyn2-Feb-12 9:30 
GeneralRe: How would you store this data (interview question) Pin
SledgeHammer012-Feb-12 9:45
SledgeHammer012-Feb-12 9:45 
AnswerRe: How would you store this data (interview question) Pin
Luc Pattyn2-Feb-12 10:01
sitebuilderLuc Pattyn2-Feb-12 10:01 
GeneralRe: How would you store this data (interview question) Pin
SledgeHammer012-Feb-12 10:08
SledgeHammer012-Feb-12 10:08 
GeneralRe: How would you store this data (interview question) Pin
SledgeHammer012-Feb-12 10:22
SledgeHammer012-Feb-12 10:22 
AnswerRe: How would you store this data (interview question) Pin
Luc Pattyn2-Feb-12 10:33
sitebuilderLuc Pattyn2-Feb-12 10:33 
GeneralRe: How would you store this data (interview question) Pin
harold aptroot2-Feb-12 10:35
harold aptroot2-Feb-12 10:35 
AnswerRe: How would you store this data (interview question) Pin
Luc Pattyn2-Feb-12 10:51
sitebuilderLuc Pattyn2-Feb-12 10:51 
GeneralRe: How would you store this data (interview question) Pin
SledgeHammer012-Feb-12 11:45
SledgeHammer012-Feb-12 11:45 
GeneralRe: How would you store this data (interview question) Pin
SledgeHammer012-Feb-12 8:35
SledgeHammer012-Feb-12 8:35 
GeneralRe: How would you store this data (interview question) Pin
CCodeNewbie3-Feb-12 5:58
CCodeNewbie3-Feb-12 5:58 
QuestionRe: How would you store this data (interview question) Pin
Luc Pattyn3-Feb-12 6:01
sitebuilderLuc Pattyn3-Feb-12 6:01 
AnswerRe: How would you store this data (interview question) Pin
CCodeNewbie3-Feb-12 6:05
CCodeNewbie3-Feb-12 6:05 

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.