Persistent Systems Online Assessment | String Compression & Best Time to Buy and Sell Stock
Question · Posted Jun 2026
Problem 1 - Cloud Storage File Deduplication Pipeline Problem Statement You are building an optimization plugin for a high-speed cloud file upload dashboard. The system receives a string dataPayload. Your task is to compress consecutive groups of identical characters by replacing each group with the character followed by its frequency. If a character appears only once consecutively, append only the character without any count. For example: "aabbbc" becomes "a2b3c" "XYZ" remains "XYZ" Return the compressed string. Constraints Constraint 1 ≤ ...
The full answer & interview discussion are available to premium members.
Log in Create a free account