Dataford
Popular roles
Software EngineerData AnalystData ScientistData EngineerBusiness AnalystAI EngineerMachine Learning EngineerProduct Manager
Trending in AI
Hot
Agentic AI EngineerForward-Deployed EngineerGenAI EngineerAI Architect
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
Start free
What SSL Traffic Means
00:00
5 left

What SSL Traffic Means

MediumSQL · PostgreSQL

Problem

What is SSL traffic?

Using the provided request and hostname data, write a PostgreSQL query that measures SSL traffic as requests using the HTTPS protocol during January 2025.

Output

  1. One row per configured hostname, including hosts with no matching requests
  2. Columns: hostname, total_requests, ssl_requests, and ssl_percentage
  3. Include only requests from January 2025, order by ssl_percentage descending, then hostname ascending

Output details

  • Treat January 2025 as request_time >= TIMESTAMP '2025-01-01 00:00:00' and < TIMESTAMP '2025-02-01 00:00:00'.
  • Round ssl_percentage to two decimal places.
  • Return 0.00 for ssl_percentage when a hostname has no matching requests.

Schema

property_hosts
ColumnTypeDescription
host_idPKINTUnique hostname identifier
hostnameVARCHAR(255)Configured hostname
property_nameVARCHAR(100)Akamai property associated with the hostname
request_logs
ColumnTypeDescription
request_idPKINTUnique request identifier
host_idINTReferenced configured hostname identifier
request_timeTIMESTAMPTime when the request was received
protocolVARCHAR(10)Transport protocol, such as HTTPS or HTTP
status_codeINTHTTP response status code
Tablesproperty_hostsrequest_logs
Interviewer

Whenever you're ready, walk me through your approach or go straight to the code. The requirements and the two tables are in the Question tab.

Sign up free to run or submit. Log in
CodePostgreSQL
Sign up free to run your code. Your draft is saved.Run with a free accountLog inLn 1
Run your query to see results here.