Qualitative v/s Quantitative Research

Qualitative Research

  1. Primary exploratory research
  2. Gain insights into: 
    1. Underlying reasons, motivations, and opinions, problems
  3. Hypothesis for potential quantitative research
  4. Unstructured or semi-structured. 
  5. Data collection methods:
    1. Group discussions 
    2. Individual interviews
    3. Participation and Observation 
  6. Sample size is usually small.

Quantitative Research
  1. Quantify the problem by generating data or stats. 
  2. Uses stats to measure data and observe patterns. 
  3. Structured. 
  4. Data collection methods:
    1. Online surveys
    2. F2F or telly interviews
    3. Online polls

Scrum interview questions

What are the different types of agile methodologies that you have used and know about? 
Scrum. Basics:

  1. Scrum team
  2. Product owner
  3. Scrum master: Runs the standups


What are the core components of scrum that you think are most valuable and what things do you feel are not so valuable?
Valuable:

  1. Sprint planning
  2. Sprint review: demo day
  3. Sprint retrospective 
  4. Daily scrum 
Not so valuable:
  1. When we want estimates upfront. 
  2. We want team to be more efficient and productive. 
Please see the chart: 
Source of image: https://medium.com/the-liberators/more-often-than-not-scrum-seems-like-a-bad-idea-44a5346454a1


Project management interview questions & answers - Part III

How have you contributed to the success of the project? 
By:
  1. Understanding end goals.
  2. Understanding my role and each team's roles.
  3. Identifying Interdependencies and stating them early on. 
  4. Cross functional and periodic communication via emails, standups, meetings. 
  5. Setting up milestones and periodic checking enabling team to collaborate well.   
  6. Accepting and managing problems.
  7. Recognizing and rewarding the teams. 

How would you increase efficiency of your development team? 
By:
  1. Document Coding and dev standards.
  2. Implement CI integration. 
  3. Release often if possible.
  4. Schedule demos.
  5. Follow test driven development. 
  6. Creating detailed tasks. 
  7. Review backlog
  8. Resolve blockers. 
  9. Have short meetings.
  10. Support initiative 
  11. Rely and trust your team's expertise, where ever possible. 


If you come about an early delay in one of your milestones what would you do?
  1. Catch them early by monitoring the progress of the project and staying in touch with leads through out the project. 
  2. Notify stakeholders: Update them on delay and revised schedules. 
  3. Call for a meeting: Dev, technical teams, vendors, stakeholders, customers and update them on the delay. 
  4. Gather the right resources: Re-allocate the resources. 
  5. Reschedule: Check if some activities that were planned sequentially can be done parallely.
  6. Re-prioritize: List out all the activities that are not yet done. Move the important ones to the top of the list. 
  7. Document the updated plan and send it out to everyone.  

How to decide between traditional project management v/s Agile methologies?
Use traditional when:
  1. Long and detailed planning is required. 
  2. Processes is linear and all the tasks are scheduled sequentially. 
  3. Requires a formal CM process. 
  4. Prioritization is fixed.
  5. Customer feedback can be taken at the end and incorporated into future releases. Customer involvement is low. 
  6. Organization is very centralized. 
  7. ROI is achieved at product release.
  8. Ex: Hardware or non-customer facing projects like infrastructure or technology changes. 
Use Agile when: 
  1. Process and decision making is iterative.
  2. Need customer feedback right away and can be incorporate right away.
  3. Organization is de-centralized. 
  4. Prioritization changes based on business requirements and customer feedback. 
  5. Small amount of work is picked up to be done. Rest can be updated and prioritized based on inputs. 
  6. Customer involvement is high.
  7. ROI is achieved often and is iterative. It determines what the future releases. 

What are the various states of the project? - RYG. What do they stand for? How to move the project from R to G?
Green: Project is within budget, timeline, and expectation.
Yellow: Project might fallout of budget, timeline or expectation and is it risk. Requires special attention from team involved. If needed from higher ups.
Red: Some aspect of the project has fallen behind or encountered major setback or is over budget
How to move R to G: Have a plan on paper, get a buy in, and get it approved. Once everyone agrees to the new set of parameters then move it to G from R.
Some teams move G to Y or R to get feedback from upper management so that they can get their expertise involved to get it done.

Project management interview questions & answers - Part I

Big Data Basics

NoSql:
  1. Data is highly unstructured.
  2. Doesn't follow stringent structure of RDBMS enabling speed and agility. 
  3. DBs are distributed and data can be distributed across multiple nodes and servers. 
  4. Allows for horizontal scaling: As the data grows add more nodes without impacting performance.
Big Data: 
  1. Big Data refers to large collection of data (that may be structured, unstructured or semi structured) that expands so quickly that it is difficult to manage with regular database or statistical tools.
  2. HDFS does not offer native support for security and authentication.
  3. Cluster has nodes

Hadoop v/s conventional DB:

Hadoop:
  1. Data is distributed across many nodes and processing
  2. Write once, read many. Once you write the data, you can delete it but can't modify it.
  3. Archival data: Telephonic call or transaction data
  4. Doesn't support SQL at all.
  5. It is an ecosystem of tools, technologies, and platforms.
  6. Runs on many commodity H/W and uses commodity S/W.
  7. Supports Hbase that is a NoSQL distributed DB.

Conventional DB:
  1. Conceptually all data sits in one server/database.
  2. Data can be modified.
  3. Support SQL


Hadoop layers:
  1. Bottom layer/Layer 1: Commodity Cluster Hardware
  2. Middle layer/Hadoop Layer/Layer 2: MapReduce, HDFS
  3. Top layer/Tools layer/Layer 3: RHadoop, Mahout, Hive, Pig, HBase, Sqoop
  4. RHadoop: Supports statistical language R
  5. Mahout: Machine learning
  6. Hive/Pig: NoSQL
  7. Sqoop: Getting data into and out of the Hadoop file system

Advantages:
1. Scalable
2. Cost effective in terms of processing large volumes of data.

=== Hive ===

  1. It provides SQL intellect so that users can write such queries called as HQL to extract data from hadoop.
  2. These SQL queries are converted to MapReduce queries. These queries in turn will communicate with HDFS.
  3. Great platform to write SQL writes to interact with HDFS.
  4. Not RDMS, or OLTP or real time updates or queries 
  5. Nice features:
    1. Supports different file formats like sequence/text/avro/orc/rc file. 
    2. Metadata gets stored in RDBMS
    3. Provides lots of compression techniques. 
    4. SQL queries are converted into MapReduce or tez or spark jobs. 
    5. UDF can include mapreduce scripts can be plugged 
    6. Specalized joins helps improve query function


Hive v/s RDBMS:
Hive:

  1. Enforce schema on Read and not on write. So you can write any kind of data till you read it. 
  2. Supports storage of 100PetaBytes of data.
  3. Doesn't support OLTP
