goals into categories based on the stake holders we decompose the architecture itself into frontend and back-end the front-end is divided into user managementweb page designreporting functionalityetc the back-end is made up of middlewarestoragedatabasecron servicesand algorithms for ranking ads decomposing code is hallmark of object-oriented programming the subject of design patterns is concerned with finding good ways to achieve code-reuse broadly speakingdesign patterns are grouped into creationalstructuraland behavioral patterns many specific patterns are very natural--strategy objectsadaptersbuildersetc appear in number of places in our codebase freeman et al ' "head first design patternsisin our opinionthe right place to study design patterns scalability in the context of interview questions parallelism is useful when dealing with scalei when the problem is too large to fit on single machine or would take an unacceptably long time on single machine the key insight you need to display is that you know how to decompose the problem so that each subproblem can be solved relatively independentlyand the solution to the original problem can be efficiently constructed from solutions to the subproblems efficiency is typically measured in terms of central processing unit (cputimerandom access memory (ram)network bandwidthnumber of memory and database accessesetc consider the problem of sorting petascale integer array if we know the distribution of the numbersthe best approach would be to define equal-sized ranges of integers and send one range to one machine for sorting the sorted numbers would just need to be concatenated in the correct order if the distribution is not known then we can send equal-sized arbitrary subsets to each machine and then merge the sorted resultse using min-heap caching is great tool whenever computations are repeated for examplethe central idea behind dynamic programming is caching results from intermediate computations caching is also extremely useful when implementing service that is expected to respond to many requests over timeand many requests are repeated workloads on web services exhibit this property design system for detecting copyright infringement youtv com is successful online video sharing site hollywood studios complain that much of the material uploaded to the site violates copyright design feature that allows studio to enter set of videos that belong to itand to determine which videos in the youtv com database match videos in hintnormalize the video format and create signatures solutionvideos differ from documents in that the same content may be encoded in many different formatswith different resolutionsand levels of compression one way to reduce the duplicate video problem to the duplicate document problem is to reencode all videos to common formatresolutionand compression level this in itself does not