employer cover photo
employer logo
employer logo

Rackspace Technology

Is this your company?

Rackspace Technology Interview Question

Write a function to compact a string in place: A. strip whitespace from the string. B. remove duplicate characters if they are next to each other

Interview Answers

Anonymous

Sep 8, 2016

def main(): chars = "".join(sys.argv[1:]).replace(" ", "") print("".join([curr for curr, nxt in izip_longest(chars, chars[1:]) if curr != nxt]))

Anonymous

Jan 29, 2021

The key in these questions is to cover the fundamentals, and be ready for the back-and-forth with the interviewer. Might be worth doing a mock interview with one of the Rackspace or ex-Rackspace Software Developer II experts on Prepfully? They give real-world practice and guidance, which is pretty helpful. prepfully.com/practice-interviews