Is there way to add components to a course programmatically ?
Well sure; how you'd do this would be very dependent on your requirements. If you could go into a bit more detail about that we might be able to help...
Basically , we have a question pool in database and we are trying to build an assessment by adding question components programmatically.
No, there isn't anything like adapt.getCourse.ById(id).getArticle(id).getBlock(id).addComponent()
If you just want to be able to add questions to the JSON then you just need to be able to output the JSON files that contain all the Adapt content.
If you want to be able to add questions whilst the course is running then that's a very different matter indeed, potentially quite complex.
I haven't done server-side programming in a while but I presume there's some way to get the server to respond with dynamically-created JSON files when the course loads. Could be a good solution?