Problem Solving and Database Round
CodingSQLTechnical InterviewMediumLast asked 1 year ago
Breadfast interview question (Egypt) · stage: Technical Interview · domain: Coding and SQL · role: Software Engineer and Backend Engineer · difficulty: Medium · asked once, last in May 2025
What they ask
An online technical interview that mixes a problem-solving exercise with database questions, followed later by an engineering manager conversation.
Problem-solving sample (solve in the starter code): delivery slots are given as [start, end] minute intervals for one rider; merge overlapping or touching slots so the rider has the fewest continuous windows.
Database questions in this area, for example:
- Write a query for the top 5 products by revenue per day over the last week.
- What index would you add for "orders by customer, newest first", and why a composite index order matters.
- Normalization: when you would denormalize an orders table for reporting.
- Transactions: what isolation level prevents two checkouts from overselling the last unit.
Examples
[[0,30],[5,10],[35,50],[50,60]]returns[[0,30],[35,60]].[[10,20]]returns[[10,20]].
Constraints
- Up to
10^4intervals; O(n log n) via sorting is expected.
What they look for
- Sorting by start and a single sweep, with the touching-interval case handled (
50meets50). - Practical SQL: joins, aggregates, and indexing reasoning.
- Clear communication; the interviewer shares screen and asks you to narrate.