PracHub
QuestionsPremiumLearningGuidesCheatsheetNEWCoaches

Quick Overview

This question evaluates a candidate's ability to perform advanced SQL data manipulation and aggregation, encompassing date filtering, string extraction from URL paths, frequency counting with tie resolution, and pivoting results by weekday.

  • Medium
  • Bloomberg
  • Data Manipulation (SQL/Python)
  • Software Engineer

Create SQL report of top extensions by weekday

Company: Bloomberg

Role: Software Engineer

Category: Data Manipulation (SQL/Python)

Difficulty: Medium

Interview Round: Technical Screen

You are given a PostgreSQL table service_access_log with columns: method TEXT (HTTP verb), path TEXT (URL path that may include a filename and optional query string), requested_at TIMESTAMP. Write a single SQL query that produces a report with columns: method, monday, tuesday, wednesday, thursday, friday, saturday, sunday. Requirements: 1) Consider only requests in June 2021 (inclusive, based on requested_at). 2) One row per distinct method seen in June 2021. 3) For each method and each day-of-week column, return: NULL if there are no requests for that method on that weekday; otherwise the most frequent file extension requested on that weekday for that method. Define file extension as the substring after the last '.' of the final path segment, ignoring any query string or fragment; if a path has no '.', exclude that request from extension popularity. 4) If exactly one extension has the maximum frequency, return that extension (without the dot). 5) If multiple extensions tie for maximum frequency, return a comma-delimited list of the tied extensions sorted alphabetically ascending. 6) Sort the output rows by method ascending.

Quick Answer: This question evaluates a candidate's ability to perform advanced SQL data manipulation and aggregation, encompassing date filtering, string extraction from URL paths, frequency counting with tie resolution, and pivoting results by weekday.

Last updated: Mar 29, 2026

Related Coding Questions

  • Write PostgreSQL string-manipulation query - Bloomberg (Medium)
  • Write Postgres string parsing and aggregation query - Bloomberg (Medium)

Loading coding console...

PracHub

Master your tech interviews with 7,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.