Skip to content

altermarkive/training

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Training

General Remarks

  • Talk through your thinking process, flag uncertainty
  • Be: fast, positive/enthusiastic/passionate, transparent, fact-based, methodical, and express explicitly (to prevent hidden assumptions and getting stuck)
  • If stuck: remain calm, check asumptions, try more examples, simplify, ask, avoid silence or filling it

Algorithm Design

1. Disambiguate / Clarify by example (✅ ❎)

  • Missing details? Special cases & their indication / handling?
  • Restrictions? Guarantees?
  • Types? Ranges? Sizes? Cardinality? How often? Unique / repetitions / empty / partially ordered?
  • Can I modify the input data structure?
  • Function signature & spec?
  • Accounted for entirety of interviewer's description?
  • Beware of: assumptions, "familiar" exercises, early optimization; Start simple

2. Talk through the design process / List ideas

  • List alternatives telling their pros and cons (e.g. time/space complexity); is there a time vs. space trade-off?
  • Tactic: Write (or draw) examples to identify a pattern
  • Tactic: Simplify (relax constraints) then generalize
  • Tactic: Base case & build up (induction, scale), dyn. prog.
  • Tactic: Match to other similar problem / data struct. (for example: heap, graph, stack, etc.)
  • Tactic: (Consider greedy alg., backtracking, iterating the smaller param.)
  • Pick one achievable in an interview (solution likely to be simple enough); indicate complexity

3. Code

  • Pick a data structure
  • Modularize (break-up code into distinct parts for clarity)
  • Test input (as a remark)
  • Beware of < vs <=, +1 vs +0, null checks, overflows
  • Code must compile - obey syntax, but okay to ask if don't remember name or behavior

4. Test

  • Describe how would you test, run through a simple case
  • Normal case
  • Non-trivial, corner cases
  • Full coverage time permitting
  • (Other: invalid input, randomized tests, load testing)
  • Point out options for refactoring (?)

5. Keep improving - can we do better?

Status Python Status Rust Coverage

Additional Materials


System Design

0. Be the tech lead

  • Iterate quickly on the design while prioritizing what to work on next
  • Communicate trade-offs, decissions
  • Have a dialog with your stakeholder (interviewer)
  • Dare to ask for help if necessary (but own it with confidence)

1. Explore and understand

  • Go from an ill-defined goal to a formulated statement of what to build (and what is out of scope)
  • Disambiguate, gather requirements - ask clarifying questions (missing details or restrictions) - beware of assumptions!
  • Agree on scope / use cases (First a minimum viable product then explore other functions - embodiment, features, feature aspects/specifics, scale/numbers: Mobile vs. web? API vs UI? Customizable? Monetization? Descending or random order? Analytics? Scale / numbers?)

2. Design - break down the system into simple parts

  • Start with basic, abstract design (e.g. key-value store, web server)
  • Delineate what is where (cloud, user's equipment)
  • Describe how the user interacts with the system and what is the sequence (of inner system interactions)
  • Prioritize the next steps

3. Scale-up / distribute

  • Say what can fail / overflow / bottleneck, trade-offs (CAP theorem - consistency, availability, partitioning),
  • Say how to distribute and how to fix whats broken by distributing
  • Show specific alternatives / solution space
  • Ballpark estimates
  • If you do not know something - be upfront about it but do offer a direction
  • If you are particularly familiar with an aspect - do mention it

4. Iterate

  • Is anything missing (look closer at details/aspects)?
  • How would it change the behavior of users?

Additional materials


Other Materials