Asked in an interview:
I have 2 tables, one table has records like ID, Name, address
. id(pk)
is from 1 to 10000000.
Another table has records from 10000001 to 20000000.
I have to check if a particular ID is present in table 1 or table 2 and return corresponding result.
Because table size is big, have to think an optimized way to do this.
Few ideas on top of my mind.