Google Interview Flashcards

1
Q

How would you increase adoption of Google’s Fiber to the Home product?

A

Customer: Urban/Suburban, city dwellers, strongest with younger technically aware. Want fast speeds, consistency, and a low price. Caps are a consideration.
Possible solutions: 1) lower price, 2) faster speed, 3) discount bundle with things like Google Fi, YoutubeTV, or Stadia.
Strengths are google brand vs comcast. Need to make a simple change choice and pricing to win over ordinary users who dislike comcast
Big challenge is availability. Investment needs to be made in infrastructure.
Pricing can be temporaily match by competitor, speed wars can be matched as well. With people ditching cable and home phone, focus on straightforward pricing, focus on internet only or bundling with other google services.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Tell me a digital product you use nearly every day. How would you go about building a competitor to it?

A

Twitch
Customers are gamers who play and watch.
Would measure hours spent per month, both watching and streaming, number of viewers, number of streamers. Interaction with the streams.
Integration with the games you watch to have rewards and engagement with streamers/developers
Developers can use the APIs to show rewards for watching their game, a mix between twitch rewards and in game rewards. Drive ongoing engagement with the game and motivate streamers.
Rewards for both streamers and watchers.
For Google, closely integrate Stadia with YouTube to incentive people to stream directly to YouTube. Offer better (easier to use) software that improves on having to use 3P software like Twitch.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

You have to build a disaster management app for the Olympics. How are you going to go about this?

A

List out the possible disasters for the area
Customers who are using it, atteneeds, locals, first responders, Olympic employees.
Biggest needed features: 1 Alert system. 2 Directions on what to do and where to go based on 1) user type 2) location, 3) any info on mobility or user needs. 3. Report alert for users to map out biggest issues. 4. Prioritize for first responders.
Trade off between simplicity and usefulness.
End solution is more advanced for first responders and employees who can be trained, as simple as possible for attendees.
Attendees- Register, mobility profile, simple notifications (amber alert style), directions on where to proceed via maps, track families, report issues to first responders.
Employees- Notifications- registration of assignments, step by step directions, coordination with other employees, reporting for first responders.
First responders- Prioritized the submissions from employees and attendees on issues. Direct in an optimized way. Show overall tracking and allow HQ to send notifications.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How will you scale a wildly successful food truck business?

A

Issues to consider: 1) labor costs 2) food quality consistency, 3)cannibalization

Look at data for what makes it successful, is it the location? What are the qualities about the location and where can you find those qualities elsewhere?

To solve: 1) have employees flex to different locations based on need and allow to cover each other’s shifts, 2) prep as much as possible in central locations to maintain consistency. 3) space the trucks out to build on brand organically in area but not cannibalize. Need a balance between locations and costs. Figure out idea number of commercial kitchens to support.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Select your favorite app. Tell me what you like about it. How can you improve it?

A

Ring-detect when im the one coming home and dont notify me. Face sync with my august lock.

Google trips- group planning, proposing locations and voting/polls, collecting payments and distributing group bills, auto fill everyone’s traveler info.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How would you implement Chrome for kids?

A

Chrome for kids has two customers, parents and kids.
success metrics are parent feedback, kid engagement, user acquisition, metrics need to take into account time limits.

Parents want to be able to control access to sites
Ability to block sites
Ability to only allow a specific list of sites
View kids requested sites
Restrict time

Kids want to view content as easily as possible
Timer that shows how much time left
Approved sites
Request site access
Ability to earn more time by working through Chrome for kids educational programs

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Describe your work experience in 3-4 minutes?

A

Entrepreneur that had a product idea in college
Entered into competition, media attention, took momentum and spun it into a business and secured investors
Experimenting and learning through direct action
Wound down due to lawsuit and market force changes (phone size)
Started building things at Amazon instead, started with Services product, went from around 75 to 200 vendors involved, $10M business.
Wanted to grow with technology but the team was not a tech team. Moved to a tech org to build software
Last 3 years started negotiation software from scratch. Started small with US only launch and 4 engineers, now own 3 related products with 12 engineers, 8 countries so far and over $1B of business impact.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Design alarm clock for blind person

