How long would SMS messages get stored in the SMSC?
Until they are delivered, canceled or expire.. the expiry time depends on carrier preferences.. often at little as 24 hours in Europe/Asia and as much as 7 days in the US. More mature SMS markets tend to use shorter expiry times as the longer the undelivered remains, the more untimely it becomes.
Do messages get stored only when they are not delivered (Receipent handphone is OFF)?
or they are stored even if they are deliveried successfully? How long will they be kept in the system ?
They are stored, then forwarded.. once delivered, they are usually removed from the SMSC storage.. there may be some off-line archival for historic access but this is very rare.
What kind of databases are used to store all these messages... Must be huge right ? or is it multiple databases ??
This varies.. some use well known relational DBs.. Oracle, MySQL etc.. but most large-scale SMSCs use propietary storage systems because relational databases cannot achieve the same performance as home-grown purpose built solutions.
For messages with validilty timestamp, which component is actauuly in charge of checking the time stamp for the messages?
The SMSC... there is no break-down of different components.. but the SMSC is what stores the message.. SMSC is what expires messages.
Have no setup detail that I can share on this topic
best of luck on the interview!