PracHub
QuestionsPremiumLearningGuidesCheatsheetNEWCareers
|Home/Coding & Algorithms/NVIDIA

Implement polynomial multiplication API in C

Last updated: Mar 29, 2026

Quick Overview

This question evaluates proficiency in C programming, API design, low-level data representation for polynomials, and algorithmic competence in performing coefficient convolution while handling edge cases like differing degrees, zero and negative coefficients.

  • medium
  • NVIDIA
  • Coding & Algorithms
  • Software Engineer

Implement polynomial multiplication API in C

Company: NVIDIA

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: medium

Interview Round: Technical Screen

## Problem Implement an API in **C** to multiply two polynomials. A polynomial is represented by its coefficients. You must **define the input and output format** as if you were writing a small library function for other users. Example polynomials: - \(P(x) = x^3 - 2x + 5\) - \(Q(x) = x^2 + 2x + 4\) ## Requirements - Use **C (not C++)**. - Define a clear representation for a polynomial (e.g., array of coefficients where `coeff[i]` is the coefficient of \(x^i\)). - Provide a function (or set of functions) that multiplies two polynomials and returns the result. - Ensure the API handles: - Different degrees for the two inputs - Zero coefficients - Negative coefficients ## Output Return (or fill) a polynomial representing \(R(x) = P(x) \times Q(x)\) using your chosen representation. ## Constraints (you may assume) - Degrees are non-negative integers. - Coefficients fit in 32-bit signed integers (or specify a larger type if you choose). - Time complexity should be better than enumerating all exponent pairs explicitly as strings (i.e., use coefficient convolution).

Quick Answer: This question evaluates proficiency in C programming, API design, low-level data representation for polynomials, and algorithmic competence in performing coefficient convolution while handling edge cases like differing degrees, zero and negative coefficients.

Related Interview Questions

  • Return all file paths via DFS - NVIDIA (easy)
  • Implement a disk space manager with eviction - NVIDIA (medium)
  • Implement encode/decode for list of strings - NVIDIA (easy)
  • Implement short algorithms on logs, grids, and strings - NVIDIA (hard)
  • Solve small string and API tasks - NVIDIA (medium)
NVIDIA logo
NVIDIA
Feb 8, 2026, 12:00 AM
Software Engineer
Technical Screen
Coding & Algorithms
3
0
Loading...

Problem

Implement an API in C to multiply two polynomials.

A polynomial is represented by its coefficients. You must define the input and output format as if you were writing a small library function for other users.

Example polynomials:

  • P(x)=x3−2x+5P(x) = x^3 - 2x + 5P(x)=x3−2x+5
  • Q(x)=x2+2x+4Q(x) = x^2 + 2x + 4Q(x)=x2+2x+4

Requirements

  • Use C (not C++) .
  • Define a clear representation for a polynomial (e.g., array of coefficients where coeff[i] is the coefficient of xix^ixi ).
  • Provide a function (or set of functions) that multiplies two polynomials and returns the result.
  • Ensure the API handles:
    • Different degrees for the two inputs
    • Zero coefficients
    • Negative coefficients

Output

Return (or fill) a polynomial representing R(x)=P(x)×Q(x)R(x) = P(x) \times Q(x)R(x)=P(x)×Q(x) using your chosen representation.

Constraints (you may assume)

  • Degrees are non-negative integers.
  • Coefficients fit in 32-bit signed integers (or specify a larger type if you choose).
  • Time complexity should be better than enumerating all exponent pairs explicitly as strings (i.e., use coefficient convolution).

Comments (0)

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More NVIDIA•More Software Engineer•NVIDIA Software Engineer•NVIDIA 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
  • Careers
  • 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.