PracHub
QuestionsLearningGuidesInterview Prep
|Home/Software Engineering Fundamentals/NVIDIA

Write SQL to sum city population by name

Last updated: Mar 29, 2026

Quick Overview

Assesses SQL proficiency in relational joins and aggregation by asking for a total population computed from ZIP-level data and evaluates reasoning about duplicate entity names.

  • easy
  • NVIDIA
  • Software Engineering Fundamentals
  • Software Engineer

Write SQL to sum city population by name

Company: NVIDIA

Role: Software Engineer

Category: Software Engineering Fundamentals

Difficulty: easy

Interview Round: Technical Screen

You have four relational tables: - country(country_id, name) - state(state_id, country_id, name) - city(city_id, state_id, name) - zip(zip_code, city_id, population) Task A: Given a city name (e.g., :city_name), write SQL to return the total population for that city, where population is stored in the zip table (sum across all ZIP codes belonging to the city). Clarify how you would handle the case where multiple cities share the same name in different states/countries.

Quick Answer: Assesses SQL proficiency in relational joins and aggregation by asking for a total population computed from ZIP-level data and evaluates reasoning about duplicate entity names.

Related Interview Questions

  • Design a Multi-Producer Multi-Consumer Circular Buffer - NVIDIA (hard)
  • Reason About Endianness, Ring Buffers, and Stack Behavior in Firmware - NVIDIA (medium)
  • Data Pipeline Reliability, Backfills, and Spark Optimization - NVIDIA (medium)
  • Compare arrays, linked lists, hash tables, trees - NVIDIA (easy)
|Home/Software Engineering Fundamentals/NVIDIA

Write SQL to sum city population by name

NVIDIA logo
NVIDIA
Feb 6, 2026, 12:00 AM
easySoftware EngineerTechnical ScreenSoftware Engineering Fundamentals
7
0

You have four relational tables:

  • country(country_id, name)
  • state(state_id, country_id, name)
  • city(city_id, state_id, name)
  • zip(zip_code, city_id, population)

Task A: Given a city name (e.g., :city_name), write SQL to return the total population for that city, where population is stored in the zip table (sum across all ZIP codes belonging to the city).

Clarify how you would handle the case where multiple cities share the same name in different states/countries.

Loading comments...

Browse More Questions

More Software Engineering Fundamentals•More NVIDIA•More Software Engineer•NVIDIA Software Engineer•NVIDIA Software Engineering Fundamentals•Software Engineer Software Engineering Fundamentals

Write your answer

Your first approved answer each day earns 20 XP.

Sign in to write your answer.
PracHub

Master your tech interviews with 9,000+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • AI Coding Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.