Total - Information taken from Wikipedia, Google Website, "Hacking a Google Interview" by Bill Jacobs and Curtis Fonger, Topcoder.com Data Science Tutorials, Design Patterns Explained Simply Flashcards
Quicksort (Best, Average, Worst, Memory, Stable)
Best = n log(n) but there exists a variation that results in n
Average = n log(n)
Worst = n^2
Memory = log(n) on average with a worst case of n
Stable = Typical in place sort is not stable but stable versions exist
Note: Quicksort is usually done in-place with O(log n) stack space.
Merge sort (Best, Average, Worst, Memory, Stable)
Best = n log(n) Average = n log(n) Worst = n log(n) Memory = n but there is a hybrid block merge sort with a requirement of only O(1) Stable = Yes Note: Highly parallelizable
Heapsort (Best, Average, Worst, Memory, Stable)
Best = n log(n) Average = n log(n) Worst = n log(n) Memory = 1 Stable = No
Insertion sort (Best, Average, Worst, Memory, Stable)
Best = n Average = n^2 Worst = n^2 Memory = 1 Stable = Yes Note: Technically O(n+d) in the worst case over sequences that have d inversions.
Introsort (Best, Average, Worst, Memory, Stable)
Best = n log(n) Average = n log(n) Worst = n log(n) Memory = log(n) Stable = No Note: Used in several STL implementations. Works by using Quicksort to a specific depth (e.g. 2 log2(n) for GNU Standard C++) and then applies Heapsort at that level.
Selection sort (Best, Average, Worst, Memory, Stable)
Best = n^2 Average = n^2 Worst = n^2 Memory = 1 Stable = No Note: Can be stable with O(n) extra space.
Timsort (Best, Average, Worst, Memory, Stable)
Best = n Average = n log(n) Worst = n log(n) Memory = n Stable = Yes Note: Makes n comparisons when the data is already sorted or reverse sorted. BASIC description is that it works by finding "runs" in either direction (though must be "strictly" descending) and flips them appropriately and then merges them.
What are (at least 5 of) the “10 things we know to be true” at Google?
- Focus on the user and all else will follow.
- It’s best to do one thing really, really well.
- Fast is better than slow.
- Democracy on the web works.
- You don’t need to be at your desk to need an answer.
- You can make money without doing evil.
- There’s always more information out there.
- The need for information crosses all borders.
- You can be serious without a suit.
- Great just isn’t good enough.
What does Google mean when they say “Focus on the user and all else will follow.”?
Since the beginning, we’ve focused on providing the best user experience possible. Whether we’re designing a new Internet browser or a new tweak to the look of the homepage, we take great care to ensure that they will ultimately serve you, rather than our own internal goal or bottom line. Our homepage interface is clear and simple, and pages load instantly. Placement in search results is never sold to anyone, and advertising is not only clearly marked as such, it offers relevant content and is not distracting. And when we build new tools and applications, we believe they should work so well you don’t have to consider how they might have been designed differently.
What does Google mean when they say “It’s best to do one thing really, really well.”?
We do search. With one of the world’s largest research groups focused exclusively on solving search problems, we know what we do well, and how we could do it better. Through continued iteration on difficult problems, we’ve been able to solve complex issues and provide continuous improvements to a service that already makes finding information a fast and seamless experience for millions of people. Our dedication to improving search helps us apply what we’ve learned to new products, like Gmail and Google Maps. Our hope is to bring the power of search to previously unexplored areas, and to help people access and use even more of the ever-expanding information in their lives.
What does Google mean when they say “Fast is better than slow.”?
We know your time is valuable, so when you’re seeking an answer on the web you want it right away–and we aim to please. We may be the only people in the world who can say our goal is to have people leave our website as quickly as possible. By shaving excess bits and bytes from our pages and increasing the efficiency of our serving environment, we’ve broken our own speed records many times over, so that the average response time on a search result is a fraction of a second. We keep speed in mind with each new product we release, whether it’s a mobile application or Google Chrome, a browser designed to be fast enough for the modern web. And we continue to work on making it all go even faster.
What does Google mean when they say “Democracy on the web works.”?
Google search works because it relies on the millions of individuals posting links on websites to help determine which other sites offer content of value. We assess the importance of every web page using more than 200 signals and a variety of techniques, including our patented PageRank™ algorithm, which analyzes which sites have been “voted” to be the best sources of information by other pages across the web. As the web gets bigger, this approach actually improves, as each new site is another point of information and another vote to be counted. In the same vein, we are active in open source software development, where innovation takes place through the collective effort of many programmers.
What does Google mean when they say “You don’t need to be at your desk to need an answer.”?
The world is increasingly mobile: people want access to information wherever they are, whenever they need it. We’re pioneering new technologies and offering new solutions for mobile services that help people all over the globe to do any number of tasks on their phone, from checking email and calendar events to watching videos, not to mention the several different ways to access Google search on a phone. In addition, we’re hoping to fuel greater innovation for mobile users everywhere with Android, a free, open source mobile platform. Android brings the openness that shaped the Internet to the mobile world. Not only does Android benefit consumers, who have more choice and innovative new mobile experiences, but it opens up revenue opportunities for carriers, manufacturers and developers.
What does Google mean when they say “You can make money without doing evil.”?
Google is a business. The revenue we generate is derived from offering search technology to companies and from the sale of advertising displayed on our site and on other sites across the web. Hundreds of thousands of advertisers worldwide use AdWords to promote their products; hundreds of thousands of publishers take advantage of our AdSense program to deliver ads relevant to their site content. To ensure that we’re ultimately serving all our users (whether they are advertisers or not), we have a set of guiding principles for our advertising programs and practices:
1) We don’t allow ads to be displayed on our results pages unless they are relevant where they are shown. And we firmly believe that ads can provide useful information if, and only if, they are relevant to what you wish to find–so it’s possible that certain searches won’t lead to any ads at all.
2) We believe that advertising can be effective without being flashy. We don’t accept pop–up advertising, which interferes with your ability to see the content you’ve requested. We’ve found that text ads that are relevant to the person reading them draw much higher clickthrough rates than ads appearing randomly. Any advertiser, whether small or large, can take advantage of this highly targeted medium.
3) Advertising on Google is always clearly identified as a “Sponsored Link,” so it does not compromise the integrity of our search results. We never manipulate rankings to put our partners higher in our search results and no one can buy better PageRank. Our users trust our objectivity and no short-term gain could ever justify breaching that trust.
What does Google mean when they say “There’s always more information out there.”?
Once we’d indexed more of the HTML pages on the Internet than any other search service, our engineers turned their attention to information that was not as readily accessible. Sometimes it was just a matter of integrating new databases into search, such as adding a phone number and address lookup and a business directory. Other efforts required a bit more creativity, like adding the ability to search news archives, patents, academic journals, billions of images and millions of books. And our researchers continue looking into ways to bring all the world’s information to people seeking answers.
What does Google mean when they say “The need for information crosses all borders.”?
Our company was founded in California, but our mission is to facilitate access to information for the entire world, and in every language. To that end, we have offices in more than 60 countries, maintain more than 180 Internet domains, and serve more than half of our results to people living outside the United States. We offer Google’s search interface in more than 130 languages, offer people the ability to restrict results to content written in their own language, and aim to provide the rest of our applications and products in as many languages and accessible formats as possible. Using our translation tools, people can discover content written on the other side of the world in languages they don’t speak. With these tools and the help of volunteer translators, we have been able to greatly improve both the variety and quality of services we can offer in even the most far–flung corners of the globe.
What does Google mean when they say “You can be serious without a suit.”?
Our founders built Google around the idea that work should be challenging, and the challenge should be fun. We believe that great, creative things are more likely to happen with the right company culture–and that doesn’t just mean lava lamps and rubber balls. There is an emphasis on team achievements and pride in individual accomplishments that contribute to our overall success. We put great stock in our employees–energetic, passionate people from diverse backgrounds with creative approaches to work, play and life. Our atmosphere may be casual, but as new ideas emerge in a café line, at a team meeting or at the gym, they are traded, tested and put into practice with dizzying speed–and they may be the launch pad for a new project destined for worldwide use.
What does Google mean when they say “Great just isn’t good enough.”?
We see being great at something as a starting point, not an endpoint. We set ourselves goals we know we can’t reach yet, because we know that by stretching to meet them we can get further than we expected. Through innovation and iteration, we aim to take things that work well and improve upon them in unexpected ways. For example, when one of our engineers saw that search worked well for properly spelled words, he wondered about how it handled typos. That led him to create an intuitive and more helpful spell checker.
Even if you don’t know exactly what you’re looking for, finding an answer on the web is our problem, not yours. We try to anticipate needs not yet articulated by our global audience, and meet them with products and services that set new standards. When we launched Gmail, it had more storage space than any email service available. In retrospect offering that seems obvious–but that’s because now we have new standards for email storage. Those are the kinds of changes we seek to make, and we’re always looking for new places where we can make a difference. Ultimately, our constant dissatisfaction with the way things are becomes the driving force behind everything we do.
Products under Web
Web Search
Google Chrome
Toolbar
Bookmarks
Product - Web Search
Search billions of web pages
Product - Google Chrome
A browser built for speed, simplicity and security
Product - Toolbar
Add a search box to your browser (Note that this is for browsers that are not Chrome)
Product - Bookmarks
Access your bookmarks and starred items
Products under Business
AdWords G Suite Google Cloud Platform Google My Business AdSense AdMob Analytics Google Domains
Product - AdWords
Attract more customers and only pay for results (This is to put your advertisements on other people’s websites.)
Product - G Suite
Get email, docs, storage and more, customized for your business
Product - Google Cloud Platform
Build and host applications and websites, store and analyze data on Google’s scalable infrastructure
Product - Google My Business
Make sure your business looks great on Google Search, Maps and Google+ for free
Product - AdSense
Create online revenue today (This is to put advertisements on your website.)
Product - AdMob
Make money from your apps
Product - Analytics
Know your audience and analyze traffic
Product - Google Domains
Find a domain a build a website for your business
Products under Media
YouTube Google Play Books Image Search News Video Search Google Photos Google Cardboard
Product - YouTube
Watch, upload and share videos
Product - Google Play
Your music, movies, books, and Android apps, available anywhere
Product - Books
Search the full text of books
Product - Image Search
Search for images on the web
Product - News
Search thousands of news stories
Product - Video Search
Search for videos on the web
Product - Google Photos
All your photos on all you devices, organized and easy to share
Product - Google Cardboard
Experience virtual reality in a simple, fun, and affordable way
Products under Geo
Maps
Earth
Product - Maps
View maps and directions
Product - Earth
Explore the world from your computer
Products under Specialized Search
Custom Search Google Shopping Finance Scholar Trends Google Flights
Product - Custom Search
Create a customized search experience for your community
Product - Google Shopping
Search for stuff to buy
Product - Finance
Business info, news and interactive charts
Product - Scholar
Search scholarly papers
Product - Trends
Explore past and present search trends
Product - Google Flights
Find flights, track prices and book your next destination
Products under Home & Office
Gmail Drive Docs Sheets Slides Forms Drawings Sites Calendar Translate Voice Google Wallet Google Cloud Print Google Keep Google Store Hangouts
Product - Gmail
Fast, searchable email with less spam
Product - Drive
Create, share and keep all your stuff in one place
Product - Docs
Open, edit, and create documents
Product - Sheets
Open, edit and create spreadsheets
Product - Slides
Open, edit and create presentations
Product - Forms
Build free surveys
Product - Drawings
Create diagrams and flow charts
Product - Sites
Create websites and secure group wikis
Product - Calendar
Organize your schedule and share events with friends
Product - Translate
Instantly translate text, web pages, and files between over 50 languages
Product - Voice
One number for all your phones, online voicemail and cheap calling
Product - Google Wallet
Make your phone your wallet
Product - Google Cloud Print
Print anywhere, from any device
Product - Google Keep
Save what’s on your mind
Product - Google Store
Explore and shop the latest products made with Google
Product - Hangouts
Conversations that come to life. Anytime, anywhere, for free
Products under Social
Google+
Blogger
Groups
Spaces
Product - Google+
Discover amazing things, created by passionate people
Product - Blogger
Publish your passions, your way
Product - Groups
Create mailing lists and discussion groups
Product - Spaces
Find, discuss and do things with friends
Unsorted array (Insert, Delete, Balance, Get at index, Search, Find minimum, Find maximum, Space usage)
Insert = O(1) Delete = O(1) Balance = N/A Get at index = O(1) Search = O(n) Find minimum = O(n) Find maximum = O(n) Space usage = O(n) Note: For Insert and Delete, the expectation is that values don't have to be moved for an unsorted array, and values don't have to be placed in a specific spot and everything else moved. This may well be untrue in a given implementation.
Sorted array (Insert, Delete, Balance, Get at index, Search, Find minimum, Find maximum, Space usage)
Insert = O(n) Delete = O(n) Balance = N/A Get at index = O(1) Search = O( log(n) ) Find minimum = O(1) Find maximum = O(1) Space usage = O(n)
Unsorted linked list (Insert, Delete, Balance, Get at index, Search, Find minimum, Find maximum, Space usage)
Insert = O(1) Delete = O(1) Balance = N/A Get at index = O(n) Search = O( n ) Find minimum = O(n) Find maximum = O(n) Space usage = O(n)
Sorted linked list (Insert, Delete, Balance, Get at index, Search, Find minimum, Find maximum, Space usage)
Insert = O(n) Delete = O(1) Balance = N/A Get at index = O(n) Search = O( n ) Find minimum = O(1) Find maximum = O(1) Space usage = O(n)
Self-balancing binary tree (Insert, Delete, Balance, Get at index, Search, Find minimum, Find maximum, Space usage)
Insert = O( log(n) ) Delete = O( log(n) ) Balance = O( log(n) ) Get at index = N/A Search = O( log(n) ) Find minimum = O( log(n) ) Find maximum = O( log(n) ) Space usage = O(n)
Heap (Insert, Delete, Balance, Get at index, Search, Find minimum, Find maximum, Space usage)
Insert = O( log(n) ) Delete = O( log(n) ) Balance = O( log(n) ) Get at index = N/A Search = O( n ) Find minimum = O( 1 ) for min-heap, O(n) for max-heap Find maximum = O( 1 ) for max-heap, O(n) for min-heap Space usage = O(n)
Hash table (Insert, Delete, Balance, Get at index, Search, Find minimum, Find maximum, Space usage)
Insert = O( 1 ) Delete = O( 1 ) Balance = O( n ) Get at index = N/A Search = O( 1 ) Find minimum = O( n ) Find maximum = O( n ) Space usage = O( n )
Trie (Insert, Delete, Balance, Get at index, Search, Find minimum, Find maximum, Space usage)
Insert = O( k ) Delete = O( k ) Balance = N/A Get at index = O(k) Search = O( k ) Find minimum = O( k ) Find maximum = O( k ) Space usage = O( k * n ) Note: k = average LENGTH of key
List of (normal) Primitive Types
Boolean Character Floating-point Double - Wider floating-point size Integer Enumerated type - Small set of uniquely-named values
List of (normal) Composite Types (or Non-primitive Types)
Array
Struct (also called a Record or Tuple)
Union - Crazy thing that can be two different types of variable and called any instance to serve as either one.
Tagged Union - Same as union except all accesses are verified to be “safe”. Reason to use instead of a struct is to save space, and possibly bit level conversions. (Insane)
List of (normal) Abstract Data Types
Container List Associative array Multimap Set Multiset Stack Queue Double-ended queue (Deque) Priority queue Tree Graph
Data Type - Boolean
Primitive Type. Has two values (true/false). Normally used as the result of conditional statements.
Data type - Character
Primitive Type. Unit of Information roughly corresponds to a grapheme (e.g. letter of an alphabet). Often encoded as a value length such as a byte for ASCII or variable length for UTF-8 (Unicode).
Data type - Floating point
Primitive Type. Representation of real numbers, normally 4 bytes and mapped using IEEE 754, which has 1 bit to signify greater than or less than zero, 8 bits to indicate exponent (with -127 offset) and 23 bits to communicate the mantissa.
Data type - Double
Primitive Type. 8 byte floating point. Short for double-precision floating-point format. Also specified in IEEE 754.