InterviewStack.io LogoInterviewStack.io

Java or Python Programming for Test Automation Questions

Strong programming skills in Java or Python with expertise in OOP principles (inheritance, polymorphism, encapsulation, abstraction), exception handling, collections, file I/O, and functional programming concepts. Ability to write clean, well-structured, maintainable code with appropriate design patterns. Understanding of common libraries and utilities for test automation.

MediumTechnical
79 practiced
Implement a memory-efficient iterator in Python (generator) or Java (Stream/Iterator) that parses and yields records from a very large newline-delimited JSON (ndjson) file. Include how you'd unit test parsing errors and how you'd test backpressure or slow consumers.
MediumTechnical
116 practiced
Discuss trade-offs between using mocks/stubs versus real components in integration tests for ML systems. Cover aspects of speed, confidence, flakiness, maintenance, and examples such as feature stores, model registries, and GPU inference. Provide guidance for when to prefer each approach.
HardTechnical
65 practiced
Implement a deterministic random sampler suitable for distributed training tests: given a global seed, epoch number, worker id, and total number of workers, produce a reproducible permutation slice for each worker that is identical across runs with the same parameters. Explain how your approach avoids collisions and how to resume from checkpoints mid-epoch.
EasyTechnical
74 practiced
Implement a function in either Java or Python that reverses a Unicode string in O(n) time and returns the reversed result. Include unit tests covering: empty string, single char, multi-byte characters (emoji), combining characters, and a very large string. Discuss memory trade-offs (in-place vs new allocation) and describe how you'd add this test to CI to catch regressions in string handling.
HardTechnical
87 practiced
Implement a compact property-based testing utility in Python that generates random integers and floats, runs a user-specified property function N times with a fixed seed, and reports counterexamples when the property fails. Keep the implementation small but support reproducible seeds and size control. Describe tests for your utility.

Unlock Full Question Bank

Get access to hundreds of Java or Python Programming for Test Automation interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.