RDBMS:

  1. Schema on Write. Won't let insert any data if its out of schema. 
  2. Allows storage of around 10PB of data. 
  3. Support OLTP
Impala:

  1. It is not mapreduce
  2. It is Massively Parallel Processing engine on top of Hadoop to query and analyze the data sets. 
  3. Utilizes Hive metastore to store table structure
  4. With the help of external tables, data resides in the Hadoop file system and structure in the metastore.
  5. Popular for Data scientists and analysts. 


Hive v/s Pig v/s Spark
Hive:

  1. Gives non-programmers ability to query and analyze Hadoop DBs
  2. Abstraction layer on top of Hadoop
  3. Batch oriented framework
  4. Useful for structured data. 
  5. Users can use SQL like interface to interact with backend Hadoop platform. 
  6. Supports:
    1. Batch query processing: For huge datasets. 
    2. Interactive query processing: For real time data processing. 
  7. Hive queries get converted into MapReduce jobs. 
  8. Predefined or UDF(User Defined Functions) can be used to perform certain action. 
  9. In hive: 
    1. select * will create a fetch job but not map reduce
    2. Aggregation functions like min, max, etc will create a map reduce job. 
Pig:
  1. Requires some programming knowledge to query and extract the data. 
  2. Abstraction layer on top of Hadoop
  3. Batch oriented framework. 
  4. Useful for structured, semi-structured, and unstructured data. 
  5. Pig has 2 parts: Pig Latin and Pig runtime. 
    1. Pig runtime converts the job from Pig to MapReduce
  6. Popular amongst data engineers
Spark: 
  1. In memory processing, you need to know java to utilize spark. 
  2. Faster but is low level since it requires coding knowledge.
  3. Useful for structured, semi-structured, and unstructured data. 
Decision making between Hive, Pig, Spark
  1. If you have unstructured data then go with Pig or Spark. 
  2. If you have structured data then go with Hive and load the data into Hive. 
  3. If you want faster processing go with Spark. 
  4. If you are fine with waiting few hours then go with Pig or Hive. 
  5. If you have technical knowledge then go with Spark -> Pig -> Hive. 
Few notes:
  1. Solr: Elastic search tool. Searches for words within documents. 
  2. Sqoop is used to import data into Hadoop. Pig is used to process that data. 
  3. Hbase: column family NoSql DB

System design cheatsheet

Database scaling

  1. Horizontal scaling is ensured by adding concurrent machines that will handle more requests.
  2. Path1: The requests will be routed to SQL and it will become slow overtime. To make it better add more RAM, use sharding, denormalization, SQL tuning.
  3. Path 2: Better way to handle scale is denormalize right from beginning or switch to scalable no-sql DB. Even after that you'll need to introduce a cache.

Caching

  1. Users will see performance degradation when loads of data is fetched from the DBs. Cache needs to be implemented in such cases. 
  2. In-memory cache like Redis or Memcached should be considered and not file based caching. 
    1. Data is stored in the RAM. 
    2. Redis can do 100s of 1000s of reads/second. 
    3. Writes(including incremental ones) are faster too. 
  3. Cache sits between storage and application. 
  4. 2 patterns are: 
    1. Cached database queries
    2. Cached objects

A. Cached database queries

  1. Store the query and its result in the cache. 
  2. Query is the key and result is value. 
  3. Problem: If just a column or row changes, you need to remove all the key-value pairs that reside in the cache. That row or column might be used by a lot of queries and might be present in a lot of results. So its not an ideal approach. 

B. Cached objects

  1. Store the class instance so that you can get rid of it if something changes. 
  2. If one DB column value has changed then you need to get rid of the relevant object and not complete object.
  3. So its an ideal approach. 
What to store in cache:
  1. Sessions
  2. User activity stream like twitter
  3. Fully rendered blog posts
  4. user <-> friend relationships

Types of asynchronism

A. For mostly static data that doesn't require a lot of pre-computation:


  1. Website pages that are built with frameworks or CMS should be pre-rendered and stored on AWS or CDN. 
  2. Cron job performs these operations and store/push them on CDNs. 
  3. This will make the site super responsive and could handle multiple requests. 

B. For dynamic data that requires intensive computation:

  1. User comes to the site and requests an operation to be performed. 
  2. Site informs the user that its processing the task and informs the user once the job is done. 
    1. When the task comes it is placed in the queue. 
    2. Worker process will come and pick up the task from the queue. It will process it. 
    3. The worker process finishes the job and informs the Front end about it. 
    4. FE receives the signal and update the user. 
    5. Technologies used for queuing are: Redis list, RabbitMQ, ActiveMQ


Source:
http://www.lecloud.net/post/7295452622/scalability-for-dummies-part-1-clones
http://www.lecloud.net/post/7994751381/scalability-for-dummies-part-2-database
http://www.lecloud.net/post/9246290032/scalability-for-dummies-part-3-cache
http://www.lecloud.net/post/9699762917/scalability-for-dummies-part-4-asynchronism


Project management interview questions & answers

How would you handle non-productive developers or team-members?
  1. Align big lofty goals with their personal goals. If not, incentivize them by helping them identify the personal goals(like learning a new programming language that will be used in this project that will help her/him get motivated)
  2. Clearly define roles and responsibilities. Assign accountability to them.
  3. Don't be overly strictly. Put some big rules in place but don't keep overemphasizing them. 
  4. Include the team in decision making and planning process. 
  5. Do retrospective meetings to ensure what has been accomplished and what not. 
  6. Talk to them to understand if they need help.  


How will you get traction from a TPM of another team?
  1. Communicate the goals to them and what impact they are going to make. Indicate KPIs or metrics that this goals could help achieve. 
  2. Align their projects with yours and involve them into planning. 
  3. Divide the projects into roadmap and sub-stories. Make them commit to the sub-stories and ask for timelines.
  4. Offer help if they are not able to achieve those timelines. 
  5. Glorify them when the projects are achieved within reasonable time limits. This will make them very likely to work with you again. 


What are important things of consider while running a cross-team program?
  1. Helps if roles and responsibilities are defined. 
  2. Communication is shared. And their are frequent updates. Frequent meetings of leaders, where they provide updates from their teams. 
  3. Its best if they know the mission and goals one can achieve. Report frequently on KPIs and metrics. 
  4. Encourage cross-functional training. 
  5. Celebrating major milestones and congratulating the team on achieving the goals.


How do you earn trust of your team members.
  1. Lead by example
  2. Communicate openly
  3. Don't place blame on any one person. Tackle the issue at hand without pointing fingers. 
  4. Discuss trust issues. 
  5. Be available to them to discuss project goals and communicate often. 
  6. Develop team exercises. 
  7. Be calm, open, and transparent where ever possible. 
  8. Encourage mutual feedback. 
  9. Allow flexibility in choosing projects, hours.
  10. Be patient with new employees. 


