FastPrepSplit Text into Minimum Suffixed SMS Messages
Problems/Split Text into Minimum Suffixed SMS Messages

Split Text into Minimum Suffixed SMS Messages

ZipRecruiter logoZipRecruiter● HardNEW GRADOA

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: A ZipRecruiter new-grad OA image describes the minimum message count, all text in order, <x/y> suffixes counted in the limit, exact lengths for every message but the last, and empty output when it is impossible. We supplied non-empty message content and a function signature.

Split every text character in order into the minimum number y of messages. Message x ends with suffix <x/y>, which counts toward limit.

Every nonlast message must have total length exactly limit; the last may be shorter. Each message contains at least one text character. Return the first feasible split, or an empty array.

Function

splitSms(text: String, limit: int) → String[]

Examples

Example 1

text = "abcdefghij"limit = 7return = ["ab<1/5>","cd<2/5>","ef<3/5>","gh<4/5>","ij<5/5>"]

Five messages are the first total count with enough capacity.

Example 2

text = "abc"limit = 10return = ["abc<1/1>"]

One message fits.

Constraints

  • 1 <= text.length <= 10000
  • 1 <= limit <= 10000

More ZipRecruiter Online Assessment questions

  • Four-Level Banking System with Scheduled PaymentsOA · Seen Oct 2026
  • Count Three-Digit Numbers with Distinct DigitsOA · Seen Oct 2024
  • Longest Frequency-Bounded SubarrayOA · Seen Oct 2024
  • Minimum Changes to Draw a YOA · Seen Oct 2024
  • Apply Binary State OperationsOA · Seen Sep 2024
  • Simulate Orchard Rot SpreadOA · Seen Sep 2024
  • Compare Odd- and Even-Index SumsOA · Seen Sep 2024
  • Coordinate Removals with Column GravityOA · Seen Sep 2024
  • Lexicographically Smallest End ReversalOA · Seen Sep 2024
  • Recursively Expanded Shell Command CountsOA · Seen Sep 2024

Similar questions at other companies

  • Lexicographically Largest IdentifierAmazon · OA
  • Lexicographically Smallest Grid Path with One Letter ChangeInfosys · OAInfosys interview questions
  • Incident MonitorStripe · OAStripe interview questions
  • Balance a Chemical EquationMicrosoft · OAMicrosoft interview questions
  • Longest Repeated Letter Block with Adjacent SwapsIntuit · OAIntuit interview questions
  • Count Substrings Matching with One Adjacent SwapInMobi · OAInMobi interview questions
  • Binary CircuitAkuna Capital · OAAkuna Capital interview questions
  • String Formation (Also for AI/ML Software Engineer Intern :)Snowflake · OASnowflake interview questions
  • Binary Sorting Rounds After FlipsVisa · OAVisa interview questions
  • Minimum Numeric Code TransformationAdobe · OAAdobe interview questions

ZipRecruiter interview experiences

  • ZipRecruiter SWE OA, Level Not Reported: 23 Experiences
  • ZipRecruiter SWE Intern OA Scores: 4 Experiences
  • ZipRecruiter SWE New Grad OA: 9 Experiences
All ZipRecruiter interview questionsSee ZipRecruiter hiring insights
Saved
class Solution {
    public String[] splitSms(String text, int limit) {
        // Write your code here.
    }

}
Checking account…