Answered by Shaykh Faraz Rabbani
Can a Muslim contribute to building something in life – e.g. a bridge – and receive reward as in sadaqa jariya, after they die, for every time a car etc passes over? This question is related to all the other ‘non-directly-religious’ (i.e. not teaching quran) developments that we do to benefit people, e.g. in computer science, civil engineering etc.
Walaikum assalam wa rahmatullah,
The Messenger of Allah (Allah bless him and give him peace) said,
“When a person dies, his works end, except for three: ongoing charity, knowledge that is benefited from, and a righteous child who prays for him.” [Muslim, Tirmidhi, and others]
This relates to anything good that is benefited from after a person’s lifetime.
The degree of the reward is according to the degree and ultimate significance of the benefit derived from their act of good or charity, and the intention behind it (i.e. to what degree was it for the sake of Allah).
And Allah alone gives success.
Wassalam,