How do you plan a project or program?
  1. Under the project goals. 
    1. Align them with company goals and mission. 
    2. Define KPIs and metrics. 
    3. Prioritize goals. 
  2. Identify stakeholders and meet with them. Discuss project goals with them to see if they help achieve their goals. 
  3. Create a product roadmap. 
  4. Divide roadmap into deliverables. 
  5. Assign deliverables to functional and dev teams. Create a project schedule of the deliverables. 
  6. Identify issues or technology gaps and complete risk assessment. 
    1. Think of alternatives to avoid or minimize risk. 
    2. Think of MVPs in case project runs into delivery issues. 
  7. Present the plan to stakeholders. 
  8. Communicate the plan to the dev teams and keep things moving. 


What in your opinion are three constraints of a project or program?
Its called as Project management triple constraint. Those are:
  1. Time
  2. Cost
  3. Scope
  4. 4th: Meets the customers requirements. - Make it PM diamond.

Tell-tale signs that your project is going to fail:
Objectives:
  1. Missing strategy. 
  2. No clear goals.
  3. Leadership priority issues. 
  4. Too many projects at one time. 
  5. Constant scope changes.
  6. Last minute major changes.
Leaders:
  1. Team doesn't trust higher level or management. 
  2. Management or key people leaves in between the projects.
People:
  1. Stakeholders are not interested. 
  2. No knowledge sharing. 
  3. Resource limits


How do you motivate your team of developers?

  1. Provide them flexibility to choose the projects and times they could work on whenever possible. 
  2. Involve them in planning and important decision making if possible. Don't ask them to do it because upper management is doing it. 
  3. Help them understand what KPIs or metrics you are trying to achieve. And how it will help shape the company. 
  4. Career growth: Help them with career growth if possible. Align the career goals to the projects that are pending.
  5. Innovation: Allow them to utilize latest tools and technologies. If they are going to conferences to learn new things let them go. Request a demo to see you are interested what they have been learning. See if you can put sometime in project planning to let them experiment with new technologies. 
  6. Create structured trainings in the organizations. Let me take online trainings and reimburse it when needed. 
  7. Provide recognition of good work.
  8. Good infrastructure to let them work. 
  9. Empower them to make the decisions where ever possible. Don't wait on you for each and everything. 
How have you contributed to the success of the project? 
By:
  1. Understanding end goals.
  2. Understanding my role and each team's roles.
  3. Identifying Interdependencies and stating them early on. 
  4. Cross functional and periodic communication via emails, standups, meetings. 
  5. Setting up milestones and periodic checking enabling team to collaborate well.   
  6. Accepting and managing problems.
  7. Recognizing and rewarding the teams. 

How would you increase efficiency of your development team? 
By:
  1. Document Coding and dev standards.
  2. Implement CI integration. 
  3. Release often if possible.
  4. Schedule demos.
  5. Follow test driven development. 
  6. Creating detailed tasks. 
  7. Review backlog
  8. Resolve blockers. 
  9. Have short meetings.
  10. Support initiative 
  11. Rely and trust your team's expertise, where ever possible. 


If you come about an early delay in one of your milestones what would you do?
  1. Catch them early by monitoring the progress of the project and staying in touch with leads through out the project. 
  2. Notify stakeholders: Update them on delay and revised schedules. 
  3. Call for a meeting: Dev, technical teams, vendors, stakeholders, customers and update them on the delay. 
  4. Gather the right resources: Re-allocate the resources. 
  5. Reschedule: Check if some activities that were planned sequentially can be done parallely.
  6. Re-prioritize: List out all the activities that are not yet done. Move the important ones to the top of the list. 
  7. Document the updated plan and send it out to everyone.  

How to decide between traditional project management v/s Agile methologies?
Use traditional when:
  1. Long and detailed planning is required. 
  2. Processes is linear and all the tasks are scheduled sequentially. 
  3. Requires a formal CM process. 
  4. Prioritization is fixed.
  5. Customer feedback can be taken at the end and incorporated into future releases. Customer involvement is low. 
  6. Organization is very centralized. 
  7. ROI is achieved at product release.
  8. Ex: Hardware or non-customer facing projects like infrastructure or technology changes. 
Use Agile when: 
  1. Process and decision making is iterative.
  2. Need customer feedback right away and can be incorporate right away.
  3. Organization is de-centralized. 
  4. Prioritization changes based on business requirements and customer feedback. 
  5. Small amount of work is picked up to be done. Rest can be updated and prioritized based on inputs. 
  6. Customer involvement is high.
  7. ROI is achieved often and is iterative. It determines what the future releases. 

What are the various states of the project? - RYG. What do they stand for? How to move the project from R to G?
Green: Project is within budget, timeline, and expectation.
Yellow: Project might fallout of budget, timeline or expectation and is it risk. Requires special attention from team involved. If needed from higher ups.
Red: Some aspect of the project has fallen behind or encountered major setback or is over budget
How to move R to G: Have a plan on paper, get a buy in, and get it approved. Once everyone agrees to the new set of parameters then move it to G from R.
Some teams move G to Y or R to get feedback from upper management so that they can get their expertise involved to get it done.



Question list for Product Management Interviews

