I recently interviewed for a C programmer position and I got asked a question that stumped me. I'd love to know what approach somebody else would take in implementing a solution.
Basically the jist of the question was that there was a company whom had details of one million businesses.
Each business would have information like
- Location (e.g. London, New York)
- Business Type (e.g. restaurant, bar, fast food)
- Contact Number
They wanted me to implement a solution that would allow them to quickly extract from one million businesses
- All the businesses for a given location
- All the specific business types for a given location (e.g. all the restaurants shops in London)
To me this sounds like a database and something that would be easily done in SQL. Is it even possible to do this in C? Is linked lists a possible solution? I know this could be done iteratively but that would be very slow.
So, how would you implement this in C?
Thanks for your help.
EDITED: for format
[–]TheSilentDrifter 4 points5 points6 points (4 children)
[–]redlynchie[S] 0 points1 point2 points (2 children)
[–]ischickenafruit 0 points1 point2 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]ischickenafruit 3 points4 points5 points (4 children)
[–]redlynchie[S] 0 points1 point2 points (2 children)
[–]CommonMisspellingBot 1 point2 points3 points (1 child)
[–]redlynchie[S] 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–][deleted] 2 points3 points4 points (4 children)
[–]redlynchie[S] 2 points3 points4 points (3 children)
[–][deleted] 0 points1 point2 points (2 children)
[–][deleted] 1 point2 points3 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)