URL Builder

Problem Overview

  • Build a full URL by combining a baseURL and endpoint, adding ?, and appending query parameters as key=value joined by &, with page (if present) placed last; otherwise keep the given order.
  • Inputs: baseURL (String), endpoint (String), params (list of key–value pairs). Output: a complete URL String.
  • Domain: constructing reliable web and API request URLs in real-world applications.
  • From TikTok interviews; a practical coding interview problem and common interview question.

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Input Variables
Execution Result: