You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You'll be guiding your partner through the coding problem on the right side of your screen.
11
+
12
+
⚠️ **Please do not share this URL / problem before class.**
13
+
Revealing the question early defeats the purpose of simulating a real-world interview, where candidates do not know the problem in advance. Let's give your partner the chance to experience the challenge authentically.
14
+
15
+
🧠 **Before class:**
16
+
Take time to study the problem. During the session, you'll have 90 minutes in your breakout room to run a mock interview with your partner. Be sure to take turns acting as the interviewer and interviewee.
17
+
18
+
🗣️ **As the interviewer, your responsibilities are:**
19
+
- Send this URL to your partner (copy and past the whole url and slack it directly to you partner)
20
+
- Briefly introduce the problem
21
+
- Never give away the answer
22
+
- Take notes and provide feedback
23
+
- Fill out this [solving guide](https://docs.google.com/forms/d/e/1FAIpQLSfKHRJlZSUR-lKnQgfIWhe5GzM1CcMmO6Lf8ECvAY8DsFh1FA/viewform)
24
+
25
+
🗣️ **As the interviewee, your responsibilities are:**
26
+
- Ask clarifying questions
27
+
- Follow the steps in the [solving guide](https://docs.google.com/forms/d/e/1FAIpQLSfKHRJlZSUR-lKnQgfIWhe5GzM1CcMmO6Lf8ECvAY8DsFh1FA/viewform):
28
+
Step 1: Clarify
29
+
Step 2: Plan
30
+
Step 3: Implement
31
+
Step 4: Test
32
+
Step 5: Optimize
33
+
34
+
🪞 **After the first interview:**
35
+
Leave 10–15 minutes to reflect, share feedback, and then switch roles.
36
+
37
+
Best of luck, and enjoy the practice! 🚀
38
+
## Problem: Two Sum
39
+
40
+
Given an array of integers \`nums\` and an integer \`target\`, return indices of the two numbers such that they add up to target.
41
+
42
+
You may assume that each input would have exactly one solution, and you may not use the same element twice.
43
+
44
+
You can return the answer in any order.
45
+
46
+
**Note:** Values can be duplicated, you can short circuit, and it's guaranteed to have a solution.
47
+
48
+
### Examples:
49
+
50
+
**Example 1:**
51
+
- Input: nums = [2,7,11,15], target = 9
52
+
- Output: [0,1]
53
+
- Explanation: Because nums[0] + nums[1] == 9, we return [0, 1].
54
+
55
+
**Example 2:**
56
+
- Input: nums = [3,2,4], target = 6
57
+
- Output: [1,2]
58
+
59
+
**Example 3:**
60
+
- Input: nums = [3,3], target = 6
61
+
- Output: [0,1]
62
+
63
+
### Follow-up Questions:
64
+
- What is the time and space complexity of your solution?
65
+
- How would you optimize this if the array was sorted?
66
+
- What if we needed to find all pairs that sum to the target?
67
+
`,
68
+
exercises: [{
69
+
starterCode:`
70
+
/*
71
+
Problem: Two Sum
72
+
73
+
Given an array of integers nums and an integer target,
74
+
return indices of the two numbers such that they add up to target.
75
+
76
+
You may assume that each input would have exactly one solution,
77
+
and you may not use the same element twice.
78
+
79
+
You can return the answer in any order.
80
+
*/
81
+
function twoSum(nums, target) {
82
+
// Your code here
83
+
}`,
84
+
solution:`
85
+
/*
86
+
Problem: Two Sum
87
+
88
+
Given an array of integers nums and an integer target,
89
+
return indices of the two numbers such that they add up to target.
90
+
91
+
You may assume that each input would have exactly one solution,
92
+
and you may not use the same element twice.
93
+
94
+
You can return the answer in any order.
95
+
*/
96
+
function twoSum(nums, target) {
97
+
const map = new Map();
98
+
99
+
for (let i = 0; i < nums.length; i++) {
100
+
const complement = target - nums[i];
101
+
102
+
if (map.has(complement)) {
103
+
return [map.get(complement), i];
104
+
}
105
+
106
+
map.set(nums[i], i);
107
+
}
108
+
109
+
// This should never be reached given the problem constraints
questionJsx: <p>Your company is hiring four software development engineers from a pool of 12 candidates. The order in which the candidates are hired has no effect. How many distinct groups of four SDEs are there?</p>,
7
+
answers: [
8
+
"495",
9
+
"11,880",
10
+
"24",
11
+
"12"
12
+
],
13
+
correctAnswer: 0
14
+
},
15
+
{
16
+
type: QUESTION_TYPES.RADIO,
17
+
questionJsx: <p>You have an office with four unique walls ordered by N-S-E-W. You have enough room to hang 4 paintings, one on each wall. If you have 6 paintings to choose from, how many arrangements are there to hang the 4 paintings?</p>,
18
+
answers: [
19
+
"24",
20
+
"15",
21
+
"360",
22
+
"6"
23
+
],
24
+
correctAnswer: 2
25
+
},
26
+
{
27
+
type: QUESTION_TYPES.RADIO,
28
+
questionJsx: <p>Which of the following statements accurately describes combinations?</p>,
29
+
answers: [
30
+
"Combinations are groupings of items in which the order of the grouping matters.",
31
+
"Combinations are groupings of items in which the order of the grouping does not matter.",
32
+
"Combinations are the number of ways to arrange a certain number of objects.",
33
+
"Combinations are calculated by multiplying the number of available possibilities."
34
+
],
35
+
correctAnswer: 1
36
+
},
37
+
{
38
+
type: QUESTION_TYPES.RADIO,
39
+
questionJsx: <p>Your company issues each employee a five-letter ID code. The code is composed of the letters A, B, C, D, E, F, G, and H. The same letter cannot appear twice in a single ID code. How many unique three-letter ID codes are there?</p>,
40
+
answers: [
41
+
"56",
42
+
"512",
43
+
"40,320",
44
+
"336",
45
+
],
46
+
correctAnswer: 3
47
+
},
48
+
{
49
+
type: QUESTION_TYPES.RADIO,
50
+
questionJsx: <p>Given a list of 9 elements, how many combinations of 5 are there?</p>,
51
+
answers: [
52
+
"120",
53
+
"15,120",
54
+
"59,049",
55
+
"126",
56
+
],
57
+
correctAnswer: 3
58
+
},
59
+
{
60
+
type: QUESTION_TYPES.RADIO,
61
+
questionJsx: <p>Which of the following statements accurately describes permutations?</p>,
62
+
answers: [
63
+
"Permutations are groupings of items in which the order does not matter.",
64
+
"Permutations are groupings of items in which the order matters",
65
+
"There are generally more combinations than permutations for the same data set.",
66
+
"Permutations are calculated by adding up all the elements in a data set."
67
+
],
68
+
correctAnswer: 1
69
+
}
70
+
];
71
+
72
+
exportdefault{
73
+
id: 'c9d3a5b8',
74
+
title: 'Combinations and Permutations Quiz',
75
+
sectionId: 'just-enough-math',
76
+
previousChapterId: null,
77
+
content: `Test your understanding of combinations, permutations, and their applications in organizing and counting data.`,
0 commit comments