Behavioral questions list:

  1. How you got into computer science?
  2. What kind of technical publications (print or online) do you read on a regular basis?
  3. What was the last book you read?
  4. If you could recommend one resource (book, web site, etc.) to a new software developer just out of school, what would it be?
  5. What was the most interesting project that you worked on?
  6. What was the most challenging project that you worked on?
  7. If you could have any job in the world, what would it be?
  8. Tell me about your favorite project 
  9. Tell me about a something you did that was unsuccessful, a project or class that didn't go well.
  10. Do you prefer a structured or unstructured working environment?
  11. How do you prioritize multiple projects?
  12. Tell me about previous jobs?
  13. What are your greatest strengths and weaknesses?
  14. Tell us about yourself.
  15. Where would you like to be in five years?
  16. How do you see yourself fitting in to this company?
  17. Do you have any questions for me?
  18. Why did you leave your last job?
  19. Did you finance your own education?
  20. Are you good with people?
  21. Have you experience working on a group project?
  22. What did you find hardest when working with others in a project?
  23. What is a tool or system that you learned on your own? 
  24. How would go about finding out where to find a book in a library. (You don't know how exactly the books are organized beforehand).
  25. Tradeoff between time spent in testing a product and getting into the market first.
  26. What to test for given that there isn't enough time to test everything you want to?
  27. Why do you think you are smart?
  28. Do you want to know any thing about the company.( Try to ask some relevant and interesting question).
  29. How long do u want to stay in USA and why?
  30. What are your geographical preference?
  31. What are your expectations from the job? 

Product Management Interview Questions List: 

  1. Favorite product and how you would improve it. 
  2. Favorite non-technical product
  3. Make an app that has 10x increase in downloads
  4. Estimate number of lightbulbs in US
  5. Estimate the revenue of XYZ company
  6. Estimate the bandwidth needed if you built an optical fiber connection to a colony on Mars
  7. Here's a data set. Something changed and here's the new data set. Explain what happened.
  8. What's your favorite product? How can you improve it?
  9. How would you got about building a startup that does XYZ
  10. If you could start a company with $1,000,000 right now what would it be? and why?  
  11. Tell me about a product you like
  12. Why do you like it?
    1. how would you improve it?
    2. how would you monetize it?
  13. Tell me about a time you used data to solve an ambiguous problem  
  14. Tell me what you would improve about Toothpaste
  15. Tell me about the most exciting project you've worked on in the past, and why it was the most exciting for you.
  16. Design scenario: The alarm clock industry is really waning as of late. What could you do to curb this trend?
  17. How many hotels are their in the US  
  18. Tell me about your background
  19. Asked what is one of my favorite products and how I'd improve it.
  20. You are the PM for a steaming video service. You come into the office and see that one key metric has dropped by 80%. What will you do?
  21. How many balloons fit inside of San Francisco?  
  22. Pick your favorite gadget or piece of technology. How would you market that product now? (Marketing)
  23. How many pairs of skis do you think there are in Austria? (Because the guy was from UK)
  24. How many people run a marathon every year? 
  25. How much money spent in USA per year on GAS
  26. Design an app for a community of Celiac's disease patients. Talk about a product you hate.  
  27. How will you measure the improvement?

Common themes of product management interview questions:

  1. Product, Estimation, Vision for the common
  2. Estimation, Coding, Product questions
  3. Lot of behavioral and fit questions
  4. Analytical skills(How would you do this? How you will solve that problem)
  5. Business acumen
  6. Some Tech
  7. Probability questions
  8. Permutation and combinations
  9. Product Design
  10. Metrics
  11. System design 
  12. Google Products
  13. Strategy
  14. Approaches
  15. Thinking out of the box
  16. Personality 
Source: Glassdoor.com

Google product management Interview questions from Glassdoor.com

  1. How many polynomials can you fit in 3 dimensions and then once you figure that out extrapolate in n dimensions.
  2. How would you improve XYZ Google product?
  3. Given unlimited resources, how you fix XYZ company
  4. What's wrong with XYZ? If you were the CEO, how would you fix it?
  5. Estimate the rate of revolution of Earth
  6. Favorite Google product and why?
  7. How would you increase adoption of Google's Fiber to the Home product?
  8. Now let's imagine you are PM of that product. And you launch a new feature (of the feature sets suggested above). Day after launch usage drop dramatically. How do you go about inquiring what happened?
  9. What do you think about the Android vs. iOs ?
  10. Optimize search algorithm to create an ordered list
  11. You have a ladder of N steps (rungs). You can go up the ladder by taking either 1 step or two steps at a time, in any combination. How many different routes are there (combinations of 1 steps or 2 steps) to make it up the ladder?
  12. Fibonacci series
  13. Why Google?
  14. Design scenario: Let's say you have a tv remote with 3 buttons, mute, vol up, vol down. What would you expect to happen if a user hits vol up button when its muted? Talk through the scenarios and what the user is trying to do. What would you expect to happen if you hit vol down button when it's muted?
  15. Lets design an X, who would you improve product Y).There were a few questions designed to measure mental horsepower (Estimation, Puzzles).
  16. Case study to test the feasibility of a new service box that communicated over HTTP and used JSON requests(2012)
  17. How would you find a snippet of text in a webpage. Code it in any language you like.(2012)
  18. Build a better gmail
  19. Asked about my favorite Google Apps and how to make them better.
  20. Asked about a hypothetical product and how I'd leverage its capabilities for launch.
  21. You are the PM of Facebook's New feed. How will you select things that are to be shown to any user? (Lots of follow up questions)
  22. Let's say Google is able to develop self-driving cars. What are some of the businesses you could start with that technology?
  23. You work in Google's e-commerce business. The team is planning to enter into the hotel vending machine business. How will you design the product? (Used the CIRCLES framework to build the product design)
  24. You are the PM of an enterprise analytics product. Your team just launched a product at end of Q4 and everyone is very exhausted from all the work that went into launching the product. Soon after the launch, the sales lead makes a request for a big feature based on customer feedback. The operations support person also circles back with a request to fix a bug. Given that you only have 2 weeks before your team goes on leave for the new year, what will you priority between the two: build new feature or fix bug? Engineering team just reported that both the actions will take 2 weeks.
  25. You are the PM for Google Cloud developer series. Which customer will you focus on: Cloud Natives (Companies built entirely on cloud - start-ups / individuals etc.) or Legacy Enterprise (companies interested in moving to cloud)
  26. Google wants to build a robot lawnmower. How will you do it?
  27. Which Google product you do not like? Why? How will you improve it? Let's say you are the PM for that product. What will be your three roadmap like?
  28. Google recently developed a technology that can detect human emotions in a 2 X 2 dimension (energy level and body movement). What are some of the products you can build using that technology? I listed 7-8 ideas and then I was asked to choose one and do the product design for that idea.
  29. Questions focus on general cognitive ability, marketing strategy knowledge and experience, leadership skills, and Googleyness (cultural fit). Expect a mix of behavioral, hypothetical/case (e.g., "build a marketing plan for X"), and fit questions.
  30. Challenges in previous jobs, optimal work environment I thrive in, initiatives I personally led to success
  31. Mix of behavioral and marketing focused situational questions. Understand strategy in creating marketing campaigns for various Google products. Swipe to Unlock, Rise Above the Noise, and Decode and Conquer were helpful books to read as I was preparing! Show your passion, and have examples as to why you're a creative and analytical person.
  32. Why google?
  33. Name your top 5 favorite mobile apps, why do you like them? Who should Google acquire?
  34. Take a grocery app - what would be the features you would suggest?
  35. Choose a city and estimate how many Piano Tuners operate a business there.
  36. How many buildings are built in California etc.

Find product of all numbers in an array except self

It is a commonly asked interview question during onsite or phone interview. So the question is given an array, how will you find a product at all locations of an array without its own location.

Background:
If you are given an array: 1,2,3,4 then you are required to provide a product of all locations expect self. In this case, your response will be a,b,c,d. a will be calculated by taking product of b,c, and d. b will be calculated by taking product of a,c,d. Similarly here are other calculations:
c = a * b * d
d = a * b * c.

Brute force approach is iterate through all the locations and calculate the product skipping its own location. It can be implemented using 2 for loops and its complexity will be O(N*N). But there is a better way to do it and its mentioned in following algorithm. Idea of the algo is:

  1. calculate the product of all locations before hand. 
  2. Iterate through the array and divide the product with the value provided at its location.

Algorithm:

  1. First find the product of the all the values in the array. 
  2. If product is not equal to zero then proceed to step 3 or else end. 
  3. At every array location, divide the product with the number at array location. That will return the product of all locations of array expect self. 

