Search GimmeJob

Type at least 2 characters. Enter also searches by meaning.
QA interview question
ProgrammingSeniorOccasionalTroubleshooting

Which failure modes would you investigate first in data structures when operations can fail or time out?

Answer

Make the investigation reproducible by making inputs, outputs, ownership and failure behavior explicit before choosing an implementation. Focus on data structures when operations can fail or time out. Use small deterministic units plus integration behavior at real boundaries as the oracle. Cover normal flow, invalid inputs, exceptions, concurrency and resource cleanup. Keep data and dependencies controlled enough to reproduce failures. Release only when tests fail for one understandable reason and the code remains easy to change.

Strong answer includes

  • explicit risk and test oracle for data structures
  • controls side effects and dependencies
  • designs for deterministic tests
  • measurable evidence and residual-risk statement

Practical example

A cache implemented as a hash map left a half-written entry in place when the value-computation function timed out mid-insert, and later reads returned that corrupted partial value instead of an error. The first failure mode investigated was whether inserts were atomic with respect to failure, and they weren't: the map exposed the key before the value was fully computed.

#programming#test-code#data-structures

Sources

Git referenceGit Project · Version control concepts and commandsPlaywright best practicesMicrosoft · Reliable modern browser automationMIT OpenCourseWare — Introduction to AlgorithmsMIT OpenCourseWare · Data structures, algorithmic reasoning and time and space complexity