FastPrepBuild Cyclic String Endpoint Pairs
Problems/Build Cyclic String Endpoint Pairs

Build Cyclic String Endpoint Pairs

ZipRecruiter logoZipRecruiter● EasyNEW GRADOA

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Two ZipRecruiter new-grad OA reports describe cyclic order. The direct example [abc,def,ghi] and the explicit operation give the current first plus the next last. A later worked vector instead uses the next first, which does not fit that operation, so our version follows the stronger direct rule. We supplied non-empty inputs and a function signature.

Given a nonempty array of nonempty strings treated cyclically, output at index i is the first character of values[i] followed by the last character of values[(i + 1) mod n].

Function

cyclicEndpointPairs(values: String[]) → String[]

Examples

Example 1

values = ["abc","def","ghi"]return = ["af","di","gc"]

Each current first character pairs with the next cyclic last character.

Example 2

values = ["cat","dog","bee"]return = ["cg","de","bt"]

The pairs use c with g, d with e, and b with the wrapped t.

Constraints

  • 1 <= values.length <= 100000
  • Every string is nonempty.

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

  • Count User Mentions in Chat MessagesRamp · OARamp interview questions
  • Find Words That Can Be Formed by CharactersTabaPay · OA
  • Word Frequency Counts in Alphabetical OrderAbridge · OAAbridge interview questions
  • Count Multiples of Three with Two SevensHudson River Trading · OAHudson River Trading interview questions
  • Customer Signer ScreeningState Farm · OA
  • REST API: Highest International StudentsRippling · OARippling interview questions
  • String-Pair Frequency SimilarityIBM · OAIBM interview questions
  • Find Sliding-Window Pattern Start IndicesVisa · OAVisa interview questions
  • Closest ColorTwo Sigma · OATwo Sigma interview questions
  • Number-Character Bijective MappingAdobe · 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[] cyclicEndpointPairs(String[] values) {
        // Write your code here.
    }

}
Checking account…