@Venugopal B Thanks for reaching out. Please find the answers inline.
1) .What would happen to the existing users in Azure federated domain, would there be a clean up automatically done? ex, users synced are 20k, but users with attribute are just 3k.
VS : There are 2 level of filtering which you can do to achieve your Goal.
a) OU level filtering
: You can create a separate OU for all those 3k users which will have the Department attribute filled. And select only this OU for sync scope, this way these 3k users will still sync up but rest all will get deleted. And as suggested by Andy, you would need to use https://video2.skills-academy.com/en-us/azure/active-directory/hybrid/how-to-connect-sync-feature-prevent-accidental-deletes to be able to delete more objects than 500.
b) Attribute level filtering : You can create a new rule and specify that users with department attribute for eg "Sales" or "IT" should sync up but not anyone else.
This require a little more work as this needs to be carefully created and at the same time you will have to disable other sync rules which might be syncing the users.
This is also called Positive Filtering and you can read more about it here : https://video2.skills-academy.com/en-us/azure/active-directory/hybrid/how-to-connect-sync-
configure-filtering#positive-filtering-only-sync-these
If the suggested response helped you resolve your issue, please do not forget to accept the response as Answer and "Up-Vote" for the answer that helped you for benefit of the community.