Flag Periodic DNS Beaconing From Resolver Query Logs

Last updated: November 29, 2026

Quick Overview

Given DNS query logs as (timestamp, client, domain) rows from a cloud resolver, find client and domain pairs whose queries recur at suspiciously regular intervals, which is a common sign of malware calling home, while ignoring domains that are periodic for benign reasons.

Cisco
Data Manipulation (SQL/Python)
Data Scientist
Cisco
November 29, 2026
Data Scientist
Technical Screen
Data Manipulation (SQL/Python)
Medium

0

0

0 solved


Given DNS query logs as (timestamp, client, domain) rows from a cloud resolver, find client and domain pairs whose queries recur at suspiciously regular intervals, which is a common sign of malware calling home, while ignoring domains that are periodic for benign reasons.

Cisco Umbrella resolves DNS for a huge number of organizations and Talos researchers hunt command and control traffic in that data, so security data science roles test whether you can turn a detection idea into clean, defensible code. The interviewer checks grouping, deduplication, a sound regularity metric, and how you control false positives.

What the Interviewer Expects
  • Groups by (client, normalized domain) and sorts timestamps
  • Deduplicates retries and resolver bursts before computing gaps
  • Uses a scale-free regularity measure such as the coefficient of variation of gaps
  • Requires a minimum number of queries and a minimum period
  • Suppresses widely queried or allowlisted domains
Key Topics to Cover
beaconing detection
group by
time series gaps
coefficient of variation
false positive control
How to Approach This
  1. Clarify the schema and expected output format before writing queries.
  2. Use CTEs (WITH clauses) to break complex queries into readable steps.
  3. Consider window functions (ROW_NUMBER, RANK, LAG, LEAD) for ranking and sequential analysis.
  4. Watch for NULLs, duplicates, and edge cases in JOINs and GROUP BY.
  5. For pandas, prefer vectorized operations over row-by-row iteration.
Possible Follow-up Questions
  • Malware often adds random jitter of 20 percent. How would you still detect it?
  • How would you run this over billions of rows per day in Spark or SQL?
  • How would you validate the detector without many labeled examples?
  • DNS TTL caching hides some queries. How does that bias the intervals?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Practice SQL Problems
Sample Answer
Clarify the Data

Each row is one query seen at the resolver: epoch seconds, a client identifier (internal IP or Umbrella identity), and a domain. Domains may differ in case or have a trailing dot. Some clients retry w...

Approach
  1. Normalize domains and group timestamps by (client, domain); also count distinct clients per domain.
  2. Skip domains queried by many clients (update services, NTP, telemetry) or on an allowlist. B...

Submit Your Answer
Markdown supported

Related Questions