← Questions

Merge two strings on their longest overlap

0
AppleCodingLast asked Sep 2026

A coding interview question asked in Apple's online assessment, last asked Sep 2026. It tests strings and prefix suffix.

Merge two strings so that an overlapping edge is written only once. For an ordered pair (a, b), the overlap is the longest k such that the last k characters of a equal the first k characters of b; the merge is a followed by b without its…

Sign in to unlock this question

The full prompt, the worked answer and your own canvas or code with the AI tutor. New accounts get 5 credits: each one unlocks a question for good.

Where it's asked

  • Apple · Online assessment · Last asked Sep 2026

What it tests

strings · prefix suffix

Your code and the AI tutor open when you unlock this question.