Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
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 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
Build my plan
Python or R Analysis Libraries
00:00
5 left

Python or R Analysis Libraries

MediumSQL · PostgreSQL

Problem

What libraries do you commonly use for data analysis in Python or R?

Assume each row records one library mention from a respondent. Write a SQL query that identifies the most commonly reported libraries for Python and R, counting each respondent only once per library.

Output

  1. One row per language and library.
  2. Columns: language, library_name, and respondent_count.
  3. Include only Python and R records with a non-null library name.
  4. Order by respondent count descending, then language and library name ascending.

Schema

library_usage
ColumnTypeDescription
usage_idPKINTUnique library usage record identifier
respondent_idINTIdentifier for the respondent
languageVARCHAR(20)Programming language associated with the library
library_nameVARCHAR(100)Name of the data analysis library
Tableslibrary_usage
Interviewer

Your question is Python or R Analysis Libraries. Start with the requirements and the one table 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.
CodePostgreSQL
Sign up free to run your codeLog inLn 1
Run your query to see results here.