PracHub
QuestionsPremiumCoachesLearningGuidesInterview 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

  • Compare arrays, linked lists, hash tables, trees - NVIDIA (easy)
  • Design a top-build target tracker - NVIDIA (medium)
  • Explain Amdahl’s law and GPU matmul optimization - NVIDIA (medium)
  • Explain container image flow in CI/CD - NVIDIA (medium)
  • Explain virtual machines and concurrency basics - NVIDIA (medium)
NVIDIA logo
NVIDIA
Feb 6, 2026, 12:00 AM
Software Engineer
Technical Screen
Software Engineering Fundamentals
3
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.

Solution

Show

Submit Your Answer to Earn 20XP

Sign in to leave a comment

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
PracHub

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

Product

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

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL 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.