Question: Is giving zakat in secret better than giving it openly? Is giving it openly considered ostentation (riya)?
Giving zakat, which is fard, openly is not considered ostentation but brings much more thawab. Giving zakat openly saves one from others’ blaming one for not paying out zakat, and one, by doing so, sets an example for others. Hadrat Ibn Abbas said that giving voluntary sadaqah in secret is 70 times more rewarding (thawab) than giving it publicly. However, giving zakat publicly is 25 times more rewarding than giving it in secret.
Hadrat Imam-i Rabbani says:
Giving a little zakat brings much more thawab than giving sadaqah worth millions because giving zakat is to do the commandment of Allahu ta’ala. Generally, sadaqah and other charitable acts are performed to earn reputation and respect or to do the desires of the nafs. Ostentation and outward show do not become involved in the performance of obligatory acts of worship. In the performance of voluntary acts of worship, however, ostentation usually arises. For this reason, it is necessary to give zakat publicly. (Vol.2, Letter 82)
Question: If a rich person puts his zakat on a table and if a poor person takes it thinking that it was put there for him as zakat, is zakat valid?
If a rich person puts his zakat on a table and if a poor person takes it, zakat will not be valid. The rich person must see the poor one taking it. The case is the same with putting zakat in a poor person's home without him seeing it.