Priority mix per project

reshaping

Priority mix per project

Atlassian SQL Interview Question

Atlassian staffs teams from the shape of a backlog, not its size. A project of forty low priority items needs one engineer working steadily; a project with six of the highest priority needs three people and a daily check-in. Staffing therefore starts from how many tickets each project is carrying at each priority level.

Return the project, and the number of tickets at each level as p1_tickets, p2_tickets and p3_tickets. A level a project has none of counts as zero.

Asked of

  • Data Analyst
  • Business Analyst
  • BI Analyst
  • Product Analyst
  • Analytics Engineer
  • Data Engineer
  • Data Scientist

atlassian_ticketsTable24 rows

Column NameType
ticket_idBIGINT
parent_ticket_idBIGINT
projectVARCHAR
opened_onDATE
resolved_onDATE
priorityVARCHAR
assignee_idBIGINT

atlassian_ticketsExample Input

ticket_idparent_ticket_idprojectopened_onresolved_onpriorityassignee_id
2001NULLJira Cloud2024-02-012024-02-14P111
20022001Jira Cloud2024-02-022024-02-06P212
20032001Jira Cloud2024-02-032024-02-11P213
20042001Jira Cloud2024-02-05NULLP312
2005NULLJira Cloud2024-02-042024-02-09P214
20062005Jira Cloud2024-02-052024-02-08P311
2014NULLBitbucket2024-02-012024-02-03P317
2015NULLBitbucket2024-02-052024-02-22P118
20162015Bitbucket2024-02-062024-02-13P217

Example Output

projectp1_ticketsp2_ticketsp3_tickets
Bitbucket111
Jira Cloud132

Explanation

Jira Cloud has one ticket at the top level, three in the middle and two at the lowest. Bitbucket has one of each. Both carry a single top-priority ticket, so it is the levels underneath that decide who staffs them.

The example above is a small slice of the data. Your query runs against the full tables.