A

Customer needs to 1) know the time, 2) set and manage alarms.
Physical alarm clock, or application?
Application by voice already exists on most phones so maybe consider a hardware play.
Options are to have physical buttons with braille and or numbers they can feel, or go all audio.
For physical you need large easy to find buttons with braille and maybe have the time called out by voice or have tactile options.

Tactile option can be vibration or little mechanical dots that raise and lower.

Watch device can sync with other options both physical and digital across the home.

One option is audio, very similar to the features you can get from google home. Tell the device to set alarms, cancel, snooze, ask for the current time. Maybe include a visual display for partners that may not be blind. But this already exists.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How would you monetize Gmail?

A

Ads
Increase add effectiveness
Look at types of promotional emails get opened
Use the other google ads profiling as well.
Include pictures and other media
“Best Deals Filter/Tab” Take all of the promotional and advertisement that the user gets and use machine learning to predict which deals they would actually be interested by taking into account all Google History, click rate, etc. Advertisers have to opt in to be able to qualify for best deals and negotiate a rev share. Tricky because you want to actually surface the best deals.
Corporate accounts
Considered-Advanced features but then risk alienating customers who are used to everything being free. Advanced feature would be to let users set up different folders to filter to with Google Executive Assistant and use feedback based ML to sort mail into different folders, the user would train the model for their individual messages and preferences. Pay a monthly fee for the subscription or bundle with other services.
Balance between intrusiveness of ads and effectiveness.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Estimate number of vacuums sold in the US

A

Number of families 350M Americans, average family size is 4, 87.5M families
Number of vacuums per family 1 average, some may have none, others have multiple
Lifetime of vacuums 5-8 years? 7-8 vacuums in lifetime per family. 20-80 as vacuum buying window
10M ish vacuums per year
THings to think about, the longer people are single the more vacuums they will have. As vacuums shift from big machines that you repair to buy and replace the number will increase. Roombas become more popular, people may have multiple for different floors.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Why Google?

A

Tech focus, customer focus, great brand equity with products people respect/trust. So many different areas of business, products that experiment and push the envelope. Want to work on thing that my friends and family actually use. Also saw that Google Trips is going away which I think there is untapped potential for the app and I wrote up a bit about how I would bring it back to life.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

How would you design a better smoke detector?

A

Important features: notify people to get out, notify fire
Network connected, connected to speakers/phone
Alert users whether they are at home or not
Phone alerts, deactivatable by phone (important for high ceilings) Think WUPF from The Office.
Alarm on detectors in other rooms of the house
Alert fire if not deactivated within certain time period.
Battery level monitor, battery operated or plug in with battery backup. Solar powered?

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Design an new iPad app for Google spreadsheet.

A

Need to prioritize buttons to be selectable by touch, simplify. Get data on most used functions

Create functions that are available by swiping and other gesture actions like moving to a new sheet, new cells/rows, etc. a way to click and drag for selection. Get data on what the most difficult operations are without a mouse and focus on how to make these intuitive.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

How many queries per second does Gmail get?

A

