Reported August 2024
TikTokstring

Build URLs

Reported by candidates from TikTok's online assessment. Pattern, common pitfall, and the honest play if you blank under the timer.

Get StealthCoderRuns invisibly during the live TikTok OA. Under 2s to a working solution.
Founder's read

TikTok's August 2024 OA included a URL-building question that looks deceptively simple until you hit edge cases. You're probably thinking string concatenation or basic formatting, but the real test is whether you handle malformed input, special characters, and protocol validation cleanly. This is a string manipulation problem dressed up as a systems question. If you blank on the approach, StealthCoder reads the exact constraints and feeds you the pattern in real time, so you stay unblocked.

Pattern and pitfall

URL building typically requires you to validate and normalize components (scheme, host, path, query, fragment), then assemble them in the correct order. The trick is handling inconsistent input: missing slashes, double slashes, query parameters with or without the leading question mark, and encoded vs. raw characters. Most candidates hardcode the first solution and fail hidden test cases. The pattern is really string manipulation with careful state tracking. StealthCoder acts as your safety net if you freeze on the full rule set during the live OA, catching the edge cases you'd otherwise miss under time pressure.

Memorize the pattern. If you can't, run StealthCoder. The proctor sees the IDE. They don't see what's behind it.

If this hits your live OA

You can drill Build URLs cold, or you can hedge it. StealthCoder runs invisibly during screen share and surfaces a working solution in under 2 seconds. The proctor sees the IDE. They don't see what's behind it. Made by an engineer who treats the OA as theater. If yours is tonight, you don't have time to grind. You have time to hedge.

Get StealthCoder

Related leaked OAs

⏵ The honest play

You've seen the question. Make sure you actually pass TikTok's OA.

TikTok reuses patterns across OAs. Made by an engineer who treats the OA as theater. If yours is tonight, you don't have time to grind. You have time to hedge. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Build URLs FAQ

Is this a regex problem or simple string ops?+

Likely string ops with careful indexing and character checks. Regex can work but is slower and brittle for URL validation. Build the URL by validating and concatenating components sequentially. Avoid regex unless the problem explicitly requires pattern matching.

What are the most common failure modes?+

Not normalizing slashes (double slashes, missing slashes between segments). Ignoring query parameter syntax (? vs &). Not handling empty or null components. Not validating the scheme. Test all combinations of present/missing parts.

Should I worry about URL encoding?+

Only if the problem explicitly mentions it. Most URL-building OAs expect you to handle raw strings or mention encoding in the spec. Read the constraints carefully. If they say 'encode', use your language's built-in URL encoder. Don't roll your own.

How much time should I spend on this in the real OA?+

15-20 minutes max for a first pass. Identify the components (scheme, host, path, query, fragment), write validation logic for each, then assemble. Leave 5 minutes for edge case testing. Don't overthink protocol handling unless the problem says to.

Is this problem still being asked at TikTok?+

String manipulation and URL handling show up across backend and infrastructure roles. The pattern is stable and practical. Expect it on systems-adjacent OAs or backend assessments. Focus on clean parsing and error handling, not obscure RFC details.

Problem reported by candidates from a real Online Assessment. Sourced from a publicly-available candidate-aggregated repository. Not affiliated with TikTok.

OA at TikTok?
Invisible during screen share
Get it