用这种难度的题目面试程序员,给多少时间合适?

lihongming:Julia conducted a 15 days of learning SQL contest. The start date of the contest was March 01, 2016 and the end date was March 15, 2016.

Write a query to print total number of unique hackers who made at least submission each day (starting on the first day of the contest), and find the hacker_id and name of the hacker who made maximum number of submissions each day. If more than one such hacker has a maximum number of submissions, print the lowest hacker_id. The query should print this information for each day of the contest, sorted by the date.


Input Format

The following tables hold contest data:

  • Hackers: The hacker_id is the id of the hacker, and name is the name of the hacker.

    用这种难度的题目面试程序员,给多少时间合适?

  • Submissions: The submission_date is the date of the submission, submission_id is the id of the submission, hacker_id is the id of the hacker who made the submission, and score is the score of the submission.

    用这种难度的题目面试程序员,给多少时间合适?


Sample Input

For the following sample input, assume that the end date of the contest was March 06, 2016.

  • Hackers table

    用这种难度的题目面试程序员,给多少时间合适?

  • Submissions table

    用这种难度的题目面试程序员,给多少时间合适?


Sample Output

2016-03-01 4 20703 Angela
2016-03-02 2 79722 Michael
2016-03-03 2 20703 Angela
2016-03-04 2 20703 Angela
2016-03-05 1 36396 Frank
2016-03-06 1 20703 Angela

Explanation

On March 01, 2016 hackers 20703, 36396, 53473 and 79722 made submissions. There are 4 unique hackers who made at least one submission each day. As each hacker made one submission, 20703 is considered to be the hacker who made maximum number of submissions on this day. The name of the hacker is Angela.

On March 02, 2016 hackers 15758, 20703 and 79722 made submissions. Now 20703 and 79722 were the only ones to submit every day, so there are 2 unique hackers who made at least one submission each day. 79722 made 2 submissions, and name of the hacker is Michael.

On March 03, 2016 hackers 20703, 36396 and 79722 made submissions. Now 20703 and 79722 were the only ones, so there are 2 unique hackers who made at least one submission each day. As each hacker made one submission so 20703 is considered to be the hacker who made maximum number of submissions on this day. The name of the hacker is Angela.

On March 04, 2016 hackers 20703, 44065, 53473 and 79722 made submissions. Now 20703 and 79722 only submitted each day, so there are 2 unique hackers who made at least one submission each day. As each hacker made one submission so 20703 is considered to be the hacker who made maximum number of submissions on this day. The name of the hacker is Angela.

On March 05, 2016 hackers 20703, 36396, 38289 and 62529 made submissions. Now 20703 only submitted each day, so there is only 1 unique hacker who made at least one submission each day. 36396 made 2 submissions and name of the hacker is Frank.

On March 06, 2016 only 20703 made submission, so there is only 1 unique hacker who made at least one submission each day. 20703 made 1 submission and name of the hacker is Angela.

lihongming:奇了个怪了,table 为何不能正确解析?

msg7086:面程序员还是面数据相关岗位?

lihongming:@msg7086 程序员,除了这个还有算法题,时间另计

Wordpress the_permalink性能与将值存储在变量中 - php

制作新主题和创建具有链接到所述文章的多个对象的文章视图的最有效方法是什么?我是C#专业人士,但是在PHP中我并不如我所愿。假设您有:while(have_posts()) <h4><a href="<?php the_permalink(); ?>"><?php the_title(); ?>…

LeetCode题解191.number-of-1-bits

题目地址 https://leetcode.com/problems/number-of-1-bits/description/ 题目描述 Write a function that takes an unsigned integer and return the number of '1' bits it has (also known as the Ha…

LeetCode题解371.sum-of-two-integers

题目地址 https://leetcode.com/problems/sum-of-two-integers/description/ 题目描述 Calculate the sum of two integers a and b, but you are not allowed to use the operator + and -. Example 1: …

调用glDrawArrays之后的GL_OUT_OF_MEMORY。为什么? - java

我的情况似乎很奇怪。我将尝试提供足够的详细信息,以便比我聪明的人可以对此进行解释。基本上这里是设置:OS: Android 2.2 Froyo Device: SGS Vibrant Application: OpenGL-ES 1.1 问题就在这里:我可以成功渲染一个相当复杂的场景,并且它可以连续运行数小时而不会泄漏任何内存。 Dalvikvm每3-5分钟…

LeetCode题解342.power-of-four

题目地址 https://leetcode.com/problems/power-of-four/description/ 题目描述 Given an integer (signed 32 bits), write a function to check whether it is a power of 4. Example 1: Input: 16 Out…