Dataford
Interview QuestionsInterview GuidesExperiencesCoaching
New
Pricing
Get started
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
Experiences
Practice
Mock InterviewsTimed interview simulations with feedbackCoaching1:1 coaching with people at your target companiesSuccess 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
Build my plan
Nested JSON Processing for Job Data
00:00
5 left

Nested JSON Processing for Job Data

HardPython

Problem

Phenom job postings can store skills at different nesting levels, including role details, screening sections, and structured skill objects. Implement a function that recursively finds every skill container and returns a normalized list of unique skill names.

Formal Specification

Given posting, a JSON-compatible Python value consisting of dictionaries, lists, strings, numbers, booleans, or None, return a list of skill-name strings.

A dictionary key is a skill container when, after lowercasing and replacing spaces or hyphens with underscores, it equals skills or required_skills. A skill container may contain strings, lists, or dictionaries. For a dictionary entry, use the first string value found under name, title, or label as the skill name. Otherwise, recursively inspect its values.

Normalize each extracted name by trimming leading and trailing whitespace and collapsing internal whitespace. Deduplicate names case-insensitively while preserving the spelling and order of their first occurrence. Ignore all strings outside skill containers. Return an empty list when no skills are present.

Constraints

  • posting contains at most 10^5 dictionaries and list elements
  • Nesting depth is at most 500
  • Skill names contain strings of at most 200 characters
  • Keys are strings and all values are JSON-compatible

Function Signature

def extract_job_skills(posting):
Interviewer

Your question is Nested JSON Processing for Job Data. Start with the requirements in the Question tab.

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.
CodePython 3
Sign up free to run your codeLog inLn 2
Run your code to see test output here.