I had to read a few times to figure out what “column-oriented” meant before figuring it out. May have not have been able to do it under pressure in an interview. If you’d said “ordered by column” I’d have understood much more quickly.
i.e. Be careful with your phrasing. That is a bias in itself.
I would assume column oriented would mean the data would be formatted something like:
R1C1,R2C1,R3C1
R1C2,R2C2,R3C2
So values that have the same column are clustered together. Whereas normally in a file values that have the same row are clustered together. This is what column-oriented usually means when you are referring to databases.
I guess this is not what the questioner meant because they referred to using cut | sort | head as a solution. Though, I don't understand why head would be at the end of either problems solution so maybe I'm missing something. head could be a useful way of peeling out the column you want in the column-oriented problem.
Me too, I thought a “column oriented” file was a file where the data for column #1 comes before #2; ie, structure of arrays rather than array of structures. “cut” doesn’t work with that afaik.
I’m not sure I’d ask for clarification here (as to me, this is what “column oriented” means), and probably fail the interview.
i.e. Be careful with your phrasing. That is a bias in itself.