Dataford
Interview QuestionsInterview GuidesExperiencesCoaching
New
Pricing
Get started
Dataford
Popular roles
Software EngineerData AnalystData ScientistData EngineerBusiness AnalystAI EngineerMachine Learning EngineerProduct Manager
Browse
Browse All RolesEvery role hub, from analyst to MLBrowse All CompaniesCompany-specific interview loopsAll Interview GuidesThe full guide library
Top questions by role
Software EngineerData AnalystData ScientistData EngineerBusiness AnalystAI EngineerMachine Learning EngineerProduct Manager
Top questions by skill
SQLPythonStatisticsMachine LearningA/B TestingSystem DesignGenerative AIProduct SenseMetricsBehavioral
Browse all questions →Try a mock interview
ExperiencesCoaching
New
Practice
Mock InterviewsTimed interview simulations with feedbackSuccess PathYour 6-week structured planModulesCurated lessons by topicWebinarsTalks from ex-Big Tech data leadsPlaygroundA free-form scratch editor
Learn
BlogInterview strategy and career adviceTech Job Market ReportHiring trends across data and AI rolesFor UniversitiesDataford for career centersAbout DatafordWho we are and how we build
Pricing
Get started
Streaming, TCP/IP Basics
00:00
5 left

Streaming, TCP/IP Basics

MediumSQL · PostgreSQL

Problem

Explain how streaming works at a basic level and how TCP/IP fits in.

For the SQL portion, use the supplied stream and transport-event data to represent the relationship between an application stream and its TCP/IP delivery metrics.

Output

  1. One row per stream, including streams with no TCP events.
  2. Return stream_id, stream_name, transport_protocol, total_bytes, packet_count, retransmissions, avg_rtt_ms, and delivery_status.
  3. delivery_status is healthy when bytes were delivered with no retransmissions, degraded when retransmissions occurred, and no_data when no TCP bytes were recorded.
  4. Order by stream_id ascending.

Schema

streams
ColumnTypeDescription
stream_idPKINTUnique streaming session identifier
stream_nameVARCHAR(100)Human-readable stream name
transport_protocolVARCHAR(10)Transport protocol expected by the stream
started_atTIMESTAMPStream start time
transport_events
ColumnTypeDescription
event_idPKINTUnique transport event identifier
stream_idINTReferenced streaming session
transport_protocolVARCHAR(10)Protocol observed for the event
event_typeVARCHAR(30)Observed transport event type
bytes_transferredINTBytes transferred in the event
retransmissionsINTNumber of retransmitted packets
rtt_msDECIMAL(8,2)Round-trip time in milliseconds
event_atTIMESTAMPEvent timestamp
Tablesstreamstransport_events
Interviewer

Your question is Streaming, TCP/IP Basics. Start with the requirements and the two tables in the Question tab.

Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.

You need to log in / sign up to run or submit.
CodePostgreSQL
Sign up free to run your codeLog inLn 1
Run your query to see results here.