← RTL Design Interviews · SoC Architecture Interviews

Interview Question · Define the Hardware–Software Contract

Choose Who Waits and Who Moves the Bytes

L0 FresherL2 Mid-Levelhardware software contracts

The Question

The interviewer asks

A driver has a brief startup wait, a rare input while other work runs, and a long UART transfer. How would you serve each?

Reveal the Model Answer

Poll for the brief wait if the processor can spare the time. Use an interrupt for the rare input so other work can proceed. Consider DMA for the long transfer to spread setup cost across many bytes.

Self-Check

Tick each key point you covered in your answer.

What Interviewers Want to Hear (Fresher)

Identify who waits and who moves data for each device.

Choose Your Follow-up

I’ve answered the opening question

Choose the route closest to your reasoning. Answer the follow-up aloud, then open the closing question.

I picked polling for a short wait.

A board change stretches the wait while another task needs the processor. What would you reconsider?

Reveal the Model Answer

Measure the longest busy wait against the other task’s deadline. If the device can signal readiness, use an interrupt and resume the waiting operation later.

Self-Check

Tick each key point you covered in your answer.

Interpret the Timing Results

Four letters take 61 elapsed cycles with polling, 75 with interrupts and 70 with DMA. Which result would you present to a firmware team?

Reveal the Model Answer

Polling delivers the last letter to UART0 first, but occupies the processor for 60 cycles. DMA occupies it for 12 and interrupts for 38. For a deadline at the pin, measure the last transmitted bit too. The lab stops at register acceptance.

Self-Check

Tick each key point you covered in your answer.

I expected DMA to cost less.

S6.9 sends one letter with room available. DMA needs four three-cycle setup writes. Interrupt service needs eight cycles per letter. Which method occupies the processor least?

Reveal the Model Answer

Polling wins with one status read and one write, six cycles. DMA costs 4 × 3 = 12. Interrupts cost 3 + 8 + 3 = 14 including enable and disable. Only the handler cost repeats per letter.

Self-Check

Tick each key point you covered in your answer.

Interpret the Timing Results

Four letters take 61 elapsed cycles with polling, 75 with interrupts and 70 with DMA. Which result would you present to a firmware team?

Reveal the Model Answer

Polling delivers the last letter to UART0 first, but occupies the processor for 60 cycles. DMA occupies it for 12 and interrupts for 38. For a deadline at the pin, measure the last transmitted bit too. The lab stops at register acceptance.

Self-Check

Tick each key point you covered in your answer.

I handed the stream to DMA.

Several bytes remain in SRAM when the UART runs out of room. What must the DMA do before the next device write?

Reveal the Model Answer

Wait for transmit space. Advance the memory address as bytes transfer and keep the UART data address fixed. Report success only after the last write completes.

Self-Check

Tick each key point you covered in your answer.

Interpret the Timing Results

Four letters take 61 elapsed cycles with polling, 75 with interrupts and 70 with DMA. Which result would you present to a firmware team?

Reveal the Model Answer

Polling delivers the last letter to UART0 first, but occupies the processor for 60 cycles. DMA occupies it for 12 and interrupts for 38. For a deadline at the pin, measure the last transmitted bit too. The lab stops at register acceptance.

Self-Check

Tick each key point you covered in your answer.

What People Get Wrong

Common wrong answers and why they fail.

Misconception

An interrupt handler moves the whole stream for free.

The processor still enters the handler and executes the data moves.

Source S6.9, cycles busy in the interrupt run.

Half-Truth

DMA will make the UART transmit faster.

The serial device can limit completion time even when the processor becomes free sooner.

Learn It, Then Prove It