1. Home
  2. Explore
  3. Computer Science
  4. John Ousterhout Google Talk

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

John Ousterhout Google Talk

  • 26Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: Core Concepts

According to John Ousterhout, what is the most important concept in all of computer science?

26 questions

  1. 1

    According to John Ousterhout, what is the most important concept in all of computer science?

    1. A

      Problem decomposition

    2. B

      Layers of abstraction

    3. C

      Complexity management

    4. D

      Abstraction

    Correct answer
    A

    Problem decomposition

    Explanation

    Ousterhout explicitly states that problem decomposition—how to chop up a complicated problem into pieces that can be built independently—is the most important concept, more so than abstraction or layering.

  2. 2

    How does CS 190 Software Design Studio primarily teach software design?

    1. A

      Through lectures on design patterns

    2. B

      By assigning readings from classic software engineering papers

    3. C

      By having students build large systems iteratively with code reviews

    4. D

      Through team-based competitions to build the fastest code

    Correct answer
    C

    By having students build large systems iteratively with code reviews

    Explanation

    The course uses an iterative approach where students build a system, receive code reviews, revise, and repeat, similar to how English writing is taught.

  3. 3

    In the original version of CS 190, what did students do in the third phase?

    1. A

      They started a new project from scratch

    2. B

      They added features to another team's project

    3. C

      They refactored their own project from phase one

    4. D

      They merged all team projects into one system

    Correct answer
    B

    They added features to another team's project

    Explanation

    In the first two offerings, the third phase required students to add features to another team's project. Ousterhout later changed it to starting a new project from scratch to focus more on design.

  4. 4

    How many lines of code does Ousterhout typically read during a code review week?

    1. A

      Less than 1,000

    2. B

      50,000 to 100,000

    3. C

      5,000 to 10,000

    4. D

      20,000 to 30,000

    Correct answer
    D

    20,000 to 30,000

    Explanation

    Ousterhout states he reads 20,000 to 30,000 lines of code in a week during the code review phase.

  5. 5

    What is a 'deep class' according to Ousterhout's design principle?

    1. A

      A class with a simple interface but significant underlying functionality

    2. B

      A class that inherits from many base classes

    3. C

      A class with a complex interface that hides little implementation

    4. D

      A class with a large number of methods

    Correct answer
    A

    A class with a simple interface but significant underlying functionality

    Explanation

    A deep class has a small interface (low cost) and large functionality (high benefit), providing a good abstraction that hides complexity.

  6. 6

    Which of the following is an example of a shallow class or method?

    1. A

      A database connection pool

    2. B

      Unix file I/O interface with five functions

    3. C

      TCP/IP protocol stack

    4. D

      A getFoo method that simply returns a field

    Correct answer
    D

    A getFoo method that simply returns a field

    Explanation

    A getFoo method is shallow because it has almost no implementation and the interface is essentially the implementation, providing no information hiding.

  7. 7

    What is 'classitis'?

    1. A

      The belief that more classes are always better, leading to many small shallow classes

    2. B

      The tendency to make classes too large and monolithic

    3. C

      The overuse of inheritance hierarchies

    4. D

      The practice of using abstract base classes for all designs

    Correct answer
    A

    The belief that more classes are always better, leading to many small shallow classes

    Explanation

    Classitis is when developers create many tiny classes each adding minimal functionality, resulting in shallow abstractions. Ousterhout cites the Java Class Library as an example.

  8. 8

    According to Ousterhout, what is the ideal way to handle exceptions?

    1. A

      Use return codes instead of exceptions

    2. B

      Throw exceptions for every possible error condition

    3. C

      Catch all exceptions at the top level and log them

    4. D

      Redefine semantics so that the error condition no longer exists

    Correct answer
    D

    Redefine semantics so that the error condition no longer exists

    Explanation

    The best approach is to 'define errors out of existence' by changing the semantics so that the exceptional case becomes normal behavior, eliminating the need for exception handling.

  9. 9

    How did Unix solve the problem of deleting an open file?

    1. A

      It deletes the directory entry but keeps the file data until all handles are closed

    2. B

      It prevents deletion if any process has the file open

    3. C

      It moves the file to a temporary location and deletes it later

    4. D

      It returns an error and requires the process to close the file first

    Correct answer
    A

    It deletes the directory entry but keeps the file data until all handles are closed

    Explanation

    Unix removes the directory entry immediately, but the file's data persists until the last open handle is closed, allowing processes to continue accessing it without errors.

  10. 10

    What was the mistake in the original Tcl 'unset' command?

    1. A

      It could not delete multiple variables at once

    2. B

      It was case-sensitive, causing confusion

    3. C

      It required explicit variable quoting

    4. D

      It threw an exception when attempting to delete a non-existent variable

    Correct answer
    D

    It threw an exception when attempting to delete a non-existent variable

    Explanation

    Ousterhout made unset throw an exception if the variable didn't exist, but in practice users often needed to delete variables that might not exist, leading to cumbersome catch blocks. He later realized it should simply do nothing in that case.

  11. 11

    According to Ousterhout, what should Java's substring method do instead of throwing exceptions for out-of-range indices?

    1. A

      Return an empty string immediately

    2. B

      Modify the string to match the requested range

    3. C

      Clip the indices to the string's range and return the overlapping portion

    4. D

      Throw a different type of exception

    Correct answer
    C

    Clip the indices to the string's range and return the overlapping portion

    Explanation

    Ousterhout suggests that substring should return the overlap between the requested indices and the available string, so that out-of-range requests simply return a subset or empty string, eliminating the need for exception handling.

  12. 12

    In the tactical programming approach, what is the primary goal?

    1. A

      To write comprehensive unit tests before any implementation

    2. B

      To produce a great design that will pay off in the future

    3. C

      To get something working as quickly as possible, even if it means cutting corners

    4. D

      To refactor existing code for better structure

    Correct answer
    C

    To get something working as quickly as possible, even if it means cutting corners

    Explanation

    Tactical programming focuses on getting the next feature or bug fix working, often at the expense of design quality. Ousterhout argues this leads to accumulation of complexity.

  13. 13

    What is a 'tactical tornado'?

    1. A

      A programmer who writes excellent code at very high speed

    2. B

      A tool that automatically refactors code

    3. C

      A manager who prioritizes design over deadlines

    4. D

      A developer who produces large amounts of shoddy code quickly and is considered a hero

    Correct answer
    D

    A developer who produces large amounts of shoddy code quickly and is considered a hero

    Explanation

    A tactical tornado is a programmer who churns out enormous amounts of low-quality code rapidly, often seen as a hero by management despite leaving a trail of complexity.

  14. 14

    According to Ousterhout, how much slower should you be willing to go initially when investing in design?

    1. A

      10% to 20% slower

    2. B

      At least 50% slower

    3. C

      Twice as slow to ensure perfection

    4. D

      The same speed, just with better planning

    Correct answer
    A

    10% to 20% slower

    Explanation

    Ousterhout suggests that a 10% to 20% initial slowdown is affordable and will pay back within months, making the overall speed higher in the long run.

  15. 15

    What change did Facebook make to its company motto after realizing the problems with its code base?

    1. A

      From 'Move fast and fix things' to 'Move thoughtfully with robust infrastructure'

    2. B

      From 'Move quickly and break things' to 'Move quickly with solid infrastructure'

    3. C

      From 'Move fast and break things' to 'Move fast with stable infrastructure'

    4. D

      From 'Move quickly and innovate' to 'Move steadily with quality assurance'

    Correct answer
    B

    From 'Move quickly and break things' to 'Move quickly with solid infrastructure'

    Explanation

    Facebook changed its motto from 'move quickly and break things' to 'move quickly with solid infrastructure' after acknowledging the mess in their code base.

  16. 16

    Which companies does Ousterhout cite as examples of having strong design cultures?

    1. A

      Google and VMware

    2. B

      Facebook and Twitter

    3. C

      Apple and Intel

    4. D

      Microsoft and Amazon

    Correct answer
    A

    Google and VMware

    Explanation

    Ousterhout mentions that Google and VMware were known for their strong design culture, particularly in the early 2000s, attracting top programmers.

  17. 17

    What is one of the biggest challenges for the strategic programming approach?

    1. A

      It eliminates the need for unit testing

    2. B

      It requires complete upfront design before any coding

    3. C

      Managers often push for quick features, making it hard to invest time in design

    4. D

      It is only applicable to large-scale systems

    Correct answer
    C

    Managers often push for quick features, making it hard to invest time in design

    Explanation

    Ousterhout notes that managers often prioritize features and releases, making it difficult to invest in design. He suggests having great engineers advocate for design culture to management.

  18. 18

    How does Ousterhout suggest programmers should approach changes to existing code?

    1. A

      Make the smallest possible change to minimize risk

    2. B

      Rewrite the entire module from scratch

    3. C

      Always look for something to improve, even if just to break even on complexity

    4. D

      Avoid modifying existing code unless absolutely necessary

    Correct answer
    C

    Always look for something to improve, even if just to break even on complexity

    Explanation

    Ousterhout advises that when changing code, you should strive to improve the design, because your changes likely add some complexity. Aim to leave the code cleaner than you found it.

  19. 19

    What role do red flags play in Ousterhout's design philosophy?

    1. A

      They are signs that a class is too deep

    2. B

      They are specific patterns indicating that a design is likely flawed

    3. C

      They are used to mark code that needs optimization

    4. D

      They are compiler warnings that must be eliminated

    Correct answer
    B

    They are specific patterns indicating that a design is likely flawed

    Explanation

    Ousterhout describes red flags as specific, recognizable patterns that signal trouble in the design. Beginners can use them to know when to change direction.

  20. 20

    According to Ousterhout, why is complexity in software so hard to fix once it accumulates?

    1. A

      Because modern tools make refactoring impossible

    2. B

      Because it usually results from a single large mistake

    3. C

      Because management rarely approves refactoring efforts

    4. D

      Because it comes from hundreds of small mistakes spread across many places

    Correct answer
    D

    Because it comes from hundreds of small mistakes spread across many places

    Explanation

    Complexity is not a single big mistake but thousands of small ones made by many people over time, making it overwhelming to address.

  21. 21

    What hiring advice does Ousterhout give?

    1. A

      Use coding challenges that focus on algorithms only

    2. B

      Hire for slope (learning ability) rather than y-intercept (current knowledge)

    3. C

      Prioritize candidates from top-tier universities

    4. D

      Look for candidates with the most experience in the specific technology you use

    Correct answer
    B

    Hire for slope (learning ability) rather than y-intercept (current knowledge)

    Explanation

    Ousterhout argues that hiring for slope—the ability to learn quickly—is more valuable than hiring for current specific skills, especially in a startup where needs change rapidly.

  22. 22

    What is Hyrum's Law?

    1. A

      Software complexity grows until it becomes unmaintainable

    2. B

      Adding more developers to a late project makes it later

    3. C

      Every abstraction leaks

    4. D

      With enough users, all observable behaviors of an API will be depended on, regardless of the contract

    Correct answer
    D

    With enough users, all observable behaviors of an API will be depended on, regardless of the contract

    Explanation

    Hyrum's Law states that given enough usage, every observable behavior of an API—even unintended ones—will be relied upon by some user, making it hard to change.

  23. 23

    Does Ousterhout believe that the choice of programming language significantly impacts software design quality?

    1. A

      No, but language choice affects performance more than design

    2. B

      No, design principles are fairly universal across languages

    3. C

      Yes, object-oriented languages are always better

    4. D

      Yes, functional languages produce better designs

    Correct answer
    B

    No, design principles are fairly universal across languages

    Explanation

    Ousterhout states that design principles are universal and can be applied in any language. He cites Unix file I/O in C as an example of great design.

  24. 24

    In Ousterhout's class, why does he not include unit testing?

    1. A

      He believes unit testing is unnecessary for good design

    2. B

      The class projects are too small for meaningful unit tests

    3. C

      Students are expected to learn unit testing on their own

    4. D

      The course is only 10 weeks and he focuses on design; unit testing is a distraction

    Correct answer
    D

    The course is only 10 weeks and he focuses on design; unit testing is a distraction

    Explanation

    Ousterhout decided to omit unit testing from the course because it would take time away from design instruction, given the limited 10-week quarter.

  25. 25

    What was Ousterhout's motivation for writing the book 'A Philosophy of Software Design'?

    1. A

      To provide a step-by-step recipe for software design

    2. B

      To promote his course at Stanford

    3. C

      To document his research on software engineering

    4. D

      To reach a wider audience and start a conversation about design

    Correct answer
    D

    To reach a wider audience and start a conversation about design

    Explanation

    Ousterhout wrote the book to reach more people than his class can, and to kick-start a discussion on software design principles within the community.

  26. 26

    According to Ousterhout, what is the key reason why tactical programming leads to poor design?

    1. A

      It discourages code reuse

    2. B

      It encourages too much upfront planning

    3. C

      Small shortcuts and kludges accumulate rapidly

    4. D

      It relies on premature optimization

    Correct answer
    C

    Small shortcuts and kludges accumulate rapidly

    Explanation

    In tactical programming, each small shortcut seems harmless, but they accumulate quickly from many developers, resulting in an unmanageable, spaghetti-like codebase.

Question 1 of 26
Question 1 of 26

Ask anything

We've read this whole study set, so questions about it get the best answers.

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent