FastPrepAssign Student Grades from CSV Marks
Problems/Assign Student Grades from CSV Marks

Assign Student Grades from CSV Marks

Hartford Financial Services logoHartford Financial Services● EasyFULLTIMEONSITE INTERVIEW

Updated Nov 2026

QuestionConstraints

Problem statement

Source note: The report names CSV marks and assigning grades, but leaves out the columns and the grade cutoffs. This exercise supplies those, and gives you a parsed CSV table. Our version is about 70% the same as the reported question.

You receive student marks from a comma-separated CSV with header student_id,marks. Each record has one unique student ID and one integer mark.

The CSV has already been loaded into the students dataframe, using the schema shown. Implement assign_grades(students) to give every row a letter grade. Loading the CSV is only background. Your job is to add the grade column to the dataframe you are given.

Use these grade bands:

MarkGrade
90..100A
80..89B
70..79C
60..69D
0..59F

Return a dataframe with columns student_id, marks, and grade in that order. Retain every original ID and mark and preserve the CSV row order. Equal marks still belong to separate students. Do not average marks, sort or group students, or round marks.

A header-only CSV is valid and returns an empty dataframe with the same three result columns.

Table schema

Pandas

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.

students

Records parsed from CSV columns student_id,marks in their original row order.

ColumnTypeNullableDescription
student_idPKIntegerNoUnique student identifier; preserves the identity of each CSV row.
marksIntegerNoOne mark per student, from 0 through 100 inclusive.

Expected result

Your query or function must return these columns.

ColumnTypeNullableDescription
student_idIntegerNoUnique student identifier; preserves the identity of each CSV row.
marksIntegerNoOne mark per student, from 0 through 100 inclusive.
gradeTextNoA, B, C, D or F assigned by the displayed integer mark bands.

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

Constraints

  • The CSV has header student_id,marks and from 0 through 1000 data rows.
  • Student IDs are unique integers from 1 through 10^9.
  • Every mark is an integer from 0 through 100; neither field is null.
  • Each record already contains the single mark used for its grade; no subject aggregation or rounding is required.

More Hartford Financial Services interview questions

  • Maximum Product SubarrayONSITE INTERVIEW · Seen Sep 2026
  • Bubble SortONSITE INTERVIEW · Seen Mar 2019
  • Swap Adjacent Character PairsONSITE INTERVIEW · Seen Mar 2019
  • Second Highest SalaryONSITE INTERVIEW
  • Average Grades per StudentPHONE SCREEN · Seen Aug 2026

Similar questions at other companies

  • Nested Transaction Key-Value Store with Value CountsLyft · ONSITE INTERVIEWLyft interview questions
  • Track the Book and Mark Final PnLMillennium · OAMillennium interview questions
  • Parquet-Like Columnar Format OperationsJump Trading · PHONE SCREENJump Trading interview questions
  • In-Memory Database Historical LookupAnthropic · OAAnthropic interview questions
  • Process Airline Seat RequestsAgoda · OAAgoda interview questions
  • Christmas Tree with N TiersVerily · ONSITE INTERVIEW
  • Delete Duplicate Employee RecordsInfosys · ONSITE INTERVIEWInfosys interview questions
  • Ring Buffer OperationsAmazon · ONSITE INTERVIEW
  • Count Distinct Underwriting PII ValuesAffirm · PHONE SCREEN · ONSITE INTERVIEWAffirm interview questions
  • Records Created or Updated in a Time WindowPelatro · ONSITE INTERVIEW
All Hartford Financial Services interview questionsSee Hartford Financial Services hiring insights