Implementation: 
public class Test  {
    static int a[] = {1,2,3,4};

    public static void calculateProductExpectSelf() {
        int product = 1;
        for(int i=0; i<a.length; i++) {
            product *= a[i];
        }
        if(product != 0) {
           int b[] = new int[4];
            for(int i=0;i<a.length;i++) {
               if(a[i] != 0) {
                   b[i] = product/a[i];
                   System.out.println("\t" + b[i]);
               }
            }
        } else {
                  System.out.println("Product is zero"]);
     }

    public static void main(String args[]) {
        calculateProductExpectSelf();
    }
}


Dry Run: 
array = a[] = {1,2,3,4}
Product = 1*2*3*4 = 24
  1. In first iteration, the program will print: 24/1 = 24.
  2. In second iteration, the program will print: 24/2 = 12.
  3. In third iteration, the program will print: 24/3 = 8.
  4. In fourth iteration, the program will print: 24/4 = 6.
Complexity:
O(N)

Table of contents

System Programming 

Basics of Kernel
All about Grep commands
Compiler Cheat Sheet
C Cheat Sheet
C++ Cheat Sheet
Bitset in C
Shell Programming Cheat Sheet
Special features of C language
C++ basic concepts
Technical phone interview questions
Mercurial commands

Algorithm and Data Structures

Find White Spaces in Character Array
Find a character in the String
Number is prime or not
Finding Absolute Value
Notes on Sorting and Searching Algorithms
Common String Functions
Reverse a String
Product of all array location expect its own
Find a cycle in the Linked List
Find a binomial co-efficient
Counting sort algorithm
B-Tree
Find product of all locations in an array expect self

Java

Java Concepts
Java String concepts
Immutable classes in Java
Remove duplicates from the array
Telephonic phone technical interview questions
Telephonic phone technical interview questions - Part 2
Serialization & Deserialization
Jersey Package Dependencies
Observable and Observer Interface
Servlet Filter
Servlet Client Request
Spring dependencies for Maven
Java String Operations

Front End

CSS3

Gradients in CSS3
Radius Property of CSS3
2D transform in CSS3
Transition Property in CSS3
Animation in CSS3
CSS properties
Text properties in CSS3

Javascript and jQuery


Product Management

Management Concepts
Questions on Wireframes
Common Design Questions
List of Puzzles
List of Behavioral Questions
MySQL
Behavioral Question and Answers
Product Manager Estimation Questions

Miscellaneous 

Must Read list

Must Read List

Automate the boring stuff with python
Python is a versatile language and it pays to learn it. Most of the manual tasks can be automated via python and new functionalities can be implemented easily. Above link is a book that will help you learn it easily.

Python Tricks
A great article to learn some cool tips and tricks in python.

Web Security
Nice article to learn some basics of Web Security.


Product Manager Estimation Question: Exercise #1

If you are opening a new Walmart store, how would you decide how many cash register is needed for the store?

There are basic steps to solve this problem. They are:

  1. Ask any clarifying questions. Work with interviewer to define the scope. 
  2. Create a main equation such as a = b * c. Divide the equations into sub parts. 
  3. Think of any edge cases. 
  4. Calculate the numbers and do a sanity check.
Starting with steps:
Questions and Answers by the candidate. 
Questions and Answers by the interviewer. 

Ask clarifying questions to define the scope of the problem:
  • Do we know if this walmart is in a suburb or city? Suburb 
  • Do we know if there are any other walmarts in the neighborhood? Yes two more. 
  • Are they closer to this suburb? No. Both of them are far. 
  • Ok so in that case, many of the residents will rely on this Walmart. Yes
  • Can we assume that any person is ok with waiting at the register for 4-8 mins? Yes

Create the main equation:
Number of registers = Number of people visiting the store/time taken at each register. 

Break down the equations into simple sub-equations: 
  • Two main components are: Number of people visiting the store. 
  • Time taken at each register: 4-8 mins as clarified. 
  • So we need to focus on number of people. Basically only a certain set of people visit the store so we can say x% of entire population visit the store. 
  • Since we have no way of telling what is x but given that Walmart is popular choice of lower to upper middle class. We can safely assume that x=65-70% people visit Walmart because of their low prices. 
  • Since its a suburb whose size we don't know, we are going to estimate. 
    • US average population is 325 million. We will round it to 300 million for easier calculations. 
    • Based on some stats I know that:
      • 26% population live in urban areas
      • 51% in suburban
      • 21% in rural
    • Majority of population is living in suburban. Estimated number is 150 million live in suburban.
    • There are 50 states in USA. We can assume that each state has 50-60 suburbs and bigger ones will have 65-80 suburbs. So average is 60(round off) suburbs in each state. So total suburbs are around: 50*60= 3000 = 3k
    • So 150 million people live in 3k suburbs. And on average 50k people live in 1 suburb. 
    • Only 65%(as assumed)of 50k go to Walmart. But they go as a family. So we don't need to calculate all the people. We need to calculate the households. 
    • We can assume that each household has approximately 3 people. This brings down our number of people to 16k users. 
    • And not all the people are at the walmart at the same time. We can say at any time only 5% of people are at a walmart = 5% of 16k = 800 approximately. 
    • Now not everyone is checking out at the same time. Let's say only 30% of them are. this brings down the number to 240.
    • And not all 240 has shopping carts, they are with their families. Let's say each group has 2 people ~ 120 are in line. 
Calculate the numbers and do a sanity check:
  • Equation: Number of registers = Number of people visiting the store/time taken at each register. 
  • Sub equation: Number of registers = (x% of total population visit the store)/time taken at each register. 
  • x% of total population that visit the store and are doing a checkout during busiest times are = 120
  • Average time taken at each register = 6 minutes. 
  • So total registers = 120/6 = 20
  • Sanity check: At a walmart, I have seen 15-20 registers and our answer is 20. So this is in the ballpark number. 

Final answer is = 20 registers.

Some background: 
  • Initially I assumed 30 suburbs in each state. The count came down to 100 million people in each suburb. This is a lot. San Jose's population is 1 million. So I went back and changed the number of suburbs to 60 per state. This helped with some corrections. 
  • I assumed 30% of suburbs population is in Walmart at any given time. Again this is a huge number. So fixed it to 5%. 
  • Then assumed 50% of them are checking out at the same time so fixed it to 30% as well. 

Let me know your thoughts and let me know in comment section on how you will solve this problem. 





Quick Cheatsheet on some Javascript Basics

1) Global objects can be accessed via this operator in javascript.

2) Global properties that return a simple value and have no methods are:
Infinity, NaN, undefined, null

3) How to create a variable:
var myNameVariable = ‘name1’;
//Re-assigning the value:
myNameVariable = ‘name2’;

