Click here to Skip to main content
15,909,030 members
Home / Discussions / C#
   

C#

 
GeneralRe: How would you store this data (interview question) Pin
BobJanova3-Feb-12 5:31
BobJanova3-Feb-12 5:31 
GeneralRe: How would you store this data (interview question) Pin
SledgeHammer013-Feb-12 5:45
SledgeHammer013-Feb-12 5:45 
GeneralRe: How would you store this data (interview question) Pin
BobJanova3-Feb-12 6:09
BobJanova3-Feb-12 6:09 
GeneralRe: How would you store this data (interview question) Pin
PIEBALDconsult3-Feb-12 12:52
mvePIEBALDconsult3-Feb-12 12:52 
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 
Such a vague scenario is pretty much impossible to answer, because how you'd go about it depends on where the data has patterns. For example, if IDs are allocated in blocks, use a range based structure. If it will always be very sparse, store only the 'hits'. If the search space is likely to be over 50% full, you might want to use an inverse (i.e. store the empties).

License plates are a clearly unrealistic scenario because the number you need to store will only be of the order of 100m at most and therefore you can just use a conventional database (even at 1kb per record you're still only talking 100GB which is within the capacity of a normal computer, never mind an institutional server).

9GB is not big enough to be a problem, as long as you don't hook it all into memory, so I'd just dump the whole bit array to a file, in sequence, and use seek to look in the right place (and poke a bit back when a plate is allocated), if a database was disallowed and there was no aggregation or querying requirement.

Edit: obviously, if I was writing this system for real, I'd just use a database, heh.
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 
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 

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.