AI in Testing, Data, DevOps & Design Questions with Answers

22 practice questions on AI in Testing, Data, DevOps & Design (AI Tools for Developers) with answers and step-by-step solutions. Try 10 samples below, then practise all 22 free in the AptiNest app.

Sample questions

Question 1Easy

A data analyst asks AI to write a SQL query. What should they do next?

  1. Delete the original table
  2. Assume all joins are correct
  3. Run it on sample data and check the results make sense
  4. Send the query result straight to management as the final figure

Answer: C. Run it on sample data and check the results make sense

Explanation

AI-written queries can have wrong joins, filters or aggregations; checking results against known numbers catches them.

Step-by-step solution

  1. AI-written SQL can have wrong joins, filters or aggregations.
  2. Running it on sample data where the correct answer is known shows such errors.
  3. Compare the output with known numbers and check that it makes sense. The correct answer is C (Run it on sample data and check the results make sense).

Why the other options are wrong

  • A. Deleting the original table is destructive and does not check the query.
  • B. Assuming the joins are correct is the very risk that checking is meant to catch.
  • D. Sending unchecked output as the final figure skips verification.

Tip: Test AI-written SQL on data where you already know the answer before trusting it.

Question 2Easy

AI is often used in testing to:

  1. Replace written product requirements
  2. Guarantee the product ships with zero bugs
  3. Write first drafts of automated test scripts
  4. Decide release dates

Answer: C. Write first drafts of automated test scripts

Explanation

AI drafts speed up automation, but testers verify that scripts are correct and meaningful.

Step-by-step solution

  1. AI is a helper in testing.
  2. It can draft test scripts that people then review and fix.

Why the other options are wrong

  • A. Requirements still need people.
  • B. No tool can guarantee zero bugs.
  • D. Release dates are a business decision.

Tip: Draft with AI, verify yourself.

Question 3Easy

Which is a common use of AI by testers?

  1. Deleting failing tests
  2. Generating test case ideas and test data
  3. Approving releases with no human involvement at any stage
  4. Replacing all bug reports

Answer: B. Generating test case ideas and test data

Explanation

AI helps brainstorm scenarios and create varied inputs; testers still judge relevance and coverage.

Step-by-step solution

  1. AI creates test ideas and data for testers.
  2. Testers review and choose best options.
  3. This saves time and improves coverage.
  4. Human judgment is still needed for final decisions.
  5. Final answer: Generating test case ideas and test data.

Why the other options are wrong

  • A. Deleting failing tests hides real bugs instead of fixing them, which is a bad use of AI.
  • C. Approving releases with no human involvement at any stage removes the checks that testers rely on.
  • D. AI does not replace bug reports; it can help draft them, but reports still matter for real issues.

Tip: AI aids in testing but doesn't replace human oversight.

Question 4Easy

How can AI help a UI designer?

  1. Choosing a brand name with legal clearance
  2. Guaranteeing accessibility compliance
  3. Replacing all usability testing with real users from now on, to save time
  4. Generating layout ideas or placeholder copy to explore quickly

Answer: D. Generating layout ideas or placeholder copy to explore quickly

Explanation

AI speeds up exploration, but usability, accessibility and legal checks still need people and proper processes.

Step-by-step solution

  1. AI can create layout ideas quickly for designers to try out.
  2. It can also generate placeholder text to fill space in designs.
  3. This lets designers explore many options without long waits.
  4. Usability and legal checks still need human input though.
  5. Accessibility compliance requires expert review as well.
  6. So AI helps speed up the design process but doesn't replace all tasks.

Why the other options are wrong

  • A. Choosing a brand name with legal clearance needs legal checks, so AI cannot give that clearance.
  • B. AI cannot guarantee accessibility compliance; that needs expert review and testing.
  • C. AI does not replace real usability testing with users; those tests still matter.

Tip: Use AI for quick layout and copy ideas, but always check legal and accessibility requirements manually.

Question 5Medium

An AI agent proposes a Terraform change. Which step should come before applying it?

  1. Delete the state file
  2. Apply it straight away; you can always read the plan later if something breaks
  3. Run it in every region at once
  4. Review the plan output to see exactly what will change

Answer: D. Review the plan output to see exactly what will change

Explanation

terraform plan shows creations, changes and destructions; reviewing it prevents accidental deletions.

Step-by-step solution

  1. Terraform plan shows what will change.
  2. Review before applying.

Why the other options are wrong

  • A. Never delete state.
  • B. Apply only after review.
  • C. Don't spread risk.

Tip: Plan, review, then apply.

Question 6Medium

AI generates a Dockerfile that runs the app as root and uses latest tags. What should a reviewer suggest?

  1. Add more RUN lines so that the image is more detailed and easier to debug later
  2. Remove the Dockerfile
  3. Pin image versions and run as a non-root user
  4. Nothing; latest is always most secure

Answer: C. Pin image versions and run as a non-root user

Explanation

Pinned versions make builds reproducible, and non-root users limit the impact of a container compromise.