4) Primitive data types that are supported in Javascript are:
Boolean, Null, Undefined, Number, String, Symbol, Object
  • Boolean type can take true or false
  • Null can take exactly one value: null
  • Integers are 16-bit unsigned integer values
  • Object: It's like an object oriented programming concept of object.
5) Comments: Following are 2 types of creating comments.
  • /* */
  • //
6) Mathematical operators:
  • add/concatenation: +
  • subtract: -
  • multiple: * 
  • divide: /
  • assignment operator: =
  • Identity Operator: ===
  • Negation: !
  • Not equal: !==
7) How to define a function
function testFunc() {
alert(“Test”);
}

Behavioral Questions and Answers

Which do you like first, the good news or the bad news? 
I like good news first. It will elate my mood so I will be able to take bad news better. If I get bad news first that I might miss the gravity of the good news.


Have you been in a situation where the team has let you down and you've to take the blame?
Yes it has recently happened. I provided reqs to engineering about a product feature. They were supposed to send out data of certain time period. Instead they sent out data for a longer period. We realized it when we received our invoices and they were higher than usual. Now there is no point blaming them but to own it up. I did bring it up with the engineering team and requested them to stick to the requirements.
As a fallback mechanism, I added a QA process for all the outgoing data. I had a rough estimate of numbers that can be sent out for all new requests. So for every new request, I asked them to provide me with the total size. If it matched or was within a specific range, we went ahead with sending out the data. This happened for only new requests so we didn't had to worry about them providing me with updates all the time since subsequent similar requests were automated.


How has your tolerance for mistakes changed over the years?
It has increased a lot. I have realized that people will make mistakes all the times and most of the times, they are genuine. There is no point getting upset over honest and genuine mistakes. And some people does mistakes because they don't know any better. For ex: Kids are just being kids, no point getting upset/angry at them when they are being themselves. New hires might deploy a bug in the production, it will not be productive if we start doubting them. So bottomline is: Mistakes will happen, we just need to learn from them and move on. However I am careful when someone conducts same mistakes over and over again. Now that is being careless and would hurt a business in a professional setting. Such behavior should be addressed in timely manner before the person becomes habitual of mistakes.


What have you learned about saying no?
It is a very important skill to have. And you can't say no to all the audiences. But to whosoever I am saying it to, I make sure that I say it nicely and precisely.
  • Recently I got a project request from Engineering. They wanted to prioritize an infrastructure project over a revenue generating one. Now infrastructure is important but not over revenue. I requested information on how they were planning to impact the revenue via it and they didn't come up with solid backing. The project would have added stars to the engineering manager's profile but wouldn't have generated any revenue for the company. Based on preliminary analysis, I politely said no and suggested them to get a budget approval from their Execs to move forward. But Product was not ready to buy the idea at the moment. I suggested to talk to my manager and exec level if they thought so strongly about it. They didn't so we didn't moved ahead with the project. 
  • We get a lot of feature requests that are one time use. Now we want our users to be honest to us but we can't tell them no on the face directly. We ask them for ROI on these features and its apparent that those features are not going to be extensively used for a lot of projects. One project that might not see the light of the day requires such features but we can't commit all our resources to build something that is not showing a lot of promise. 
  • And in product management you'll have to say no a lot then yes. If you say yes to everything then you will busy executing someone's vision and not your vision of the product. Trying to understand the impact or ROI is best way to weed out must haves from good to have features. 

Do you manage people from different functions differently? If so, how? 
Yes I do. Exec level is way different from Customer/user and that is different from Engineering or Legal or Procurement or Finance.
  • Exec level wants to know more about strategy and Product vision. They care about numbers with focused plan, about business goals, product goals, KPIs. 
  • Engineering cares about how well the Product fits in the vision. If it is high visibility product or a supporting product. What technology to use? What technology is used by integrating partners? How to integrate well to improve the performance? Are the requirements clear enough to build a solid foundation? Is there scope of automation?
  • Legal cares about fine print on the contracts. They want to make sure that business is executed as expected and we are conducting it by adhering to all the rules. 
  • Finance cares about if our product is generating the revenue. How can we decrease cost without affecting performance or any business goals? 
  • Procurement worries about getting the contracts signed to continue the business or initiate a new business quickly. They try to lock down a great deal at a good rate for few years. This way we are not reinventing the wheel all the time and are making sure that the deal is in place so that different functions can focus on achieving the business goals. 
  • Customers/users want to learn about a new feature. Want to know when a specific feature will be available. Will communicate with them to provide hope that their feature is on its way or politely turn them down telling them we are focussing on something else that requires our attention.

What would somebody do to lose your confidence?
Lie to me multiple times and double standards. If I catch someone constantly lying about something then that's it for me. If you lie one time its ok. There might be some reason why you did it. May be you were trying not to hurt me. But lying every time a tough situation comes up or when you are confronted tell me that the person shouldn't be trusted.
Second, if you say one thing in private but something else in public then bye bye.


How do you get a team to commit to a schedule?
  1. Explain them the bigger picture and product/business goals. 
  2. Make them feel that their contribution is making a difference to motivate them. 
  3. Create a roadmap and associate key tasks/stories to different items on the roadmap. 
  4. Define key metrics/KPIs and associate them to the tasks/stories and map. 
  5. Setup a meeting to go over above steps and define the project plan.
  6. Email out the plan with people held accountable to different tasks/stories. 
  7. Check periodically to monitor progress. 
  8. Ensure you are available to help prioritize if competing projects are showing up regularly. 
  9. Ensure to send updates when tasks are completed or are falling behind schedule
  10. Send out emails to key stakeholders once project is completed. 
  11. Celebrate the success!
  12. Document the learnings and measure the metrics and KPIs. 
  13. Refine metrics if need be. 
  14. Iterate.
Tell me about a time when a team didn't gel. Why do you think that happened, and what have you learned? 


What types of people have you found it difficult to work with?
People who never get along with anyone. Anything is a huge task for them. They are just trying to finish off something so quickly and don't want to think through things. Since they are in such a hurry that they resent any new task that is added to their plate. 


What kinds of people do you like to work with?
  • People who like to own the responsibility and don't mind few challenges here and there. A daily challenge might be an issue for many.
  • Those who like learning and are open to teach any acquired skills. 
  • Those who are able to focus on bigger picture while executing day to day activities. 

What's the difference between management and leadership? 
ManagementLeadership
Focuses on just day to day. Involves the team on strategy
and help with the bigger picture understanding
short term thinking Long term thinking
Focuses on onselfFocuses on the team
Not aware of employees goals and long term plansIs aware
Build processes and systemsBuild relationships
DirectCoach

