6 kyu

Current Age Distribution of Employees

Description
Loading description...
SQL
Databases
  • Please sign in or sign up to leave a comment.
  • PatrykJagielski88 Avatar

    Hi! I believe that there might be an error in the 'Edge Test Case'. The only employee present in that data set is above 40 (born Aug. 2/1983) but the solution seems to require the employee to be between 26 and 40. Could you please look into this?

    • bornForThis Avatar

      Hi! I clearly mentioned it in the description, "Ensure the age ranges include the entire span (e.g., up to but not including 21 years for the 18-20 bracket)." And the test that you mentioned checks exactly it: that person who is 40.5 would be a part of -40 bracket

      Issue marked resolved by bornForThis 13 months ago
    • PatrykJagielski88 Avatar

      Thank you for the prompt response - the error was in my query not in tests!

  • Twilight_Sun Avatar

    here was a question but I found where I've misread the description =)

    nice trap

  • Voile Avatar

    Reference solution is wrong: it does not count employees by age 18-20, but rather 18 year 0 days <= age <= 20 years 0 days, which excludes all the age range in 20 years 0 days < age < 21 years 0 days.

    This only rarely occurs in test cases, so solutions with this difference can still pass the tests after a few submissions. See this

    • bornForThis Avatar

      thanks for pointing this out! not the first time that I fell in the trap of between operator :) Updated ref solution, tests and description.

      Issue marked resolved by bornForThis 16 months ago