Skip to question
asic.fyi
DesignVerificationSystemVerilogFirmwareArchitectureInterviews
asic.fyi/Interview questions/Verify a longest rising-trend accelerator

Hardware interview practice

Verify a longest rising-trend accelerator

MediumReference ModelsSystemVerilog

Write an independent dynamic-programming oracle for the longest strictly increasing subsequence of signed samples and the lowest end index attaining that length.

Try it in the question bankReason first. Then compare.

Keep this exact question selected while you check your answer and review the full solution.

Practice this question →
Reviewed example

Work through one case

Input
signed samples=[3,1,2,5,4]
Expected output
LIS length=3; lowest attaining end_index=3

Both [1,2,5] and [1,2,4] have length three, but the former ends at the lower index 3.

What to cover

Requirements

  1. Use an independent O(n squared) dynamic-programming oracle with signed comparisons and one-based DP initialization for every nonempty element.
  2. Choose the lowest end index when multiple positions attain the same maximum length; empty input returns zero length and zero index.
  3. Explain why increasing, decreasing, constant, duplicate-heavy, sawtooth, alternating-extreme, and planted-subsequence arrays are useful tests.
  4. Return a complete prediction record so a separate tagged scoreboard can compare bad-count, length, and end index independently.
  5. Treat ID matching, ready/valid behavior, reset epochs, and coverage as follow-up verification architecture.
Continue practicing

Related questions

Reference ModelsDebug a signed sliding-window peak→Reference ModelsScoreboard a maximum-interval accelerator→Reference ModelsTriage an end-of-frame run bug→
asic.fyi · Learn silicon end to end.info@asic.fyi