Ad
  • Custom User Avatar

    Hello, quick question about one of the hard coded test examples.

    DB[:campaign_sends].multi_insert([

    current send - baseline

    { user_id: 1, sent_at: '2023-01-08 08:00:00', campaign_id: 'new_year', channel: 'email' },

    exactly 7 days ago --> should count as prior touch

    { user_id: 1, sent_at: '2023-01-01 08:00:00', campaign_id: 'new_year', channel: 'sms' },

    7 days + 1 second after (2023-01-01 08:00:01) --> too late, outside the window

    { user_id: 1, sent_at: '2023-01-01 08:00:01', campaign_id: 'new_year', channel: 'push' },

    same moment as current send --> does not count as prior

    { user_id: 1, sent_at: '2023-01-08 08:00:00', campaign_id: 'new_year', channel: 'sms' },

    valid message 1 hour before --> valid prior

    { user_id: 1, sent_at: '2023-01-08 07:00:00', campaign_id: 'new_year', channel: 'push' }
    ])

    In the "Check Windows" section of the tests your third row example { user_id: 1, sent_at: '2023-01-01 08:00:01', campaign_id: 'new_year', channel: 'push' }, says above it "7 days + 1 second after" and that it shouldn't be counted as a prior but isn't '2023-01-01 08:00:01' actually 6 days, 23 hours, 59 minutes and 59 seconds before the baseline which is '2023-01-08 08:00:00'?

  • Custom User Avatar

    description says

    Order the result by conversions_attributed desc. If two or more channels have the same total, order them alphabetically by channel.
    

    but in the tests expected output for a random test seem to be sorted just by channel:

    email	2.83
    sms	17.33
    push	13.83
    

    it's hard to figure out from description whether there could be several 'converted' events for the same user

    description says

     Ignore the conversion event itself — we only care about the touches that led up to it.
    

    but it is not clear for me do you mean data in campaign_sends or in engagement_events or both, as that rows could have different timestamps in different fields

  • Custom User Avatar

    The description for what constitutes a GROUP_OTHERS username is unclear. Specification should say "followed by 1 or more digits and no non-digit characters" instead of "followed only by digits", as one could argue that the username User is followed only by digits, even though it's 0 of them.

  • Custom User Avatar

    The specification doesn't say which way the cycles should go. If they were reversed, that would also be a correct solution, yet probably failing the tests.

  • Custom User Avatar

    What @Dmitry-k42 described is actually an issue. Category names are used in the tests not only for tie breaking at the last (5th) places, but also for ordering the otherwise tied rows in the result. See my solution. The description (updated after @Volie's issue) requires the "name" in the inner ORDER BY clause, but not the outer. Yet, the order of such rows is arbitrary without it, which may fail your tests.

  • Custom User Avatar

    The description of kata is ambiguous - it says: "return a list of users and their pet names, but only for users who have at least one pet whose name starts with the letter 'M'." It doesn't say that we should exclude all pet names which doesn't start with 'M'. According to description we should return all users and all their pet names in case if at least one pet name starts with 'M' for a giver user.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    list should be sorted by the quantity of rentals from higher to lower and if number of rentals is the same - then by last name of a customer

    In the random tests, it is possible for two persosn to be tied by number of rentals AND by last name. The bug can be easily replicated by adding random() as a third sorting criterion (which normally should not change the results if the first two criteria were enough).

  • Custom User Avatar

    the link to the DVD rental database in the description is dead. postgresqltutorial.com now redirects to neon.tech which is a commercial website, though you can still download the DB for free from there

  • Custom User Avatar

    the link to the DVD rental database in the description is dead. postgresqltutorial.com now redirects to neon.tech which is a commercial website, though you can still download the DB for free from there

  • Custom User Avatar

    The instructions say that 'call_hour' should be an int but the tests fail as they want the 'call_hour' to be a float.

  • Custom User Avatar

    I can't complete as I'm getting this error: ./spec/query_spec.rb:169:in block in format_output': undefined method ljust' for nil:NilClass (NoMethodError)
    Any idea what is going on?

  • Custom User Avatar

    Expected values

    film_id	film_title	                            rental_count	    last_rental_date
    459	    Indiana Jones and the Last Crusade (R)    13	              December 12, 2024
    188	    Cinema Paradiso (G)	                   13	              December 01, 2024
    304	    The Shining (R)	                       13	              December 01, 2024
    295	    All About Eve (PG)	                    12	              November 11, 2024
    171	    The Kid (PG)	                          12	              December 12, 2024
    300	    The Great Dictator (PG)	               12	              December 09, 2024
    145	    The Help (PG-13)	                      12	              December 04, 2024
    

    2nd level sorting order is to be the rental date, so I think this should better be sorted be the actual dates, not the strings, otherwise Nov 11th will be shown as "later" than Dec 12th.

  • Custom User Avatar

    My solution is passing without accounting for leap years, and I think that is ok for a beginner level kata.
    If so, maybe you could change this date for the last sample test entry to 367?
    --> host_software.insert(host: 'backup_server_1', software_title: 'Title1', install_date: Date.today - 366)

  • Custom User Avatar

    You could add to the description that "percentage of orders" only refers to the count of processed orders here, not to the combined total orders.

  • Loading more items...