Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

Add Two Strings and Return Result

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

Your question is Add Two Strings and Return Result. 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

Baryons Software Solutions needs a utility that combines two user-provided text values. Given two strings of any supported length, return one string containing the first value immediately followed by the second.

Formal Specification

Implement concat_strings(first, second), where first and second are Python strings. Return a Python string formed by appending second to first. Preserve character order, whitespace, punctuation, casing, and Unicode characters exactly. Do not add separators, trim characters, or modify either input.

Constraints

  • first and second are valid Python strings
  • Either input may be empty
  • The combined length fits in available memory
  • No separator should be inserted

Function Signature

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