Stackpath Interview Questions

Stackpath Interview Guides

Click or hover over a slice to explore questions for that topic.
Data Structures & Algorithms
(7)
Behavioral
(2)
Analytics
(2)
SQL
(2)
Machine Learning
(2)

Stackpath Interview Questions

Practice for the Stackpath interview with these recently asked interview questions.

QuestionTopicDifficulty
Data Structures & Algorithms
Medium

You’re given two dataframes. One contains information about addresses and the other contains relationships between various cities and states:

Example:

df_addresses

address
4860 Sunset Boulevard, San Francisco, 94105
3055 Paradise Lane, Salt Lake City, 84103
682 Main Street, Detroit, 48204
9001 Cascade Road, Kansas City, 64102
5853 Leon Street, Tampa, 33605

df_cities

city state
Salt Lake City Utah
Kansas City Missouri
Detroit Michigan
Tampa Florida
San Francisco California

Write a function complete_address to create a single dataframe with complete addresses in the format of street, city, state, zip code.

Input:

import pandas as pd

addresses = {"address": ["4860 Sunset Boulevard, San Francisco, 94105", "3055 Paradise Lane, Salt Lake City, 84103", "682 Main Street, Detroit, 48204", "9001 Cascade Road, Kansas City, 64102", "5853 Leon Street, Tampa, 33605"]}

cities = {"city": ["Salt Lake City", "Kansas City", "Detroit", "Tampa", "San Francisco"], "state": ["Utah", "Missouri", "Michigan", "Florida", "California"]}

df_addresses = pd.DataFrame(addresses)
df_cities = pd.DataFrame(cities)

Output:

def complete_address(df_addresses,df_cities) ->
address
4860 Sunset Boulevard, San Francisco, California, 94105
3055 Paradise Lane, Salt Lake City, Utah, 84103
682 Main Street, Detroit, Michigan, 48204
9001 Cascade Road, Kansas City, Missouri, 64102
5853 Leon Street, Tampa, Florida, 33605
Data Structures & Algorithms
Medium
Data Structures & Algorithms
Easy
Loading pricing options

View all Stackpath questions

Challenge

Check your skills...
How prepared are you for working at Stackpath?

Discussion & Interview Experiences

?
There are no comments yet. Start the conversation by leaving a comment.

Discussion & Interview Experiences

There are no comments yet. Start the conversation by leaving a comment.

Jump to Discussion