Step-by-step solution

  1. Using latest tags makes builds unstable as base images can change unexpectedly.
  2. Running as root poses security risks if the container is compromised.
  3. Pinning versions ensures consistent and predictable build results.
  4. Non-root users reduce potential damage from container vulnerabilities.
  5. Reviewers should suggest pinning versions and using non-root users for better security and reliability.
  6. Final answer: Pin image versions and run as a non-root user.

Why the other options are wrong

  • A. Adding RUN lines does not fix root or unpinned tags; it only adds size and steps.
  • B. Removing the Dockerfile removes the app's build, which fixes nothing and is not a good review suggestion.
  • D. Latest is not most secure; unpinned tags can change without warning and break builds.

Tip: Always pin image versions and avoid root access in containers for secure and reliable builds.

Question 7Medium

AI generates synthetic test data for a banking app. Why is synthetic data often preferred over copying production data?

  1. It avoids exposing real customers' personal information
  2. Production data is illegal to look at
  3. Synthetic data never contains edge cases
  4. It is always more realistic than real production data in every respect

Answer: A. It avoids exposing real customers' personal information

Explanation

Synthetic data lets you test without privacy risk; you still need to make sure it covers realistic edge cases.

Step-by-step solution

  1. Synthetic data mimics real data but doesn't include actual customer details.
  2. Using real production data risks exposing sensitive personal information.
  3. Copying real data can lead to privacy breaches and legal issues.
  4. Testing with synthetic data keeps customer data safe and compliant.
  5. Final answer: It avoids exposing real customers' personal information.

Why the other options are wrong

  • B. Production data is not illegal to look at; the risk is privacy exposure, not a ban on viewing it.
  • C. Synthetic data can include edge cases; it can be generated to cover them, so this is not true.
  • D. Synthetic data is not always more realistic; it approximates real data and may miss real patterns.

Tip: Use synthetic data to avoid privacy risks in testing.

Question 8Medium

AI suggests a shell script line rm -rf $DIR/* where DIR might be empty. What could go wrong?

  1. It may expand to rm -rf /*, deleting from the root
  2. It will only delete hidden files
  3. Nothing, because rm safely ignores any empty or unset variable
  4. It will print a warning and stop

Answer: A. It may expand to rm -rf /*, deleting from the root

Explanation

An unset or empty variable turns the path into /*; guard with ${DIR:?} or check DIR first.

Step-by-step solution

  1. If DIR is empty, $DIR/* becomes /*.
  2. rm -rf /* deletes from root.

Why the other options are wrong

  • B. It is not limited to hidden files.
  • C. rm does not ignore empty variables.
  • D. There is no warning.

Tip: Guard variables: ${DIR:?}.

Question 9Hard

An AI-generated Kubernetes manifest sets no resource limits on a container. What risk does this create?

  1. One pod can consume excessive CPU/memory and starve others
  2. Kubernetes will delete the namespace
  3. The pod will refuse to start on any cluster version without limits
  4. Logs will no longer be collected

Answer: A. One pod can consume excessive CPU/memory and starve others

Explanation

Without limits a misbehaving container can exhaust node resources; requests and limits keep workloads fair.

Step-by-step solution

  1. Resource limits prevent containers from using too much CPU/memory.
  2. Without limits, one pod can use all available resources.
  3. This causes other pods to get less resources and may crash.
  4. This is called resource starvation for other pods.
  5. The correct answer is A (One pod can consume excessive CPU/memory and starve others).

Why the other options are wrong

  • B. Kubernetes does not delete namespaces because a container lacks limits; that is not the risk.
  • C. Pods without limits still run on most clusters; missing limits is not a reason to refuse to start.
  • D. Logs are not lost because of missing resource limits; the risk is resource starvation.

Tip: Always set resource limits to prevent resource starvation.

Question 10Hard

An AI writes a pandas line df[df.age > 30 & df.city == 'Pune']. What happens?

  1. It works exactly as intended in every version of pandas
  2. It returns all rows
  3. It sorts by age
  4. It fails or misbehaves because & binds tighter than >; each condition needs parentheses

Answer: D. It fails or misbehaves because & binds tighter than >; each condition needs parentheses

Explanation

Python evaluates 30 & df.city first; write (df.age > 30) & (df.city == 'Pune').

Step-by-step solution

  1. In Python, & binds tighter than > and ==.
  2. So 30 & df.city is evaluated first, which is not the intended comparison.
  3. The filter fails or gives wrong results instead of the intended rows.
  4. Wrap each condition in brackets: df[(df.age > 30) & (df.city == 'Pune')]. The correct answer is D.

Why the other options are wrong

  • A. Mixing & with comparisons without brackets breaks in pandas, so it is not correct in every version.
  • B. It does not return all rows; it fails or misbehaves.
  • C. It does not sort by age; the expression is a faulty filter.

Tip: In pandas, wrap each condition in brackets before combining them with & or |.

Practise all 22 questions free

The full question bank with timed practice, progress tracking and Vidya, your AI tutor. Free, no ads.

Open this topic in the app →

Related topics

See all AI Tools for Developers topics · All topics