EduFlow
Advanced TypeScript Patterns

Final assessment

Twelve questions across the whole course. Score 70% or more to pass and unlock your certificate. You can retake it as often as you like.

Finish every lesson to earn the certificate — you can take the assessment any time.

Question 1 of 12

Which pair of changes makes both cancelOrder(customer.id) and add(usdPrice, eurShipping) compile errors?

Question 2 of 12

What is the type of summary?

TypeScript
function pick<T, K extends keyof T>(obj: T, ...keys: K[]): Pick<T, K> { /* … */ }
const summary = pick(order, 'id', 'status');
Question 3 of 12

A customer’s saved cart in localStorage was written by last year’s version of the app, with a different shape. What is the right way to load it?

Question 4 of 12

What is NoNulls<{ coupon: string | null; note?: string }>?

TypeScript
type NoNulls<T> = { [K in keyof T]: NonNullable<T[K]> };
Question 5 of 12

The payments team adds 'requires-3ds' to the PaymentError union. errorMessage(e: PaymentError): string switches on e.type with no default. What happens?

Question 6 of 12

Which string is assignable to type OrderPath = `/orders/${number}`?

Question 7 of 12

After turning on noUncheckedIndexedAccess, which line becomes a compile error (with lines: Line[])?

Question 8 of 12

charge is decorated with @retry(3) on the line above @logged. The gateway fails twice, then succeeds. How many log lines does logged print for one call?

Question 9 of 12

Why can a DetailedOrder (id, status, totalCents, customer) be passed where an Order (id, status, totalCents) is expected, but not the other way round?

Question 10 of 12

Which signature is an unchecked cast in disguise?

Question 11 of 12

What does declare module 'legacy-shipping-calc'; with no body do?

Question 12 of 12

Which file should you convert to TypeScript first in a migration?

12 questions unanswered