Account is standard object and attachment is child object.
We need to create an Apex Trigger on Attachments to count the number of attachments on the object – let’s take Account – and store in number field “Number of attachments”.
Trigger is considering all the possible scenarios in this – after insert, after update, after delete, after undelete.
Upload your code in Github and provide the link of public repo in comment below, it will be reviewed based on availability and feedback will be shared.
P.S: Be honest, watch the clock to check your efficiency. Happy coding.