[SalesForce] Please answer me some Interview question

I have some interview question anyone here please provide me answer to these questions.
1) Can a batch call from another batch class?
2) If there are 100 Account and 100 contact records as result. How to Process it in execute method?
3) Is batch class asynchronous or synchronous?
4) Is trigger asynchronous or synchronous?
5) Do salesforce support multitasking?
6) Is it possible to move profile, role using chain set?
7) Will eclipes download the deleted meta date?

Best Answer

1)Yes, a batch can be called from another batch. When you implement Batchable interface in a class, you implement three methods, start, execute and finish. You can call another batch from a batch by calling another batch in finish method of one batch. This way also saves you from the limit around number of batch jobs which will be running simultaneously for your org, since second batch will run after first batch has completed running.

3)Batch processing is asynchronous. These will be run when salesforce has avaialble resources.

4) Triggers run when DML operations are performed by user / apex data loader / external system. These should be synchronous in nature. Although we can call asynchronous methods(@future) from a trigger. So we can do both synchronous and async processing in triggers.

6) Roles can be moved using change sets. It is better to create Profiles manually again.

Related Topic