Thinking Like a Programmer Flashcards

(20 cards)

1
Q

What is an algorithm?

A

A step-by-step process to solve a problem.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Does an algorithm have to be code?

A

No, it can also be written in plain language.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the first step when solving a programming problem?

A

Understand the problem before writing any code.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What does “breaking a problem down” mean?

A

Splitting a big task into smaller, manageable steps.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is decomposition in programming?

A

The act of breaking complex problems into smaller parts.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is logical thinking in programming?

A

Making decisions based on clear rules and predictable outcomes.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What does debugging mean?

A

Finding and fixing errors or unexpected behavior in code.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is the key mindset of debugging?

A

Assume your logic might be wrong and test it piece by piece.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What should you check first when code doesn’t work?

A

Your assumptions and the values your program is actually using.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is a common debugging method?

A

Printing or inspecting values to see what the code is doing.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What does “trace the code” mean?

A

Follow the logic step by step like the computer would.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is an edge case?

A

An uncommon situation that can break a program if not handled.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is resilience in programming?

A

Being able to retry and rethink instead of giving up when something breaks.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is a stack?

A

A structure that stores items in “last in, first out” order (LIFO).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Stack example: dishes piled up — which dish do you take first?

A

The top one (last added, first removed).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is a queue?

A

A structure that stores items in “first in, first out” order (FIFO).

17
Q

Queue example: a line of people — who goes first?

A

The person who arrived first.

18
Q

When is a stack useful?

A

When the most recent item should be used first (undo button, back button, etc).

19
Q

When is a queue useful?

A

When tasks should be handled in order of arrival (lines, notifications, print jobs).

20
Q

What separates a programmer from a beginner?

A

How they think through problems, not how much code they memorize.