Dataford
Popular roles
Software EngineerData AnalystData ScientistData EngineerBusiness AnalystAI EngineerMachine Learning EngineerProduct Manager
Browse
Browse All RolesEvery role hub, from analyst to MLBrowse All CompaniesCompany-specific interview loopsAll Interview GuidesThe full guide library
Top questions by role
Software EngineerData AnalystData ScientistData EngineerBusiness AnalystAI EngineerMachine Learning EngineerProduct Manager
Top questions by skill
SQLPythonStatisticsMachine LearningA/B TestingSystem DesignGenerative AIProduct SenseMetricsBehavioral
Browse all questions →Try a mock interview
ExperiencesCoaching
New
Practice
Mock InterviewsTimed interview simulations with feedbackSuccess PathYour 6-week structured planModulesCurated lessons by topicWebinarsTalks from ex-Big Tech data leadsPlaygroundA free-form scratch editor
Learn
BlogInterview strategy and career adviceTech Job Market ReportHiring trends across data and AI rolesFor UniversitiesDataford for career centersAbout DatafordWho we are and how we build
Pricing
Get started
Implement Task CRUD API Routes
00:00
5 left

Implement Task CRUD API Routes

HardPython

Problem

Build a REST API web application with a fully functional front end and back end; submit within 3 days via a public GitHub repo.

Asked in the Pre-screen take-home (2021) stage. Called "Full stack candidate testing" assignment; given to backend applicant before any recruiter call.

For grading, implement build_rest_api_application(requests). The input is an array of request maps, processed in order. Each request has method, path, and an optional body map. Return an array of response maps with status and body. Support GET /api/tasks, POST /api/tasks with a non-empty title, and 404 responses for unsupported routes. Task identifiers start at 1 and increase sequentially.

Constraints

  • 0 <= requests.length <= 1000
  • Each request has a string method and path
  • A request body is either absent or a map
  • A task title must be a non-empty string
  • Task identifiers start at 1 and increase by 1 for successful creations

Function Signature

def build_rest_api_application(requests):
Interviewer

Whenever you're ready, walk me through your approach or go straight to the code. The requirements are in the Question tab.

You need to log in / sign up to run or submit.
Code
Sign up free to run your codeLog inLn 2
Run your code to see test output here.