Salesforce mobile engineer interviews focus on iOS or Android platform knowledge, memory management, offline-first architecture, and mobile-specific system design.
No verified questions yet for Salesforce.
class LRUCache:
def __init__(self, capacity: int):
def get(self, key: int) -> int:
def put(self, key: int, value: int) -> None: Example 1: LRUCache(2) followed by put(1, 1), put(2, 2), get(1), put(3, 3), get(2), put(4, 4), get(1), get(3), get(4) [-1, 1, -1, 3, 4] 1 <= capacity <= 3000. activity[]), your task is to calculate the number of unique user activities in the last k seconds at any point in time.Function Signature: def count_unique_activities(activity: List[int], k: int) -> List[int]:Example 1:
activity = [1, 2, 1, 3, 2, 3, 5], k = 3 [1, 2, 3, 3, 2, 2] activity = [1, 2, 3, 4, 5], k = 2 [1, 2, 3, 4, 5] k is small enough.Constraints: activity will be at most 10^5. 10^6. k will not exceed 10^5.Sign up for free to access walkthroughs, AI-generated questions, and more.
Get Started Free