InterviewLegend

Arrays, Strings & Hashing

Alex Chen22 min read169 real interview reports

Open a phone screen at X and the first problem is rarely exotic. You get an array to transform, a string to scan, a small structure to fold together, the kind of thing you could sketch on a napkin. What the screen is watching is whether the code you type runs on the first try, holds up on the empty input and the single element, and reads like something you would ship. This band is the warm-up and the phone-screen spine, and it is where a surprising number of loops quietly end.

There are two versions of this screen, and they want the same thing. The legacy Twitter loop was a clean medium bank that opened with array and string work before it moved on. The xAI-run loop that came after keeps these as the warm-up in front of its harder rounds, then grades the code more strictly: it should compile, handle the corners, and read like production. Reports vary on the exact round order. The through-line does not. Clean beats clever here, every time.

The X angle
X grades whether the code runs and survives its edges before it grades the Big-O. The algorithms in this band are short, so the signal is everything around them. Get a correct version on the screen and run it against the examples. Then say which corners you are about to check: the empty input, the single element, the value that repeats, the zero sitting in the middle of the array. Walking those out loud before the interviewer prompts you is the habit that most separates a pass from a miss on this loop. The optimization talk comes after there is something correct to speed up.
What's inside
  • 3 problems, worked step by step
  • about 22 min

Premium lessonX (Twitter) interview guide

These took digging.

What candidates walked out with, from 20,000+ reports, forum threads behind logins and write-ups in Chinese. Then solved step by step.

100 companies. Checked every month.

Unlock all 100 companies

$49 a year · less than $1 a week · Cancel anytime

Had your X (Twitter) interview?Tell us what they asked. Reviewed before it goes in, never with your name.
X (Twitter) interview guide

Know what X (Twitter) asks before you walk in.

19 coding · 5 system design · 20 behavioral questions

Get Premium$49 a year · Cancel anytime
Or start freeNo card.

Get their questions first.

InterviewLegend is independent and not affiliated with or endorsed by any company it covers.