注册一亩三分地论坛,查看更多干货!
您需要 登录 才可以下载或查看附件。没有帐号?注册账号 
x
ASSESSMENT QUESTIONS
Coding problems, then quiz questions 1–3, 7–23 and 26–40 of 40 (questions 4–6, 24 and 25 were not shared). Picture-based questions are described in words.
==================================================
CODING 1 — Card game
Two players and a sequence of n cards (n is even, each card is a positive integer). Players alternate turns; each turn a player takes the card at the left or right end and adds its value to their score. Both start at 0, both know the whole sequence and play optimally.
Implement max_score(cards), which takes a list of integers (first = left end, last = right end) and returns the final score of the player who goes first.
Example: [1, 9, 10, 5, 6, 4]
CODING 2 — Polynomial coefficients (Ruby)
polynom is a string (no spaces) representing a quadratic expression whose components x², x and the constant may appear several times in any order, for example:- 5x + 7x² + 4 + x² − 24x (written in the input as "5x+7x^2+4+x^2-24x")
复制代码 Return an array of 3 integers: the final coefficients of x², x and 1. For the example the result is [8, −19, 4].
Remarks: • The first term may have no sign (consider it +). • x and x² without a number have coefficient 1. • Some components may be absent. • Length of polynom is between 1 and 50. • Coefficients are between −1,000,000 and +1,000,000.
Implement the method compute(polynom).
CODING 3 — Macaron order price (C++)
Each macaron has the same unit price p and a flavor; there are at most 5 distinct flavors. An order is made of sets of up to 5 macarons with no repeated flavor; the baker fills sets to the maximum. Discount by number of distinct flavors in a set:
• 2 flavors → −10% • 3 flavors → −20% • 4 flavors → −30% • 5 flavors → −40%
Implement compute_total_price(unit_price, macarons), returning the total as an integer (rounded down).
Examples (given): • p = 1: (100% − 40%) × (5 × 1) + (100% − 0%) × (1 × 1) = 4 • p = 4: (100% − 10%) × (2 × 4) + (100% − 10%) × (2 × 4) = 14.4 → 14 • p = 4: (100% − 20%) × (3 × 4) + (100% − 0%) × (1 × 4) = 13.6 → 13
==================================================
MULTIPLE-CHOICE QUIZ
Question 1 / 40 A clothing store sells 300 skirts in January. If the number of skirts it sells in February is 40% higher, how many skirts will it sell in February? Options: 120 / 540 / 340 / 360 / 420
Question 2 / 40 A team of workers can assemble 7 engines in an hour. How many engines can they assemble in 8 hours? Options: 56 / 60 / 64 / 72 / 81
Question 3 / 40 How many of the four pictures in the left hand column are exactly the same as the corresponding picture in the right hand column? [Figure] Four pairs of 3D drawings of stacked blocks and cylinders. Options: 0 / 1 / 2 / 3 / 4
Question 7 / 40 Assume the first two statements are true. Is the final statement: 1) True, 2) False, or 3) Uncertain based on the information provided? • All of the meeting attendees are over fifty years old. • Sally attended the meeting. • Final statement: Sally is over fifty years old. Options: True / False / Uncertain
Question 8 / 40 Assume the first two statements are true. Is the final statement: 1) True, 2) False, or 3) Uncertain based on the information provided? • John is not friends with anyone who plays football. • Thomas plays football. • Final statement.25 / $35 / $32.75 / $37.50 / $28.50
Question 35 / 40 A recipe calls for a total of 2 cups of sugar. If the recipe says to use ¼ of the sugar at the beginning of the recipe and the remaining ¾ at the end, how much sugar will be used at the beginning of the recipe? Options: ¼ cup / ½ cup / ⅔ cup / 1 cup / 1½ cups
Question 36 / 40 Which of the following does not belong? [Figure] Nested shapes (outer, middle, inner): A circle/square/triangle, B square/triangle/square, C circle/triangle/square, D square/circle/triangle, E square/triangle/circle. Options: A / B / C / D / E
Question 37 / 40 Which of the following does not belong? [Figure] Each box has two rows of three symbols. A: filled circle, square, X / X, filled circle, square. B: open circle, square, + / +, open circle, square. C: +, X, diamond / diamond, +, X. D: diamond, filled circle, open circle / open circle, diamond, filled circle. E: diamond, +, filled circle / +, filled circle, diamond. Options: A / B / C / D / E
Question 38 / 40 What is the average number of applicants to College A over the given period? Line chart "Number of Applicants to College A and College B from 2011 to 2014". College A (approx.): 2011: 9,250; 2012: 10,500; 2013: 9,000; 2014: 11,000 to 11,250. Options: 7,250 / 8,250 / 9,250 / 10,250 / 11,250
Question 39 / 40 If there is a 50% chance of rain on Saturday, and a 50% chance of rain on Sunday, what is the chance that it will rain on NEITHER of the two days? Options: 0% / 25% / 38% / 50% / 75%
Question 40 / 40 If a consumer purchases a car for $20,000, and it depreciates in value by 20% each year, what will the car's value be after 3 years? Options: $9,560 / $10,240 / $11,260 / $12,500 / $14,000 |