FastPrepSolve a Two-Variable Linear ODE
Problems/Solve a Two-Variable Linear ODE

Solve a Two-Variable Linear ODE

Adobe logoAdobe● HardNEW GRADOA

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: The report gives the differential equation, the promise that the eigenvalues are distinct and real, and an example. Here, we use inputs with up to three decimals within limits, and we round halves away from zero. For times above zero, the results stay at least 0.0001 away from a half-cent edge, so floating-point math can round them reliably.

Our version is about 97% the same as the reported question.

Solve the system x'(t) = A*x(t), where A is a real 2-by-2 matrix and x(0) = x0. The matrix has two distinct real eigenvalues.

Return the two coordinates of x(T), each rounded to two decimal places. At an exact halfway point, round away from zero.

Function

findValue(A: double[][], x0: double[], T: double) → double[]

Examples

Example 1

A = [[1,2],[3,2]]x0 = [0,-4]T = 1return = [-86.77,-131.62]

The eigenvalues are 4 and -1. The solution is -1.6*exp(-t)*[-1,1] - 0.8*exp(4*t)*[2,3]. At t=1, rounding gives [-86.77,-131.62].

Example 2

A = [[0,0],[0,1]]x0 = [2,3]T = 1return = [2,8.15]

The first coordinate stays 2. The second is 3*exp(1), which rounds to 8.15.

Constraints

  • A has exactly two rows, each containing exactly two values.
  • For this exercise, assume -3 <= A[i][j] <= 3.
  • x0 contains exactly two values.
  • For this exercise, assume -100 <= x0[i] <= 100.
  • For this exercise, assume 0 <= T <= 2.
  • The discriminant (A[0][0]-A[1][1])^2 + 4*A[0][1]*A[1][0] is at least 0.0001, so the eigenvalues are real and distinct.
  • For this exercise, assume every entry of A, x0 and T has at most three digits after the decimal point.
  • For this exercise, assume that when T > 0, each exact unrounded coordinate of x(T) is at least 0.0001 away from every half-cent boundary (j+0.5)/100, for any integer j.

Source note: Original OA task images and any included source example. The practice contract follows the rules stated in the problem and source note.

More Adobe Online Assessment questions

  • Base Unit ConversionsOA · Seen Nov 2026
  • Rotate an Array In PlaceOA · PHONE SCREEN · Seen Aug 2026
  • Top-Funded Villages and ProjectsOA · Seen Aug 2026
  • Count Parent Nodes With a Target SumOA · Seen Aug 2026
  • Largest Binary Number by ConcatenationOA · Seen Aug 2026
  • Count Events by CategoryOA · Seen Aug 2026
  • Graph M-ColoringOA · Seen Aug 2026
  • Hall of Shifting TilesOA · Seen Aug 2026
  • K-th Ancestor Subtree Preorder QueryOA · Seen Aug 2026
  • Maze ReachabilityOA · Seen Aug 2026

Similar questions at other companies

  • Balance a Chemical EquationMicrosoft · OAMicrosoft interview questions
  • Daily Temperature By TownTwo Sigma · OATwo Sigma interview questions
  • Hedge Inventory with Return CovarianceMillennium · OAMillennium interview questions
  • Count Valid A-B-C Sequences Under a Modulo-Four RuleInfosys · OAInfosys interview questions
  • The Three Knights 🎠TikTok · OATikTok interview questions
  • Survey Table: Group Given an AnswerSusquehanna International Group (SIG) · OASusquehanna International Group (SIG) interview questions
  • Gaussian Naive Bayes Classifier (Machine Learning OA)Pinterest · OAPinterest interview questions
  • Squared Frobenius Norm of a Reflect-and-Stretch MapWalleye Capital · OA
  • Scaled Dot-Product AttentionMeshy · OA
  • Build a Gaussian Blur KernelLuma AI · OALuma AI interview questions

Adobe interview experiences

  • Adobe New Grad OA: Unit Conversion and Code Review: 1 Experience
  • Adobe Web, QA, DevOps, ML Roles: 13 Experiences (Part 3 of 3)
  • Adobe SWE Interviews, Level Unknown: 25 Experiences (Part 2 of 3)
  • Adobe Interviews, Level Unknown: 38 Experiences (Part 1 of 3)
  • Adobe New Grad MTS Interview Questions: 7 Experiences
  • Adobe ML/Research Intern Interviews: 12 Experiences (Part 4 of 4)
All Adobe interview questionsSee Adobe hiring insights
Saved
class Solution {
    public double[] findValue(double[][] A, double[] x0, double T) {
        // Write your solution here.
    }

}
Checking account…