FastPrepCount Records Present in A but Not B
Problems/Count Records Present in A but Not B

Count Records Present in A but Not B

Capital One logoCapital One● EasyFULLTIMEPHONE SCREEN

Updated Nov 2026

QuestionConstraints

Problem statement

Source note: The interview report asks for the number of records found in one dataset but not another. We chose the table names, unique integer identifiers that are never null, the name of the result column, and how to handle edge cases. Our version is about 82% the same as the reported question.

The records_a and records_b tables each contain one row per unique record identifier.

Return one row containing the number of identifiers that appear in records_a but do not appear in records_b. Name the output column record_count.

TableColumnDescription
records_arecord_idIdentifiers in the first dataset.
records_brecord_idIdentifiers in the second dataset.

Table schema

MySQLPostgreSQLPandas

Use the same input data with any supported language. Open the Schema tab in the editor to see the generated SQL setup or Pandas DataFrames.

records_a

One row per unique identifier in the first dataset.

ColumnTypeNullableDescription
record_idPKIntegerNoA record identifier in the first dataset.

records_b

One row per unique identifier in the second dataset.

ColumnTypeNullableDescription
record_idPKIntegerNoA record identifier in the second dataset.

Expected result

Your query or function must return these columns.

ColumnTypeNullableDescription
record_countIntegerNoThe number of identifiers in records_a that are absent from records_b.

Row order: must match exactly. Numeric tolerance: 0.

Constraints

  • Each table contains between 0 and 100000 rows.
  • Every record_id is a non-null integer.
  • Each record_id is unique within its table.
  • The result always contains exactly one row, including when the count is 0.

More Capital One interview questions

  • LRU CachePHONE SCREEN · ONSITE INTERVIEW · Seen May 2026
  • Maximum Subarray SumPHONE SCREEN · ONSITE INTERVIEW · Seen Aug 2025
  • Ten-Pin Bowling Frame ScoresPHONE SCREEN · Seen Nov 2023
  • Min StackPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2023
  • Invert a Binary TreePHONE SCREEN · Seen Dec 2020
  • Count How Often a Word Appears in a ParagraphPHONE SCREEN
  • In-Memory File System With Directory SizesPHONE SCREEN · ONSITE INTERVIEW
  • Pick the K Nearest Grid Points to (0, 0)PHONE SCREEN · ONSITE INTERVIEW
  • The Nth Number in the Fibonacci SequencePHONE SCREEN · ONSITE INTERVIEW
  • Count Pairs of Overlapping SquaresOA · Seen Nov 2026

Similar questions at other companies

  • Second Highest SalaryPaytm · PHONE SCREENPaytm interview questions
  • Employees Who Earn More Than Their ManagersNykaa · PHONE SCREENNykaa interview questions
  • Employees Who Joined More Than a Week AgoNewgen Software · PHONE SCREEN
  • Departments Without EmployeesDell Technologies · PHONE SCREENDell Technologies interview questions
  • Second-Highest Distinct SalaryChubb · PHONE SCREENChubb interview questions
  • Swap Two Gender ValuesInfosys · PHONE SCREENInfosys interview questions
  • Find Rows Common to Two TablesSalesforce · PHONE SCREENSalesforce interview questions
  • Customer Order Count Distribution by CountryApple · PHONE SCREENApple interview questions
  • Employees Earning More Than Their ManagerMygate · PHONE SCREENMygate interview questions
  • Classify Tree Nodes with SQLOracle · PHONE SCREENOracle interview questions

Capital One interview experiences

  • Capital One Coding OA Questions: 3 Experiences
  • Capital One Experienced Engineer Power Day and OA: 6 Experiences
  • Capital One New Grad OA Questions: 14 Experiences (Part 2 of 2)
  • Capital One TDP Agentic Round (AI Coding): 7 Experiences
  • Capital One SWE Power Day, Level Not Reported: 6 Experiences
  • Capital One TIP Intern OA and Power Day: 13 Experiences
All Capital One interview questionsSee Capital One hiring insights