How do you earn the respect of the engineering team as a product manager or someone outside that team?

  1. I usually provide them goals of the projects and how they will impact the revenue.
  2. If its an urgent ask, I try to get hold of someone in Sales or Planning team to understand how much revenue it is going to bring. If I know it, I communicate it to the team.
  3. If we are running an experiment then I am upfront with them by telling them this is just an experiment that might not result in a full blown project. So I tell them to do it in a quick and dirty way. Don't need to think about it and doesn't need to build a solution out of it.
  4. Since I have technical background, I try to communicate in the same language and they are usually comfortable explaining things further.
  5. I am usually polite most of the times. It helps. If I put someone on their plate I make sure other low priority items are moved out.
  6. While writing specifications, I write them out as detailed as possible.
  7. While they are releasing something, I help them out with the plan and am available if they identify a bug and need approval to roll back new features.


You might also like:
List of all behavioral questions

B-Tree

Features:
  1. Its a self balancing tree
  2. All its nodes live in the main memory. 
  3. If the height of the tree is long then nodes are accessed from the disk in the form of blocks. Hence the height is kept low and it reduces the disk access. Disk access time is low compared to AVL trees, Red-Black trees, etc.
  4. All leaves are at same level. 
  5. A factor x is defined that determines number of keys. 
  6. Node may contain 1 key. 
  7. All nodes must contain atleast t-1 keys and atmost 2t-1 keys.
  8. Keys are stored in ascending order.
  9. It grows and shrinks in size unlike BST. 
  10. O(Logn) is for search, insert, and delete.

Search operation:
  1. If key to be searched is x, we start by looking at the root node. 
  2. If x > root then we search RHS of the tree. 
  3. In the node we look for all the values sequentially. If the intended node doesn't has the key then we go back to root, look for next key sequentially present in the root and repeat step 2. 
  4. If x<root then we search for LHS of the tree.
  5. Repeat step similar to 3.
  6. If we don't find the keys in any of the nodes then we return Null.

Traverse operation:

jQuery Guide

This guide has the information you need to know about jQuery to get started. 

Basics

  1. jQuery is a library of javascript functions that you can use in your code. If you know the basics of javascript then you will be able to easily learn jQuery. 
  2. You can very easily apply different operations and formatting on different tags in your html code. For ex: If you want to hide a specify elements(lets say <p>) upon click a link. You can easily do this via jQuery. 
  3. To use jQuery you have to find the tag(selector) on which you have to perform the action. Basic syntax is:
    1. $(selector).action(
      1. To access jQuery library $ is used. We can use jQuery in place of $. At some places we do use jQuery instead of a $, we will explore it in more details at later point in the tutorial. 
      2. A (selector) or tag in the html document. 
      3. action() specifies the operation to be performed on the selected tag.
  4. There are certain ways to find the html element. These methods are similar to finding elements in CSS.
    1. $(“h1”) - This method will select the element h1.
    2. $(“#format”) - This method will select the element whose id=“format” in the html page.
    3. $(“.formatter”) - This method will select the element whose class = “formatter” in the html element. 
  5. To use jQuery library you can either download it and include it your source code. Or else you can refer it from its hosted location. One such location is: http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js
  6. Hence you should include this library reference in the script tag like this:
    1. <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"> 
  7. And it should be included in your head tag like this:
    1. <head>
    2. <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js">
    3. </head>
  8. Quick Notes:
    • jQuery uses $ sign as a shortcut for jQuery
    • jQuery is Client side scripting
  9. What if other JavaScript frameworks also use the $ sign as a shortcut?
  10. If two different frameworks are using the same shortcut, one of them might stop working.
    The jQuery team have already thought about this, and implemented the noConflict() method.
    The noConflict() method releases the hold on the $ shortcut identifier, so that other scripts can use it.
    $.noConflict();
    jQuery(document).ready(function(){
      jQuery("button").click(function(){
        jQuery("p").text("jQuery is still working!");
      });
    });


jQuery Events

jQuery Mouse Events
Some of the jQuery methods are common and can be executed on desired tags. All the methods attaches the event handlers on the html element on which they are attached. Once that action is performed the event handler is called and it performs the set of steps on the corresponding html element. 
  1. .click() - Action is performed when html tag/selector is clicked.
  2. .dblclick() - Action is performed when html tag/selector is double clicked
  3. .focus() - Action is performed when html/tag selector is focused on.
  4. .change() - Action is performed when html tag/selector value changes. It is limited to tags: <input>, <textarea>, <select>
  5. .mouseenter() - Action is performed when mouse enters the html tag/selector. 
  6. .mouseleave() - Performs opposite action as compared to mouse enter.
  7. .hover() - Perform action when mouse is hovered over the corresponding html tag/selector.
  8. .focusout() - Event is executed when the focus moves away from corresponding html tag/selector.
  9. .mousedown() - Event is executed when mouse button is clicked on the html tag/selector.
  10. .mousemove() - Event is executed when mouse move in the html tag/selector.
  11. .mouseout() - Event is executed when mouse moves out of the html element. 
  12. .mouseover() - Event is executed when mouse moves over the html element. 
  13. .mouseup() - Event is executed when mouse is over the html element and is released. 
  14. .toggle() - This event is deprecated in the jQuery 1.8. 

jQuery Keyboard events:
  1. .focusout() - Event is invoked when any element or an element below it loses focus. It is different from blur since it supports losing focus from the child elements.
  2. .keydown() - Event is invoked when any key is pressed. Any element in focus will receive the actions when this event is executed. 
  3. .keypress() - Similar to keydown but following keys will not register key press event: shift, Del, Esc
  4. .keyup() - Event is invoked when a key is released.Because of event bubbling all the key presses will be propagated to the document element. For specific elements, we can use .keypress().

Document Rendering Events:
    • .load() - Action is performed when html tag/selector is loaded.
    • .ready() - Action is performed when the DOM is ready or the document is ready. It doesn’t work well with .load since that operation will start performing its operation as soon as the element is available. However, .ready is not going to execute its action till entire DOM is available. When this function is called then we should use $.noConflict() to avoid the namespace conflicts and we have to use jQuery in place of $. 
    • .unload() - Action to be performed when the user intends to go away from the page. The action of going away include:
      • - click on forward and back button.
      • - Refresh a page
      • - clicking on exit browser button. 

Keyboard Events:
    • 1) .focusout() - Event is invoked when any element or an element below it loses focus. It is different from blur since it supports losing focus from the child elements.
    • 2) .keydown() - Event is invoked when any key is pressed. Any element in focus will receive the actions when this event is executed. 
    • 3) .keypress() - Similar to keydown but following keys will not register key press event: shift, Del, Esc
    • 4) .keyup() - Event is invoked when a key is released.Because of event bubbling all the key presses will be propagated to the document element. For specific elements, we can use .keypress().