1.5 billion users
Types: reads (20-30, writes 2-10, searches 1-5 overall somewhere between 25-35 queries per user per day. 30 average. 30 per person per day. 30/24hrs/60min/60 sec = queries per person per second * 1.5B= 500k per second

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

How would you improve Google Maps?

A

Accuracy in bad traffic situations, machine learning on typical traffic information and cross-reference with waze user reports to modify bad traffic by crash/police/fire etc.

Right now places you have navigated to show up first in results for similar searches, restaurants etc, but also should use data about where you have been even if you didn’t navigate there. This is the most interesting to dive into.

Commute alerts when you wake up about possible routes to take or leaving earlier/later than usual.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

How would you reduce Gmail storage size?

A

Enforce an auto-archiving for old items and compress files for saving space but takes longer to retrieve

Notify users about setting up auto-auto archive or auto delete.

Bulk unsubscribe available to users and suggest items to unsubscribe to or archive based on engagement. This is could be huge because 95% of my inbox is spam and there is not a great way to prevent this. Maybe even use ML to detect spam and low engagement and show a page of all of the things to unsubscribe to and let the user do it in bulk, this cuts things out at the source and you can implement archiving or compression solutions after for even more effectiveness.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

How would you improve restaurant search?

A

User profile that shows the tendencies of types of restaurants.
Use navigation to restaurants, location data of restaurants and visits, as well as reviews of not only that person but user profiles similar to that person (ML) for profile similarity. Not just what people have searched for but location data, for instance, my wife does most of the research and I attend. Could even use photo data to determine if people are really excited about the food, return visits, etc.

Incentivize to review restaurants that they visited. Discounts etc offered by restaurants for reviews and know who visited the restaurant to prompt.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

What is your favorite app, what do you like and dislike?

A

Travel-maps
Like Auto-suggest places do go and things to do with sample itineraries, auto-pulls in flight and hotel information from email, saves locations to maps
Dislike- only works for one person, can’t coordinate with others, group pay, vote on activities, doesn’t save places I went to that I didn’t search, want to be able to share my whole itinerary/trip with others after the fact.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

If you were to build the next killer feature for Google, what would it be?

A

Group travel- Google Trips

Advertising on shared computers. Detect who is using and adjust, encourage themes?. Public terminals rewards programs at cash registers instead of square/clover/fivestar? Sign in with face recognition on webcam?

Gaming streaming service to complement Stadia project that integrates rewards directly with streamers/watchers from developers/google

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

You’re part of the Google Search web spam team. How would you detect duplicate websites?

A

Look at titles, images, percentage of similar text. For internal duplicates:
The hosting provider is the same.
The IP addresses are the same. (Block A,B and C)
The theme is the same (websites are often built with Wordpress to have them up faster)
The wordpress plugins are the same.
The niche is repeated and the content is alike or is totally duplicated.
Sites are linked to each other, connected for the backlinks.

For external links where someone is copying someone elses site. Need to figure out which is the duplicate and which is the original. Check domain age? Utilize some sort of fingerprinting on original when it was indexed?

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

How many iPhones are sold in the US each year?

A

350M americans. Cell phone users are between 15-80 so maybe 80% of the population. 280M cell phone users. Users buy or upgrade cellphone every 2 years. So about 140M people buying a year. Iphone has around 40%ish market share 56M or so

Other factors, younger users may have second hand phones, consider entire secondhand market and take that into effect. Older users may upgrade less. Some people have multiple phones (work etc)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

As the PM for Google Glass ‘Enterprise Edition,’ which metrics would you track? How do you know if the product is successful?

A

Number of queries per day, hours worn per day, actions taken per day, repetitive attempts at actions in a row, usage metrics over time. Number sold, repeat customers, tickets filed, surveys of users for improvement metrics, efficiency of employees.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

If you were Google’s CEO, would you be concerned about Microsoft?

A

Tablet market is growing for MSFT, cloud computing advantage, enterprise software, gaming. Google products are in an increasing number of industries. Need to focus on innovating faster, tech infrastructure like internet/household devices, worry about other competitors like amazon and netflix.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

Should Google offer a StubHub competitor? That is, sell sports, concert, and theater tickets?

A

Already has an infastructure for enterprise ticket, hotels/flights, users already have google accounts. If google can cut down on bots and beat ticketmaster on fees they could also offer better ad targeting for events etc.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Q

What’s the biggest pain you have with Google Docs? How would you fix it?

A

Biggest pain is formatting and history of edits/versions. Give people suggestion access instead of straight up edit? Exporting to word docs

26
Q

How would you design a new Google to-do list app?

A

Clean and simple interface
Auto suggest to do list based on search history or email/text content
Integrate with calendar and maps. Calendar to set reminders and maps to use location based data for reminders like “get milk from store” remind when you get to a specific store or any store if unspecified.
Ability to add via voice or text.
Shared to-do list option with roommates/significant other.
Act of creating a new item simple but then with all this complexity underneath optional and auto where possible.
Moonshot-Integrate with other products like Mint/gmail for bills or smart shelves fridges for ordering more products. Also look at ML for suggestions around when to fill up on gas for the car etc.

27
Q

Explain how the internet works: what happens when you type a URL into your browser?

A

Protocol, domain, path. Protocol is the format/method, domain is a location, and path is a more specific location. When you enter in URL it says what format you are wanting to display the domain in and the location you are retrieving along with any path details for a even more specific location,.

Data transfer: In order to get the information on your screen, follows TC/IP in packets

28
Q

Imagine you’re a PM on Gmail and you decide to launch a new “schedule an email” for sending feature. What parts of the Gmail tech stack would this feature require you to touch?

A

On application layer you would have to adjust the UI to show the option to the user and collect the inputs, then you would have to send the info to the system where it would process it and schedule a job to run at the desired time. It would then store the mail and job details in the database until it was time to run, the event would then trigger the listener in the application and let it know to execute job and provide the correct data. The application layer would then need to be updated to let the user know the task was complete.

29
Q

How would you explain what an API is to someone who is completely non-technical (e.g., an English major with no coding experience)

A

Application interface is an established tool/methodology to get data from one application to another without having to have access to all the data. For instance, if you had an application and wanted to use twitter’s data on tweets with a #puppies, it would be resource intensive to keep that list up to date all the time, getting all of twitters tweet data and then searching for the #. With an API you can request data from twitter in a specific way so you just get the data when you need it for your specific query.

If they were an english major Id use a library for example. If you are looking for a specific page of a book, without an API, you would have to constantly maintain a list of all the books in the library and then check to see they had what you want. With an API you can instead just tell them you want a book and request a page and they will return just the information you need.

30
Q

If Google Play store downloads were down 4.5% WoW, how would you investigate that dip?

A

Look for outlier data, specific apps or types with lower dl, countries with lower dl.
Look at yoy data to see if this pattern is consistent with anything, also consider any other weeks where we dropped 4.5% or previous issues and compare to see if there is a repetitive issue.

31
Q

How would you determine if a new Google Search feature launch was successful?

A

Usage, actions off of the search, time spent on the action to see if it is longer/faster whatever the metric of improvement is. Customer support tickets, google searches of how to “feature” usage over time.

32
Q

How would you explain a critical system outage on your product to the director of product who leads your group? How would you communicate that same issue to the director of customer support for your product?

A

Director of product

How long the outage will last, who was affected.
Root cause
Preventative measures taken to avoid in the future
Short and long term impacts of outage
Short and long term solutions
Cost, resources needed.

Director of Customer Support
How long the outage will last, who was affected.
Root cause, what can be communicated with customers.
Estimated increase in support tickets ongoing, resources needed to handle.

33
Q

Write an algorithm that detects meeting conflicts.

A

SELECT * FROM periods WHERE range_start <= @check_period_end AND range_end >= @check_period_start

if M1 has start1 and end1 and M2 has start2 and end2
check if end1 falls >= start2 etc

Could brute force and compare each meeting to every other meeting. Better solution is to create an interval tree where you
a)Check if the current appointment conflicts with any of the existing
appointments in Interval Tree. If conflicts, then print the current appointment. This step can be done O(Logn) time.
b) Insert the current appointment in Interval Tree. This step also canbe done O(Logn) time.

34
Q

Let’s switch gears, you have been hired by Google (Nest), and Nest want to enter Smart kitchen market. How would you enter this market? What would you build

A

Start with enhancing google home to order stuff for you, look up recipes, etc. probably need a version with a screen.

Other than that there are two centers of the kitchen fridge and pantry

Showing levels of items in fridge or pantry or integrate with other devices that have levels, coffee maker etc. Auto reordering. Maybe a screen built into a backsplash to show timers, recipe steps, etc.

35
Q

How much money spent in USA per year on GAS

A

350m americans. Average 2 cars per household.

Average household is 4 people. .5 cars per person. 175m cars. Cars need to be filled every 2 weeks if they are regularly used so Average tank is probably around 15 gal. 4,550,000,000 fills x 15 gal 68,250,000,000 * 3 per gallon.
204.75B by household consumers alone.
Industrial use of gas would also be up there but people spend half of their time working so maybe include 50% more for industrial use. 300Bish

36
Q

What was your highest achievement?

A

Starting a new product in August 2016 with 4 incredible engineers and a wide open space and in less than 6 monhths delivering a product that was used to negotiate with 10k vendors and make over $50M. 35% of vendors never even negotiated with a person at amazon and just interacted with the software.

37
Q

How would you define the strategy for YouTube over 5 years.

A

Strategy for Youtube is to take consumption of content to the next level and compete directly with cable companies.
Initial is to increase user base for YoutubeTV
Bundle with other google products straightforward pricing
Google Fiber will bring high quality streaming speeds to more people
Increase content that people want to watch.
Work with creators to make more consistent content to compete with Amazon/Netflix
Once you have a user base, use differentiated pricing to make money.
One price for no ads another price for ads
Ads will be higher value because you can target ads towards people and households like TV cant. Show content creators that advertising on Google is more effective and they will make more money.
Keep optimizing
Seek content that users want
Give tools to creators to monitor
Have suggestion algorithms that are better. 100T Lol vs COD example

38
Q

Describe an industry that is going through disruption, and explain how you would help an incumbent stay competitive against these disruptors

A

Automotive, Tesla technology and updates are taking over, android auto is one thing but it relies on cell phone and only covers media parts of the car. As self driving takes over and technology is more in everything Google needs to sell services and partner with established automakers who are horrible with technology.

39
Q

Describe how you would win over Engineering to work on a Business-requested feature that would throw existing work into doubt, especially if the Engineering team was working on meeting a deadline.

A

Lay out the customer impact of the feature the way it is vs the way it could be with the feature. In the end everyone is here to execute for the customer. Take heat on the deadline, get buy in from leadership on importance of feature vs date. Discuss the prioritization process.

40
Q

What are your 4 favorite Google Products. Pick one, and describe how to improve it.

A

Youtube
Google Flights/Trips
Gmail
Translate

41
Q

Tell me about a time you had a disagreement with a Technical stakeholder, and how did you go about reconciling that disagreement.

A

DAC tool not being accurate at the marketplace level
Agreement to pull data at the region level for now with notifications in the tool for users
Align on getting the data in our source next year
IN Away team starting development of features on their own and then coming back to us in the end for approval
Created a new policy that they would write out their user stories and requirements and get approval from me first. Then have a design review with me and the engineering team before development and then code review at the end.
A little slower at the beginning but reduced rework and confusion which overall was better for the tool and saved time overall.

42
Q

Imagine that you’re the CEO of Netflix. What is your strategy for the next 10 years?

A

Start mixing in live TV type things build a network and sports to challenge cable
Interactive content, option to ad relevant ads for discounted membership. Partnering with telecom to get more users through bundle discounts.

43
Q

What are the estimated number of “incidents” that could be reported by users of Waymo in the SF Bay Area?

A

Define incidents, current users or future use case. Estimate number of people in SF, estimate car commuters in SF, % of drivers that use Waymo. How many drivers have incidents a year and how many could waymo users interact with. What is the report rate for incidents.

44
Q

Note: Practice Cirlces Method

A

Comprehend situation. (What? How?)
Identify Customers
Report customer needs (As ___, I want ___ so that____)
Cut through prioritization (ROI estimate)
List solutions
Evaluate tradeoffs
Summarize recommendation (why you picked it)

45
Q

DIGS Method for Behavioral

A

Dramatize
Indicate Alternatives
Go through what you did
Summarize impact

46
Q

AARM for Metrics Question

A

Acquisition
Activation
Retention
Monetization

47
Q

Big 0:

A

Seeing which part of the algorithm is going to have the biggest scaling issue.
O is the order. Ex: order of 1 O(1), order of N O(n), etc.

Order of 1 is code that executes in the same amount of time no matter how big the array is.
Order of N is an algorithm that grows in direct proportion to the amount of data. Example: linear search
Order of N^2 time to complete grows proportional to the square of the amount of data. Ex: Bubble sort where you have a nested loop inside a loop where the first look is O(N) and the inner loop causes O(N^2) want to aviod these
Order of Log N is where the amount of data is halved each time as N grows.

48
Q

Arrays:

A

List of data. Able to define how many pieces of data are in the list in one line.
Syntax for list of integers in[]=[2,3,4,5,] etc. They are all indexed starting from 0. Refer to them by their index number.

One disadvantage of using arrays to store data is that arrays are static structures and therefore cannot be easily extended or reduced to fit the data set.

49
Q

Linked Lists:

A

A linked list is a linear data structure where each element is a separate object.

Each element (we will call it a node) of a list is comprising of two items - the data and a reference to the next node. The last node has a reference to null. The entry point into a linked list is called the head of the list. It should be noted that head is not a separate node, but the reference to the first node. If the list is empty then the head is a null reference

One disadvantage of a linked list against an array is that it does not allow direct access to the individual elements. If you want to access a particular item then you have to start at the head and follow the references until you get to that item.

50
Q

Stacks:

A

A stack is a container of objects that are inserted and removed according to the last-in first-out (LIFO) principle. In the pushdown stacks only two operations are allowed: push the item into the stack, and pop the item out of the stack. A stack is a limited access data structure - elements can be added and removed from the stack only at the top. push adds an item to the top of the stack, pop removes the item from the top. A helpful analogy is to think of a stack of books; you can remove only the top book, also you can add a new book on the top.

Example: Text editor “undo” mechanism. Push all changes in a stack, pop when user hits “undo”

51
Q

Queues:

A

A queue is a container of objects (a linear collection) hat are inserted and removed according to the first-in first-out (FIFO) principle. An excellent example of a queue is a line of students in the food court of the UC. New additions to a line made to the back of the queue, while removal (or serving) happens in the front. In the queue only two operations are allowed enqueue and dequeue. Enqueue means to insert an item into the back of the queue, dequeue means removing the front item.

52
Q

Tree:

A

Usually used when referring to binary search trees. Where there is a Root at the top then children underneath, ending in a leaf node. Binary search trees have one or two chile or leaf nodes under each node.on any sub tree the left node is less than the root node which is less than all of the right nodes.Each operation cuts off about half of the nodes.

53
Q

Heaps:

A

Min heap- a tree with the min value as the top node. Aways insert in the next available slot left to right, if smaller than the parent, bubble it up. Max heap is the opposite. Can store these values in an array.

54
Q

Tries:

A

A type of tree, often used to store characters. Each node may store a character. When you go down the tree, it might represent a word. Allows very fast lookups for searching words or to return words that start with a certain letter combination. Each node can have a flag that shows if it is a complete word or not.

55
Q

Graphs:

A

A collection of nodes where each node may point to another node (edges), the edges can point one way or both ways. What you want to know is if there is a way from one node to another. Two main methods to figure it out, 1) Depth First Search: Ask node if they have a path to node you want, if no, the nodes as their other notes until they find one that does. Usually prefer 2) Breadth First Search instead. The node first sees if they have any connections to the node, then they put all of their children in line and ask one at a time if they have any connection to node you need and use a queue and check and then move on.

56
Q

Hash Table:

A

A key -> value lookup. Key and value can be any sort of data value. Usually strings. Store objects in an array. Hash takes string and converts to integer and remaps into an array. String->hash code->index. When there are collisions you can chain and store them in a linked list. Usually you assume you have a good hash table that is O(1), constant time

57
Q

Web Applications:

A

Web apps are apps that can be accessed from a browser. Browser is web client or user agent. When these two parties are communicating they are using the same protocol (set of rules) like HTTP protocol, FTP, etc. Web clients can access Web Resources through the web server (application), either statically or dynamically (location). URLs point to unique resources. Start with protocol, then web server, then the path. Web clients send requests to web server. Server then sends Response.

58
Q

Recursion:

A

Taking a problem and breaking it down into sub-problems and have a function call itself. Need a base case to stop the look. Example, factorials, n!= n* (n-1) * (n-2)… n!= n* (n-1)! If n greater or equal to 1.

A way to design solutions to problems that use divide and conquer and break it down to a simple enough problem that can be solved on its own. Refers to itself but avoid infinite recursion by having a base case.

59
Q

Concurrency:

A

When a shared resource is being used, a concurrency tool needs to be used to manage the state, lock etc. Otherwise, the shared resource could be updated by one thread but its now old value is currently being used by a different thread. Example: Ticketmaster has a pool of tickets, ticket requests need to use concurrency so that they don’t sell the same ticket to two people or sell more tickets than they have available.

60
Q

Machine Learning Fundamentals:

A
  • machine learning is the general term for when computers learn from data
  • there are lots of different ways (“algorithms”) that machines can learn
  • the algorithms can be grouped into supervised, unsupervised, and reinforcement algorithms*
  • the data that you feed to a machine learning algorithm can be input-output pairs or just inputs
  • supervised learning algorithms require input-output pairs (i.e. they require the output)
  • unsupervised learning requires only the input data (not the outputs)
  • here is how, in general, supervised algorithms work:
  • you feed it an example input, then the associated output
  • you repeat the above step many many times
  • eventually, the algorithm picks up a pattern between the inputs and outputs
  • now, you can feed it a brand new input, and it will predict the output for you
  • here is how, in general, unsupervised algorithms work:
  • you feed it an example input (without the associated output)
  • you repeat the above step many times
  • eventually, the algorithm clusters your inputs into groups
  • now, you can feed it a brand new input, and the algorithm will predict which cluster it belongs with
61
Q

MapReduce:

A

2 phases, Map phase and Reduce phase. Mappers job is to process the data. File is usually passed line by line into the mapper. Produces as many outputs as needed. Reducers job to take every output value from the mapper. Reducer creates new output values and saves them. Another part of MapReduce API is called shuffle and sort phase. Use playing cards as an example. Assume non-numeric cards are bad data and the program’s goal is to add up the numbers for a specific suit. In this process the mapping creates piles of the same suit. If dealing with bigger data, you can split this across multiple nodes. Sort and shuffle combines suits of cards from both nodes into a pile. Reducer runs a node and does the counting for the output.

62
Q

Search Engines:

A

Search engines don’t run your search in real time, there are too many sites to look at. Instead, search engines are constantly searching in advance. Search engines are constantly crawling for information and following hyperlinks and indexing the pages. Engine looks at each of the words in the index, determines the best matches to show first. Engine uses a ranking algorithm to check if your term is in the title, in the same order, etc. Google’s method is page rank (named after Larry Page) where it thinks pages are more important if they get linked to a lot. Engines now use a lot of other data for relevancy like location, meaning of words etc and uses machine learning to understand the underlying meaning of words.