# Ship It or Skip It

> The calendar doesn't lie. How aggressive is this team, really?

Canonical URL: <https://datadriven.io/problems/daily_deployment_count>

Domain: SQL · Difficulty: easy · Seniority: L3

## Problem

The release engineering team is tracking deployment velocity. How many deploys happened each day? List chronologically.

## Worked solution and explanation

### Why this problem exists in real interviews

This tests simple date aggregation. It verifies that you can extract dates from timestamps and count events per day.

---

### Break down the requirements

#### Step 1: Extract date

`deploy_at::DATE` truncates to the calendar day.

#### Step 2: Count per day

`COUNT(*)` grouped by date gives daily deployment count.

---

### The solution

**Date-grouped count**

```sql
SELECT deploy_at::DATE AS day, COUNT(*) AS deploy_count
FROM deploy_logs
GROUP BY deploy_at::DATE
ORDER BY day
```

> **Cost Analysis**
>
> Scan of 600K rows. Trivially fast. Output is one row per day with deployments.

> **Interviewers Watch For**
>
> Whether the candidate adds unnecessary complexity. This is a two-line query body.

> **Common Pitfall**
>
> Using EXTRACT(DOW FROM deploy_at) would give day-of-week, not calendar dates. Use DATE casting or DATE_TRUNC for calendar dates.

---

## Common follow-up questions

- How would you fill in days with zero deployments? _(Tests calendar table join or generate_series for gap-filling.)_
- How would you show the running total of deployments? _(Add SUM(COUNT(*)) OVER (ORDER BY day) as a window function.)_
- What if deploy_at is stored as a Unix timestamp? _(Tests TO_TIMESTAMP conversion before date extraction.)_

## Related

- [All practice problems](https://datadriven.io/problems)
- [Mock interview mode](https://datadriven.io/interview/daily_deployment_count)
- [SQL Interview Questions](https://datadriven.io/sql-interview-questions)
- [Data Engineering Interview Prep Guide](https://datadriven.io/data-engineer-interview-prep)
- [Daily Challenge](https://datadriven.io/daily)

---

Source: DataDriven (https://datadriven.io). 100% free data engineering interview prep. Live code execution against Postgres 16, Python 3.11, and Spark sandboxes. No paywall, no premium tier, no signup gate.