This is a verified interview question from Salesforce. Candidates reporting seeing this problem in recent Online Assessments (OAs) and onsite rounds. Mastering "Flag Suspicious API Requests - Salesforce Online Assessment TIET" covers key patterns like Strings.
"# Flag Suspicious API Requests An API request consists of four dot-separated fields. You are given: - `restrictedPatterns[]` - `apiRequests[]` Each restricted pattern may contain the wildcard character `*`. The wildcard matches any sequence of characters within a single field. For every API request, determine whether it matches at least one restricted pattern. Return an array where: - `1` indicates the request is flagged. - `0` indicates the request is not flagged. ## Function Signature ```cpp vector<int> flagSuspiciousAPIRequests( vector<string> restrictedPatterns, vector<string> apiRequests ); ``` ### Parameters - `restrictedPatterns`: List of wildcard patterns. - `apiRequests`: API requests to evaluate. ### Returns Return an integer array containing 0s and 1s."
Join thousands of developers practicing for Salesforce.