This is a verified interview question from Salesforce. Candidates reporting seeing this problem in recent Online Assessments (OAs) and onsite rounds. Mastering "Salesforce Cloud Storage - Salesforce Online Assessment TIET" covers key patterns like Other.
"# Salesforce Cloud Storage A Salesforce organization maintains backups of datasets in external cloud storage with limited capacity. You are given: - `datasetSizes[]`: sizes of datasets. - `storageLimit`: total storage capacity. Choose any subset of datasets such that their total size does not exceed `storageLimit`. Return the maximum achievable total backup size. ## Function Signature ```cpp int maximizeBackupStorage(vector<int> datasetSizes, int storageLimit); ``` ### Parameters - `datasetSizes`: Sizes of datasets. - `storageLimit`: Maximum storage capacity. ### Returns Return the maximum backup size."
Join thousands of developers practicing for Salesforce.