Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

Block Method String Appending

EasyPython00:00
Practice interviewer
In session
5 left
00:00

Your question is Block Method String Appending. Start with the requirements on the right.

Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.

You need to log in / sign up to run or submit.

Problem

In the Ameriprise mobile app, text fragments may need to be combined before they are displayed, such as joining a label with a user-provided value. Write a function that receives two strings and returns one string containing the first input immediately followed by the second.

Formal Specification

Implement append_strings(first, second).

  • Input: Two strings, first and second.
  • Output: A string formed by concatenating first and second in that order.
  • Do not insert spaces, punctuation, or other characters between the inputs.
  • Preserve capitalization, whitespace, punctuation, and repeated characters exactly.

Constraints

  • 0 <= len(first), len(second) <= 10^5
  • Inputs are valid Python strings, including Unicode characters
  • The output length is len(first) + len(second)

Function Signature

def append_strings(first, second):
Your solutionPython 3
You need to log in / sign up to run or submit.
Run your code to see test output