Math + Problem Solving Flashcards

1
Q

x % 2 === 0

A

Easy way to determine x is an even number

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

Math.floor(Math.random() * 6 + 1);

A

Find number between 0 and 6

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

[margin] 100 * 42.85714%

A

Finding a margin that is the % value of 3/7. This would be used to find the margin if you’re looking to fill up 3/7 of a row (flexbox)

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

1.61803

A

float that equals/represents golden ratio.

used in Flexbox Starter Course #4 to set flex-grow and flex-shrink for the bigger portion of golden ratio layout

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

1 / (1 + 1 + 1)

A

Flexbox adds the values for the properties and then divide each column’s value by that sum. So each column takes up 1 ÷ (1 + 1 + 1), or ⅓ of the total space.

If the first integer was 4, it would be 4 / (4 + 1 + 1) which = 4/6 or 2/3 of total space.

Used in:
.column { flex: 1 1 0; }

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

Quickest way to find the halfway point between two numbers, a and b.

A

(a + b) / 2

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

Why are manhole covers round?

A

Because they’ll roll and they can’t fall down the hole. And because manholes are round.

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

There are three switches in one room and one light bulb in another. How can you tell which switch controls the bulb if you can only make one trip from the switch room to the bulb room?

A

Turn on two switches, wait a while and turn one off. If the bulb is on, it’s the one left on. If the bulb is off and warm, it was the one you switched off. Otherwise it’s the one you didn’t touch.

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

If a plane crashes right on the border of the US and Canada, in which country would you bury the survivors?

A

You don’t bury survivors.

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

You have two fuses which burn unevenly (not at a constant rate). You do know that it takes one minute for each fuse to burn completely when lit at one end. How do you measure 45 seconds?

A

Light both ends of fuse one and one end of fuse two. When fuse one burns out, light the other end of fuse two.

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

You have four people (A, B, C & D) who have to cross a bridge. One or two can cross at once and they travel at the speed of the slower person. There’s one flashlight which is needed to cross the bridge. A takes one minute, B takes two minutes, C takes five minutes and D takes ten minutes to cross. How do you get all of the people across in 17 minutes?

A

A and B cross, A comes back, C and D cross, B comes back, A and B cross.

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

How far apart are the hands of a clock at 3:15?

A

They’re seven and a half degrees apart.

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

Tell me one of your faults.

A

Sometimes I’m too much of a perfectionist and I expect too much from my teammates.

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

First 13 numbers in Fibonacci sequence

A

0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144

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

Divide and conquer

A

Recursively breaking down a problem into two or more sub-problems of the same (or related) type (divide), until these become simple enough to be solved directly.

The solutions to the sub-problems are then combined to give a solution to the original problem.

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