TSA Coding Practice Questions – Flashcardlet Format

TSA Coding Practice Questions – Flashcardlet Format

Assessment

Flashcard

Science

12th Grade

Practice Problem

Hard

Created by

Wayground Content

FREE Resource

Student preview

quiz-placeholder

15 questions

Show all answers

1.

FLASHCARD QUESTION

Front

What is binary search?

Back

A search algorithm that finds the position of a target value within a sorted array. It works by repeatedly dividing the search interval in half.

2.

FLASHCARD QUESTION

Front

What is the time complexity of binary search?

Back

O(log n), where n is the number of elements in the array.

3.

FLASHCARD QUESTION

Front

What is an infinite loop?

Back

A loop that continues to execute indefinitely because the terminating condition is never met.

4.

FLASHCARD QUESTION

Front

What is a while() loop used for?

Back

To execute a block of code repeatedly as long as a specified condition is true.

5.

FLASHCARD QUESTION

Front

What does RANDOM(1,5) return?

Back

A random integer between 1 and 5, inclusive.

6.

FLASHCARD QUESTION

Front

How do you stop a loop when two conditions are met?

Back

Use a conditional statement that checks both conditions, e.g., 'when (die1 == 3 && die2 == 3) {'.

7.

FLASHCARD QUESTION

Front

What is the difference between a while loop and a repeat-until loop?

Back

A while loop checks the condition before executing the loop body, while a repeat-until loop checks the condition after executing the loop body.

Create a free account and access millions of resources

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

By signing up, you agree to our Terms of Service & Privacy Policy

Already have an account?