PracHub
QuestionsPremiumCoachesLearningGuidesInterview Prep
|Home/Software Engineering Fundamentals/Others

Write a quarterly SQL report and a bash max-file script

Last updated: Mar 29, 2026

Quick Overview

This question evaluates proficiency in SQL conditional aggregation and date-based grouping alongside shell scripting skills for recursive filesystem traversal and file size analysis.

  • medium
  • Others
  • Software Engineering Fundamentals
  • Software Engineer

Write a quarterly SQL report and a bash max-file script

Company: Others

Role: Software Engineer

Category: Software Engineering Fundamentals

Difficulty: medium

Interview Round: Take-home Project

## Part A — SQL (conditional aggregation) You have two tables: - `coins(coin_id, name)` - `transactions(id, coin_id, dt, amount)` Write a query that returns **one row per coin** with the following columns: - `name` - `q1_amount`, `q2_amount`, `q3_amount`, `q4_amount` (sum of `amount` for transactions whose `dt` falls in quarter 1/2/3/4) - `total_transactions` (count of transactions for that coin) - `total_amount` (sum of `amount` for that coin) Assume all transactions are within the same calendar year; if multiple years exist, state how you would filter to a target year. ## Part B — Bash (filesystem) Given a directory path, implement a shell function that returns the **maximum file size (bytes)** among all regular files under that directory. Clarify whether the search is recursive; if not specified, assume **recursive** (include subdirectories). Handle the empty-directory case sensibly (e.g., return `0` or no output) and avoid counting directories.

Quick Answer: This question evaluates proficiency in SQL conditional aggregation and date-based grouping alongside shell scripting skills for recursive filesystem traversal and file size analysis.

Others logo
Others
Jan 20, 2026, 12:00 AM
Software Engineer
Take-home Project
Software Engineering Fundamentals
1
0
Loading...

Part A — SQL (conditional aggregation)

You have two tables:

  • coins(coin_id, name)
  • transactions(id, coin_id, dt, amount)

Write a query that returns one row per coin with the following columns:

  • name
  • q1_amount , q2_amount , q3_amount , q4_amount (sum of amount for transactions whose dt falls in quarter 1/2/3/4)
  • total_transactions (count of transactions for that coin)
  • total_amount (sum of amount for that coin)

Assume all transactions are within the same calendar year; if multiple years exist, state how you would filter to a target year.

Part B — Bash (filesystem)

Given a directory path, implement a shell function that returns the maximum file size (bytes) among all regular files under that directory.

Clarify whether the search is recursive; if not specified, assume recursive (include subdirectories). Handle the empty-directory case sensibly (e.g., return 0 or no output) and avoid counting directories.

Solution

Show

Submit Your Answer

Sign in to leave a comment

Loading comments...

Browse More Questions

More Software Engineering Fundamentals•More Others•More Software Engineer•Others Software Engineer•Others Software Engineering Fundamentals•Software Engineer Software Engineering Fundamentals
PracHub

Master your tech interviews with 8,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.