What types of user-defined functions does BigQuery support (SQL, JavaScript, remote), and when would you use each?

Quick Overview

Asks you to compare BigQuery SQL UDFs, JavaScript UDFs and remote functions and say when each one fits. Tests where each type runs, its performance and cost trade-offs, what it can reach, and the difference between temporary and persistent functions.

What types of user-defined functions does BigQuery support (SQL, JavaScript, remote), and when would you use each?

Role: Data Scientist

Category: Data Manipulation (SQL/Python)

Difficulty: medium

Interview Round: Other

Describe the different types of user-defined functions (UDFs) available in BigQuery (SQL UDFs, JavaScript UDFs and remote functions) and when you would use each. ```hint Ask where the code runs For each type, ask where the code actually executes. That tells you how fast it is, what the code can reach, and who has to maintain it. ``` ### What a Strong Answer Covers - What each of the three types is and how it is defined - Where each one runs, and what that means for performance and cost - What each can and cannot do (procedural logic, external libraries, network calls, other languages) - A decision rule for choosing between them, starting from built-in functions - Temporary versus persistent functions and how they are shared ### Follow-up Questions - How does BigQuery send rows to a remote function, and what does the endpoint have to handle? - What goes wrong when you pass INT64 values or NULLs into a JavaScript UDF? - How would you change a persistent UDF that many views depend on without breaking them? - A remote function calls a paid external API. How do you keep a query over a billion-row table from becoming expensive?

Overview: Asks you to compare BigQuery SQL UDFs, JavaScript UDFs and remote functions and say when each one fits. Tests where each type runs, its performance and cost trade-offs, what it can reach, and the difference between temporary and persistent functions.

PracHub logo
General
Nov 24, 2026
mediumData ScientistOtherData Manipulation (SQL/Python)
0
0

Describe the different types of user-defined functions (UDFs) available in BigQuery (SQL UDFs, JavaScript UDFs and remote functions) and when you would use each.

What a Strong Answer Covers Guidance

  • What each of the three types is and how it is defined
  • Where each one runs, and what that means for performance and cost
  • What each can and cannot do (procedural logic, external libraries, network calls, other languages)
  • A decision rule for choosing between them, starting from built-in functions
  • Temporary versus persistent functions and how they are shared

Follow-up Questions Guidance

  • How does BigQuery send rows to a remote function, and what does the endpoint have to handle?
  • What goes wrong when you pass INT64 values or NULLs into a JavaScript UDF?
  • How would you change a persistent UDF that many views depend on without breaking them?
  • A remote function calls a paid external API. How do you keep a query over a billion-row table from becoming expensive?