PracHub
QuestionsPremiumLearningGuidesCheatsheetNEWCoaches
|Home/Coding & Algorithms/OpenAI

Implement compile-time function type verification

Last updated: Mar 29, 2026

Quick Overview

This question evaluates proficiency in C++ template metaprogramming, type traits, SFINAE and Concepts for compile-time callable signature verification, including handling of noexcept, cv/ref qualifiers and implicit conversions.

  • Medium
  • OpenAI
  • Coding & Algorithms
  • Software Engineer

Implement compile-time function type verification

Company: OpenAI

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: Medium

Interview Round: Technical Screen

Implement a C++20 compile-time utility to verify whether a callable matches a target function type. Requirements: create a primary template is_callable_with_signature<Fn, R(Args...)> that yields true if Fn is invocable with Args... and the return type is convertible to R; provide two implementations— ( 1) SFINAE/traits-based and ( 2) concepts/requires-based; support free functions, lambdas, functors with overloaded operator(), member function pointers, and std::function; include minimal tests with static_assert and examples that should fail to compile if the signature does not match; discuss handling noexcept, cv/ref qualifiers, and implicit conversions.

Quick Answer: This question evaluates proficiency in C++ template metaprogramming, type traits, SFINAE and Concepts for compile-time callable signature verification, including handling of noexcept, cv/ref qualifiers and implicit conversions.

Related Interview Questions

  • Simulate Infection Spread on a Grid - OpenAI (hard)
  • Implement Social Follow Recommendations - OpenAI (medium)
  • Build a Compose Rating Card - OpenAI (medium)
  • Generate Data Labeling Schedules - OpenAI (medium)
  • Convert IPv4 Ranges to CIDR Blocks - OpenAI (medium)
OpenAI logo
OpenAI
Sep 6, 2025, 12:00 AM
Software Engineer
Technical Screen
Coding & Algorithms
8
0

Implement a C++20 compile-time utility to verify whether a callable matches a target function type. Requirements: create a primary template is_callable_with_signature<Fn, R(Args...)> that yields true if Fn is invocable with Args... and the return type is convertible to R; provide two implementations— (

  1. SFINAE/traits-based and (
  2. concepts/requires-based; support free functions, lambdas, functors with overloaded operator(), member function pointers, and std::function; include minimal tests with static_assert and examples that should fail to compile if the signature does not match; discuss handling noexcept, cv/ref qualifiers, and implicit conversions.

Comments (0)

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More OpenAI•More Software Engineer•OpenAI Software Engineer•OpenAI Coding & Algorithms•Software Engineer Coding & Algorithms
PracHub

Master your tech interviews with 7,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.