FastPrepMinimum Universal Derivative Order
Problems/Minimum Universal Derivative Order

Minimum Universal Derivative Order

IMC Trading logoIMC Trading● MediumNEW GRADOA

Updated Oct 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: The universal polynomial divisibility objective matches the source at about 95%. The source fixes the divisor at 2021; a variable divisor and its numeric bound are practice details.

For this exercise, assume the fixed divisor in a polynomial question is generalized to the positive integer divisor supplied as input.

For a polynomial P, write P^(order) for its orderth derivative, not an ordinary power. The value P^(order)(k) is that derivative evaluated at the integer k.

Return the smallest positive integer order such that P^(order)(k) is divisible by divisor for every polynomial with integer coefficients and every integer k.

No particular polynomial is supplied, and polynomial degree is unrestricted. Constant polynomials and negative or zero integer evaluation points are included. Divisibility of zero follows the usual integer definition.

Complete smallestUniversalDerivativeOrder(divisor) and return the exact integer order. The order must remain positive when divisor = 1.

Function

smallestUniversalDerivativeOrder(divisor: int) → int

Examples

Example 1

divisor = 2021return = 47

The source instance has 2021 = 43 * 47. An order below 47 misses the factor 47 in its factorial, while 47! contains both 43 and 47.

Example 2

divisor = 1return = 1

Every integer is divisible by 1. The required derivative order is positive, so its minimum is 1.

Example 3

divisor = 8return = 4

Three powers of 2 are needed. 3! = 6 is insufficient, while 4! = 24 is divisible by 8.

Constraints

  • For this exercise, assume 1 <= divisor <= 10^6.
  • The least positive valid order is at most divisor, so the return value fits a signed 32-bit integer.
  • Use a wide integer before multiplying factorial residues; a reduced residue times an order can approach 10^12.

More IMC Trading Online Assessment questions

  • Earliest Meeting Start on a 24-Hour ClockOA · Seen Nov 2026
  • Grid Paths with Override PassesOA · Seen Oct 2026
  • Weighted LFU CacheOA · Seen Sep 2026
  • Rock JumpingOA · Seen Aug 2026
  • Stack Batch RemovalOA · Seen Aug 2026
  • Chain of CommandOA · Seen Aug 2026
  • Choose ContainersOA · Seen Aug 2026
  • Sub-matrix SumsOA · Seen Jul 2026
  • Sub-matrix SumsOA · Seen Jul 2026
  • Can Every Package Fit in a BoxOA · Seen Jul 2026

Similar questions at other companies

  • Count Distinct Arrays After Decrement OperationsBloomberg LP · OABloomberg LP interview questions
  • Polynomial CoefficientsShopify · OAShopify interview questions
  • Basic Calculator IITypeSafe AI · OA
  • Last Object to Fall Off the TableConfluent · OAConfluent interview questions
  • Last Object Exit TimeIBM · OAIBM interview questions
  • Count Prime Values in SubtreesVisa · OAVisa interview questions
  • Minimum Rounds to Complete All TasksInfosys · OAInfosys interview questions
  • Server Upgrade PlanningWells Fargo · OAWells Fargo interview questions
  • Capping Portfolio WeightsCapstone Investment Advisors · OA
  • Gaussian Naive Bayes Classifier (Machine Learning OA)Pinterest · OAPinterest interview questions

Interview reports that mention this question

  • IMC Trading OA: What It Tests (2026)

IMC Trading interview experiences

  • IMC Trading SWE OA and Video: 18 Experiences (Part 3 of 3)
  • IMC Trading SWE OA Questions: 22 Experiences (Part 2 of 3)
  • IMC SWE New Grad OA and Interviews: 58 Experiences (Part 1 of 3)
All IMC Trading interview questionsSee IMC Trading hiring insights
Saved
class Solution {
    public int smallestUniversalDerivativeOrder(int divisor) {
        // Write your solution here.
    }
}
Checking account…