Click here to Skip to main content
15,887,746 members
Home / Discussions / C#
   

C#

 
AnswerRe: How would you store this data (interview question) PinPopular
Eddy Vluggen2-Feb-12 8:43
professionalEddy Vluggen2-Feb-12 8:43 
GeneralRe: How would you store this data (interview question) Pin
SledgeHammer012-Feb-12 9:01
SledgeHammer012-Feb-12 9:01 
GeneralRe: How would you store this data (interview question) Pin
jschell2-Feb-12 9:10
jschell2-Feb-12 9:10 
NewsRe: How would you store this data (interview question) Pin
Eddy Vluggen2-Feb-12 10:08
professionalEddy Vluggen2-Feb-12 10:08 
GeneralRe: How would you store this data (interview question) Pin
SledgeHammer012-Feb-12 10:31
SledgeHammer012-Feb-12 10:31 
GeneralRe: How would you store this data (interview question) Pin
Mycroft Holmes2-Feb-12 13:53
professionalMycroft Holmes2-Feb-12 13:53 
GeneralRe: How would you store this data (interview question) Pin
Eddy Vluggen2-Feb-12 10:04
professionalEddy Vluggen2-Feb-12 10:04 
AnswerRe: How would you store this data (interview question) Pin
jschell2-Feb-12 9:07
jschell2-Feb-12 9:07 
SledgeHammer01 wrote:
so stuff like databases, etc. are irrelevant...Say you are working for the DMV


First thought - the requirements are broken, because of course a database is the solution.

Absolutely no one is going to just store the plate number. And of course no one would save the entire range.

So one is left with the silly task of creating a database from scratch.

Databases are based on indexes and pages. Presuming all they care about is the indexed plate number you just create a sparse b-tree index. First block in the file is the first letter followed by an page index (or zero for no use) to the next page and next letter. Each page in this structure has a fixed size with a pointer to the real record.

36 * 8 bytes

For optimization reasons you can increase node size to 2 characters, which is more likely to be reasonable with native storage device page size.


SledgeHammer01 wrote:
...because it didn't scale to handle the worst case or even beyond 200M ranges.


And *again* broken requirements. There are about 250 million vehicles in the United states. License plates are issued by state and other entities. So a valid bid for a system at the current time would never need to manage 200 million.
GeneralRe: How would you store this data (interview question) Pin
SledgeHammer012-Feb-12 9:10
SledgeHammer012-Feb-12 9:10 
GeneralMessage Removed Pin
2-Feb-12 9:24
professionalN_tro_P2-Feb-12 9:24 
GeneralRe: How would you store this data (interview question) Pin
Mycroft Holmes2-Feb-12 13:57
professionalMycroft Holmes2-Feb-12 13:57 
GeneralRe: How would you store this data (interview question) Pin
jschell3-Feb-12 10:34
jschell3-Feb-12 10:34 
GeneralRe: How would you store this data (interview question) Pin
jschell3-Feb-12 10:32
jschell3-Feb-12 10:32 
GeneralRe: How would you store this data (interview question) Pin
SledgeHammer013-Feb-12 11:25
SledgeHammer013-Feb-12 11:25 
GeneralRe: How would you store this data (interview question) Pin
jschell4-Feb-12 9:24
jschell4-Feb-12 9:24 
GeneralRe: How would you store this data (interview question) Pin
SledgeHammer014-Feb-12 9:47
SledgeHammer014-Feb-12 9:47 
GeneralRe: How would you store this data (interview question) Pin
jschell6-Feb-12 8:01
jschell6-Feb-12 8:01 
GeneralRe: How would you store this data (interview question) Pin
SledgeHammer016-Feb-12 8:18
SledgeHammer016-Feb-12 8:18 
GeneralRe: How would you store this data (interview question) Pin
jschell6-Feb-12 9:49
jschell6-Feb-12 9:49 
AnswerRe: How would you store this data (interview question) Pin
harold aptroot2-Feb-12 9:18
harold aptroot2-Feb-12 9:18 
GeneralRe: How would you store this data (interview question) Pin
SledgeHammer012-Feb-12 9:23
SledgeHammer012-Feb-12 9:23 
GeneralRe: How would you store this data (interview question) Pin
harold aptroot2-Feb-12 9:42
harold aptroot2-Feb-12 9:42 
GeneralRe: How would you store this data (interview question) Pin
SledgeHammer012-Feb-12 9:50
SledgeHammer012-Feb-12 9:50 
GeneralRe: How would you store this data (interview question) Pin
harold aptroot2-Feb-12 9:55
harold aptroot2-Feb-12 9:55 
AnswerRe: How would you store this data (interview question) Pin
PIEBALDconsult2-Feb-12 15:29
mvePIEBALDconsult2-Feb-12 15:29 

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.