Commonly Used jQuery Event Methods
    • $(document).ready(): The $(document).ready() method allows us to execute a function when the document is fully loaded. This event is already explained in the jQuery Syntax chapter.
    • click()
      • The click() method attaches an event handler function to an HTML element.
      • The function is executed when the user clicks on the HTML element.
    • dblclick()
      • The dblclick() method attaches an event handler function to an HTML element.
      • The function is executed when the user double-clicks on the HTML element:
    • mouseenter()
      • The mouseenter() method attaches an event handler function to an HTML element.
      • The function is executed when the mouse pointer enters the HTML element:
    • mouseleave()
      • The mouseleave() method attaches an event handler function to an HTML element.
      • The function is executed when the mouse pointer leaves the HTML element:
    • mousedown()
      • The mousedown() method attaches an event handler function to an HTML element.
      • The function is executed, when the left mouse button is pressed down, while the mouse is over the HTML element:
    • mouseup()
      • The mouseup() method attaches an event handler function to an HTML element.
      • The function is executed, when the left mouse button is released, while the mouse is over the HTML element:
    • hover()
      • The hover() method takes two functions and is a combination of the mouseenter() and mouseleave() methods.
      • The first function is executed when the mouse enters the HTML element, and the second function is executed when the mouse leaves the HTML element:
    • focus()
      • The focus() method attaches an event handler function to an HTML form field.
      • The function is executed when the form field gets focus:
    • blur()
      • The blur() method attaches an event handler function to an HTML form field.
      • The function is executed when the form field loses focus:


jQuery DOM Manipulation: One very important part of jQuery is the possibility to manipulate the DOM. jQuery comes with a bunch of DOM related methods that make it easy to access and manipulate elements and attributes
    • text() - Sets or returns the text content of selected elements
    • html() - Sets or returns the content of selected elements (including HTML markup)
    • val() - Sets or returns the value of form fields
    • The jQuery attr() method is used to get attribute values.


Call back functions

$("#btn1").click(function(){
    $("#test1").text(function(i,origText){
        return "Old text: " + origText + " New text: Hello world!
        (index: " + i + ")"; 
     });
 });
We can have similar callback functions for the other methods: text, html, val
  • remove() - Removes the selected element (and its child elements)
  • empty() - Removes the child elements from the selected element

Call Back Function example:
$("#div1").remove();
$("p").remove(".italic");


jQuery Methods


  • jQuery addClass() Method
The following example shows how to add class attributes to different elements. Of course you can select multiple elements, when adding classes:
Example
$("button").click(function(){
    $("h1,h2,p").addClass("blue");
    $("div").addClass("important");
});

  • jQuery removeClass() Method
The following example shows how to remove a specific class attribute from different elements:
Example
$("button").click(function(){
    $("h1,h2,p").removeClass("blue");
});

  • jQuery toggleClass() Method
The following example will show how to use the jQuery toggleClass() method. This method toggles between adding/removing classes from the selected elements:
Example
$("button").click(function(){
    $("h1,h2,p").toggleClass("blue");
});

  • Set a CSS Property
$("p").css("background-color","yellow");


  • Set Multiple CSS Properties
$("p").css({"background-color":"yellow","font-size":"200%"});


  • jQuery Dimension Methods
jQuery has several important methods for working with dimensions:
    • width()
    • height()
    • innerWidth()
    • innerHeight()
    • outerWidth()
    • outerHeight()

  • Traversing Up the DOM Tree
Three useful jQuery methods for traversing up the DOM tree are:
    • parent(): The parent() method returns the direct parent element of the selected element. And it goes up only a single level.
    • parents(): Find all the parents.
    • parentsUntil(): Find the parents till a specific html or class or id specified
$(document).ready(function(){
     $("span").parentsUntil("div");
});


  • Traversing Down the DOM Tree
Two useful jQuery methods for traversing down the DOM tree are:
    • children()
    • find()
The children() method returns all direct children of the selected element and it traverses only a single level down. 

The find() method returns descendant elements of the selected element, all the way down to the last descendant.
$(document).ready(function(){
     $("div").find("span");
});

  • Traversing Sideways in The DOM Tree
    • siblings(): Returns all the siblings of the current element. 
    • next()
    • nextAll()
    • nextUntil()
    • prev()
    • prevAll()
    • prevUntil()

  • jQuery prev(), prevAll() & prevUntil() Methods
The prev(), prevAll() and prevUntil() methods work just like the methods above but with reverse functionality: they return previous sibling elements (traverse backwards along sibling elements in the DOM tree, instead of forward).
JQuery Filtering
The first() method returns the first element of the selected elements.


  • jQuery + Ajax: 
<script>
$(document).ready(function(){
    $("button").click(function(){
       $("#div1").load("demo_test.txt");
  });
});
</script>

<div id="div1"><h2>Let jQuery AJAX Change This Text</h2></div>
<button>Get External Content</button>


  • jQuery load() Method
The load() method loads data from a server and puts the returned data into the selected element.
Syntax:
$(selector).load(URL,data,callback);
- The required URL parameter specifies the URL you wish to load.
- The optional data parameter specifies a set of querystring key/value pairs to send along with the request.
- The optional callback parameter is the name of a function to be executed after the load() method is completed.
$(document).ready(function(){
  $("button").click(function(){
    $("#div1").load("demo_test.txt");
  });
});
</script>


  • jQuery $.get() Method
The $.get() method requests data from the server with an HTTP GET request.
Syntax:
$.get(URL,callback);
$("button").click(function(){
  $.get("demo_test.asp",function(data,status){
    alert("Data: " + data + "\nStatus: " + status);
  });
});


  • jQuery $.post() Method
The $.post() method requests data from the server using an HTTP POST request.
Syntax:
$.post(URL,data,callback);
$("button").click(function(){
  $.post("demo_test_post.asp",
  {
    name:"Donald Duck",
    city:"Duckburg"
  },
  function(data,status){
    alert("Data: " + data + "\nStatus: " + status);
  });
});

There are many other popular JavaScript frameworks like: Angular, Backbone, Ember, Knockout, and more.


Basic Code Snippets
Get Text:
$("#btn1").click(function(){
  alert("Text: " + $("#test").text());
});

Set Text:
$("#btn1").click(function(){
  $("#test1").text("Hello world!");
});

Get Html:
$("#btn2").click(function(){
  alert("HTML: " + $("#test").html());
});

Set Html:
$("#btn2").click(function(){
  $("#test2").html("<b>Hello world!</b>");
});

Get Value:
$("#btn1").click(function(){
  alert("Value: " + $("#test").val());
});

Set Value: 
$("#btn3").click(function(){
  $("#test3").val("Dolly Duck");
});

Get Value:
$("button").click(function(){
  alert($("#w3s").attr("href"));
});

Set Value:
$("button").click(function(){
  $("#w3s").attr("href","http://www.w3schools.com/jquery");
});

$("button").click(function(){
  $("#w3s").attr({
    "href" : "http://www.w3schools.com/jquery",
    "title" : "W3Schools jQuery Tutorial"
  });
});


NoSQL

This one is reviewed but I need to delete its copy from hubpages or somewhere NoSQL Data models: key-value  Aggregate model.  key or i...