Thursday, October 31, 2019
Developing probes of cathepsin L Lab Report Example | Topics and Well Written Essays - 1500 words
Developing probes of cathepsin L - Lab Report Example The resin has a linker of acid sensitivity that allows the protection of dipeptide. Besides, the cleavage process also affects the selection of the resin. The synthesis process involved adopting the SPPS protocol which involves the use of DMF, resin, reagents like 4-Dimethylamionpyridine (DMAP) and DMF before the addition of liquid reagent (DIC). The resins were washed with DCM3, IPO 3 and NMP 3 several times. The cleavage process involves using a dilute TFA process. The dry resin was placed in the glass funnel and 1% 10 ml FTA of the dry DCM added, filtered through the application of nitrogen pressure on the flask with ten percent pyridine (2ml) dissolved in methanol. The washing of resin and checking of the filtrate using either the HPLC or the TLC method helped in the process. The mass spectrometry was used for the identification of the protein profiles. The mass of the protein were evaluated by the calculation of m/z peaks. The cleavage of the protein was successful and lead to t he identification of 12 peaks. Majority of the cathepsins are cysteine protease while others are either serine or aspartic proteases. The secretion of cathepsins in the body can be induced by factors like interferon and tumour necrosis factor (Hassanein et al., 2009). Different cathepsins are induced by different molecules, for instance cathepsin L is induced by nicotine. Cathepsins are proteases. Proteases are enzymes with the potential to degrading the proteins. These enzymes are ubiquitous in animals and other organisms. The cathepsins occur in different forms and families. Their differences are based on the differences in structural domains (Puzer et al., 2005). Other factors affecting the type of cathepsins include the proteins they cleave and the catalytic mechanisms. The optimal environment for these enzymes is acidic media, therefore, most of the cathepsins undergo activation at lower ionic concentration characterised by the
Tuesday, October 29, 2019
Program Evaluation - Module 4 - SLP Coursework Example | Topics and Well Written Essays - 250 words
Program Evaluation - Module 4 - SLP - Coursework Example For appropriate delivery of health nursing program to the community, the following methods are necessary depending on the situation and the environment that the program undergoes. Some of the main methods include goal-based evaluation method, outcome evaluation method and process evaluation method. However, for such a nursing health program, outcome evaluation is preferred because it would help in identifying the results to be achieved by the end of the program and the level at, which the desired outcomes can be achieved (McNamara Para 4). As such, inclusive result entails the following steps as best implemented throughout the whole program evaluation process (Deniston et al. Para 16). The first step involves engaging all the stakeholders within the practice area as it would greatly help to avoid rigidity at any level of the evaluation process. The second step is to describe the program to all the participants so that everyone of them get familiarized with the concept concerning the course of action that is supposed to be taken while relaying a lot of focus on the evaluation design. After such a focus then the evidences gotten are taken to the next step to justify the conclusions. Finally, the lesson leant is further disseminated to all the participants concerned. It becomes easier for a program manager to discover that following a proper program evaluation process is a direct leeway towards the achievement of such a program. McNamara, Carter. Authenticity Consulting, Designing Your Program Evaluation Plans. Online integrated library for personal and professional development. Compliance & Ethics Institute Chicago - September 14- 17,
Sunday, October 27, 2019
Design Thinking and Decision Analysis
Design Thinking and Decision Analysis Topic: How can decision analysis support the decision making process in design thinking in selecting the most promising properties during the transition fromdivergent toconvergent thinking phases? Executive Summary Table of Content Executive Summary List of Figures List of Tables Index of Abbreviations 1.Introduction 2.Overview of Design Thinking and Decision Analysis 2.1.A New Approach to Problem Solving 2.1.1.What is a Design Thinker? 2.1.2.The Iterative Steps of Design Thinking 2.2.Decision Analysis 2.2.1.Decision Analysis Process 2.2.2.Multi Attribute Decision Making 3.Application Based on a Case Study 3.1.The Design Challenge 3.2.The Static Model 3.2.1.The Alternatives 3.2.2.Objectives and Measures of Effectiveness 3.2.3.Multi Attribute Decision Making 3.2.4.Sensitivity Analysis of the SAW Method 3.3.The Case Studyââ¬â¢s solution 4.Conclusion List of Literature Statutory Declaration Appendix List of Figures Figure 1: The IDEO process a five step method (Kelley and Littman, 2004: 6-7) Figure 2: Figure 3: The HPI process a six step model (Plattner et al., 2009) Figure 3: Fundamentals of Decision Analysis (Ralph L. Keeney, 1982) Figure 4: Schematic form of a decision tree (Keeney and Raiffa, 1993) Figure 5: A choice problem between two lotteries (Keeney and Raiffa, 1993) Figure 6: MADM Decision Matrix Figure 7: The tree main idea clusters Figure 8: Decision Making Matrix Figure 9: Decision Maker Matrix for the Design Challenge List of Tables Table 1: Different ways of describing design thinking (Lucy Kimbell, 2011) Table 2: Realization of attributes in alternatives scale Index of Abbreviations DADecision Analysis DCDesign Challenge DM Decision Maker DTDesign Thinking HPIHasso-Plattner-Institute HMWHow Might We IWITMI Wonder If That Means MADMMulti Attribute Decision Making MCDMMulti Criteria Decision Making SAWSimple Additive Weighting 1. Introduction Everyone is in the need to make decisions every day. Those decisions may be shaped by an outstanding problem which just needs to be solved or it may just be the question whether to buy a new pair of shoes or not. Moreover, the problem may easily be solvable by a simple equation or there might be the necessity to formulate the problem in the first place since the difficulty is too diffuse to be absorbed. Due to the huge variety of different problems our society faces every day and with all divergent needs for a solution process, there is a constant need to draft and identify methods that support everyone in making decision. Undoubtedly, there are many methodologies and approaches out there that support the decision making process for daily small decisions that need to be made to life changing decisions. Decision analysis (DA), which is one of the formal methods and design thinking (DT), which is one of the innovative methodologies out there, are two instances of problem solving method s. Both methods have been applied in similar fields, such as business, technology, and personal life but with divergent intentions. On the on hand, there is DT which is one of the more recent methodologies that helps to get from a problem to a solution with the support from a finite number of iterative steps that the design thinker will follow. Brown, who is the CEO of IDEO, describes DT as a method that is so powerful and implicit that can be used from teams broadly across the globe to create impactful innovative ideas that can be realized by the society or companies (Brown, 2010: 3). On the other hand, there is DA which is an approach that includes a variety of procedures that helps to find a formal solution to an identified problem and creates a more structured solution procedure. Howard was the person who shaped the term DA in 1964 and has been irreplaceable for the development of DA (Roebuck, 2011: 99). This paper will combine DA and DT to investigate whether DA can leverage the DT process in order to find the most viable solution to a problem. Moreover, this paper will find out whether or not those two approaches can profit from each other. Selected procedures of DA will be integrated in the DT process by reference to a case study. Over and above, the solution generated by the DA technique will be compared with the chosen alternative in the case study that followed the regular DT process. Comparing those two outcomes, this paper will work out whether or not DA can support the DT process. The second chapter is descriptive of the fundamentals of DA and DT. After the outline of the foundations, the third chapter will apply chosen DA procedures into the DT process on the basis of a case study. Moreover, the chosen alternative by the design thinking team in the case study will be analysed. In the final chapter, the major finding will be summarized and evaluated. 2. Overview of Design Thinking and Decision Analysis 2.1. A New Approach to Problem Solving Design Thinking is an iterative and innovative approach to solve problems of all kinds that the society is facing. Moreover, it is a human-centred and at the same time investigatory process that puts its emphasis on collaboration, prototyping, and field research (Lockwood, 2010: xi). It is a set of fundamentals than can be applied by different people and to a huge range of problems (Brown, 2010: 7). DT is not a linear, but an iterative process in which the designers are constantly learning from mistakes and improving their ideas. Designers hope to find a linear model that will help them to understand the logic behind a design process; therefore, it is a constant search for decision making protocols that would support the designersââ¬â¢ processes (Buchanan, 1992). In sum, DT is a user-centred approach to solve a variety of problems with the aim to integrate people from various fields; ranging from consumers and business people to designers. There are a variety of ways to describe DT, as illustrated in Table 1. According to Brown, DT is an organisational resource with the goal to create innovation. Cross describes the method as a cognitive style with the purpose of problem solving. Another famous definition concludes that ââ¬Å"Design Thinking means thinking like a designer wouldâ⬠(Roger, 2009). However, the purpose and aim of DT is in its core identical, whether one is applying the processes modified by Cross or Brown (Plattner et al., 2009: 113). Table 1: Different ways of describing design thinking (Lucy Kimbell, 2011) Over the last five years, the term DT has become very present in our society. On top of that, DT is a new term in design and management circles, which shows the demand for creative and innovative methods across various sectors (Kimbell, 2011). Nevertheless, this method is still underdeveloped when it comes to applying design methods at the management level (Dunne and Roger, 2006). But why is the interest in design growing and the term has become ubiquitous? The society is facing a lot of challenges; from educational problems to global warming and economic crisis. Brown sees DT as a powerful approach that can be applied to a huge variety of problems and as a consequence creates impactful solutions to these challenges. On top of that he argues that design has become nothing short of a tactic of viability (Brown, 2010: 3). The method is not limited to the creation and design of a physical product, but it can also result in the conception of a process, tools to communicate, or a service (Brown, 2010: 7). Therefore, it is a method that helps to learn from mistakes and to find impactful and sustainable solutions. 2.1.1. What is a Design Thinker? Many individuals have their own personal picture of what a designer is and mostly, would not associate themselves with such a term. Nevertheless, the expression designer is not only limited to creative graphic designers that are working in agencies. There are many professionals who would fall under the term designer, from people that are working in corporations and are trying to implement a new innovative way of thinking to people who are creating a new customer experience (Porcini, 2009). Mauro Porcini puts a lot of emphasis on the fact that describing design is a huge challenge, since design can be anything from recognizing impactful solutions to the personal experience that the answers will originate (Porcini, 2009). According to Brown design thinkers have four characteristics in common (Brown, 2008): Empathy Design thinkers have the ability to walk in the shoes of someone else; they view situations from the perspective of other people. This talent allows them to see a lot of thing that others are not able to observe which leads to solutions that are especially tailor-made for the users. Integrative thinking Integrative thinking allows the design thinker to go beyond simple solutions by seeing and assembling all the noticeable coalitions to a solution. The ability to not confide on the processes that are characterized by an A or B choice, allows them to involve even antithetic solutions. Optimism and Experimentalism Design thinkers are individuals who are confident that to each existing solution there is another one which is more impactful and feasible for the corresponding stakeholders. By experimenting with new information and the existing circumstances and moreover, by asking the most powerful questions, design thinkers are able to ascertain long-lasting innovations. Collaboration Another key aspect of the design thinking process is the ability to collaborate with experts from a variety of fields. This talent allows to not only integrating the designers and producers, but also the end user. Moreover, a design thinker him/herself has experience in many different fields and is not only an expert in DT. 2.1.2. The Iterative Steps of Design Thinking As already mentioned above, there are many ways to describe DT. On top of that, the process may sometimes be described in three, five or six steps in literature. For example, at IDEO, which is one of the leading design consultancies in the world, the designers are working with a five step model (Kelley and Littman, 2004: 6-7). Figure 1: The IDEO process a five step method (Kelley and Littman, 2004: 6-7) However, at the Hasso-Plattner-Institute in Potsdam, the process consists of six steps. The two processes consisting of a different amount of steps only differ in their emphasis on the overall process and a different description but not in their principles (Plattner et al., 2009: 113). In order to describe the process which will later be applied to a case study, the thesis will focus on the six steps process described by Plattner et. al. (Plattner et al., 2009: 114). Figure 2: Figure 3: The HPI process a six step model (Plattner et al., 2009) Understand The iterative DT process starts with a phase called understanding, which includes defining the problem and explaining the scope. Defining the so called Design Challenge (DC) is crucial for the success of the method since the whole team working on the challenge needs to have the same understanding of the problem to be solved. Moreover, the target group needs to be identified by the team in order to be able to move to the next phase. In the first phase, the emphasis is put on obtaining the knowledge that is required to solve the formulated DC. Observe The aim of the second phase is to become an expert. The DT team observes all the existing solutions to the identified problem and challenges them; more specifically the team tries to improve their understanding why there has not been an adequate solution up to that point. The team tries to get a 360à ° degree view on the problem, integrating all participants and people affected. One of the main activities in this phase is the direct contact with the future users or clients of the product/service for the intended solution. It is crucial to involve the future users since those people are building the target group and know what their wishes, requirements, way of behaviour and needs are. In addition, the team needs to examine carefully the processes and ways of behaviour. In order to do so the team needs to walk in the shoes of the end users. In sum, the second phase emphasises the need to reproduce the end userââ¬â¢s ways of behaviour while being able to fully understand the end use rââ¬â¢s perspective. Point of View The third phase, called point of view, is the stage where all the findings from the previous phases are interpreted and evaluated. Since in most cases the team has branched out in the second phase, this phase brings everyone together in order to exchange findings. The team will segregate the relevant facts from the dispensable information. This separation helps to define the point of view more precisely which will lighten the fourth phase for the whole team. A method which is often used at this stage is the creation of a persona. A persona is a fictive and ideal-typical end user of the product or service. During this exercise the whole team deploys their findings from the second stage, the observing phase, with the aim to find the right viewing angle on the DC. For the purpose of finding the right perspective, it is important to question and realign the problem from a huge variety of different viewing angles. Recapitulatory, during the third phase the team assembles the key aspects f rom the end users in order to be able to start finding ideas in the next phase. Ideate The ideation phase is characterized by the reorientation of the teamââ¬â¢s thinking process from divergent to convergent thinking. In the beginning of the phase, the team is still in a divergent thought process the group of people is generating as many ideas for a solution as possible. All these concepts should contain a potential solution to the DC and should not be debated by the team in the beginning. It is a phase during which the team experiments with a variety of ideas and invests in the creative thinking process by leaving as much room as possible for everyone to generate constructive ideas. In contrast to the first half of the ideation phase, the second half is shaped by the convergent method. During the convergent thought process, the teamââ¬â¢s goal is to identify the one solution or the best solutions to the DC. This process consists of logical steps towards the exploration of solution/s. There are some creative techniques on how to narrow down the ideas in the ideation phase, for example (Center for Care Innovation, 2013-2014): Sticky note voting: Every team member gets three stickers and places those next to the ideas that are most viable and feasible to him/her. The ideas with the most stickers will be prototyped in the next phase. Idea morphing: Each idea will be presented in front of the whole team. After each presentation the team is looking out for synergies to merge some ideas or mixing some elements. In sum, during this phase the team generates ideas for the exploration of solutions with the help of the information gathered during the last three phases. Prototype This phase appears for many people to be really different to what they have been used to during solution oriented processes. The aim of this phase is to visualize the ideas for the users; thereby, the users are able to give feedback more easily and may also be able test the idea. The prototype should not be the perfect visible idea, but the preproduction model should be able to transfer the message, show the strengths and weaknesses of the idea, and moreover, it should help the team to improve the idea even further. It is a visualization of the idea with the use of, for example, modelling clay, paper, Lego figures, and any material that might be within reach. If the solution is a service function, the prototype might be a theatrical performance. Moreover, some teams create a virtual prototype if the idea that cannot be visualized in a real model. All in all, the intention of the phase is to make an idea come alive and visible to the users. Test During the testing phase the idea will be tried out with the user. The most important part of this step is that the idea will be tested with the end users and not only within the DT team itself. The testing phase is about identifying the ideaââ¬â¢s strengths and weaknesses together with the end user. It is about identifying mistakes because only from these misconceptions the team can learn and further improve the idea, since it is all about the user who will be making use of the idea. Therefore, the team has to put a lot of emphasis on learning from that experience. 2.2. Decision Analysis Every human being constantly takes decisions throughout the day. On the one hand, there are many minor decisions from the preference of food each day, the question if one should stay in bed or not, to the colour of clothes someone wants to wear. On the other hand, people face situations where they have to choose whether to take a job or not or which car they would like to purchase. Some decisions have a larger and more significant impact than others; therefore, it is important to understand the consequences of the decisions that are being made (Gregory, 1988: 2). Decision Analysis is designed to help when dealing with difficult decisions by offering more structure and guidance (Clemen, 1996: 4). DA supports the decision making process: it helps to better and fully understand the obstacles that are connected with having to make a decision and, on top of that, helps to make better choices (Clemen, 1996: 3). Moreover, DA permits the operator to make any decisions in a more effective and consistent way (Clemen, 1996: 4). In consequence, DA is a framework as well as a tool kit for approaching various decisions. Nevertheless, the judgement of each DM differs from person to person. One DM may have a preference which manifests itself in the chosen attributes and alternatives. Another DM may not have a preference and, on top of that, the judgement skills may vary from DM to DM as well (Hwang and Yoon, 1981: 8). According to Keeney, the DA approach concentrates on five fundamental issues that are elementary for all decisions (Keeney, 1982): Figure 3: Fundamentals of Decision Analysis (Ralph L. Keeney, 1982) In order to be able to address multidisciplinary problems, the decision problem is divided into several parts which are analysed and integrated during the DA process (Keeney, 1982). Over the last years, various approaches have been identified, such as the shaped DA process by Keeney or the Multi Attribute Decision Making (MADM) method. The later one supports the decision making when a finite number of alternatives have been identified with various, mostly conflicting attributes. 2.2.1. Decision Analysis Process Over the last decades, many analysts have been working on modifying and improving the DA steps included in the process; therefore, there are many procedures out there with a common purpose: Choosing the best alternative. Keeney describes the DA process in five major steps (Keeney and Raiffa, 1993: 5-6): Preanalysis During the first phase the focus is on gathering the alternatives and clarifying the objectives. The decision maker (DM) faces a situation where there is indecisiveness about any steps that are relevant in order to solve the problem. At this stage the problem is already at hand. Structural analysis At this stage the DM is confronted with structuring the problem. There are several questions that the DM will need to answer; for example, what call can be made? What are the decisions that can be delayed? Is there specific information that supports the choices that could be made? Figure 4 shows a decision tree in which the abovementioned questions are systematically put into place. The decision nodes which are displayed as 1 and 3 (squared) are the nodes that are controlled by the DM and the chance nodes, shown as 2 and 4 (circled), are the nodes which are not fully controlled by the DM. Figure 4: Schematic form of a decision tree (Keeney and Raiffa, 1993) Uncertainty Analysis The third phase, called the Uncertainty Analysis, starts with assigning the probabilities to each path that is branching off from the chance nodes (in Figure 4, these are the paths left and right from points 2 and 4). The assignment of the probabilities to the branches of the decision tree is a subjective procedure (Keeney and Raiffa, 1993: 6; Gregory, 1988: 172). Nevertheless, the DM makes the assignments by using a variety of techniques based on experimental data. These assignments will be checked for conformity. Utility or Value Analysis The objective of the fourth step is the assignment of so called utility values to each path of the decision tree, whereas these represent the consequences connected to that path. The decision path that is shown in Figure 4 represents only one plausible path. In a real problem, many factors will be associated with the path; such as economical costs, psychological costs as well as benefits that the DM considers r
Friday, October 25, 2019
freeaw Not Ready for Freedom in Kate Chopins The Awakening Essay
Not Ready for Freedom in The Awakeningà à à In Kate Chopinââ¬â¢s The Awakening, the main character, Edna Pontellier makes a very long, painful journey into her inner self. At the end of this journey she discovers that she is not strong enough to adopt a life in which a woman is her own woman and lives for herself. This forces her to choose the only other option available to her. I think the propriety with which Edna struggles (and most often gives in to) as she begins to discover who she is and what she wants creates a thick, almost suffocating atmosphere of tension. So much so that I was relieved that she decided to take her own life, as it had evolved into a torturous existence. I thought it unfair that Edna was portrayed as a somewhat neglectful mother. It was clear that she adored her children, albeit a fondness that was in ââ¬Å"...an uneven, impulsive way.â⬠(p. 59) It is important to focus on the time this story was written---the choices available to women in 1899 (the year The Awakening was printed) were extremely limited, and Edna Pontellier, all things considered, actually made a good life for herself, on the surface by making a marriage with Leonce. The material trappings in life that Leonce provided were comfortable, extravagant, actually, and the luxurious life of servants (quadroons), and more than one home appeared to be a life of perfection. Buried within the text are a multitude of ââ¬Å"hints,â⬠ââ¬Å"suggestions,â⬠and in some cases blatant statements concerning the state of mind of Edna Pontellier. The reader is introduced to the possibility that Edna may have a healthy curiosity of the ââ¬Å"absence of pruderyâ⬠due to her fascination with the lives of Creole women. These women of French descent have far les... ...se population. Edna Pontellier was a lady of ladies, yet she had a will stronger than any iron-clad vessel that plowed the Mississippi River. Her ââ¬Å"awakeningâ⬠was at once liberating and devastating. Her anger (throwing the vase and her wedding band) was a manifestation of her confusion and inability to comprehend the society that insisted she receive guests on Tuesday (her husband Leonce was appalled that she left one day and did her own thing), be a wife and mother first, and love only one man. Although her demise was indeed tragic, the point is that Edna was not entirely ready to absolutely adopt the Creole way of life---the life in which a woman is her own woman and lives for herself, stands up to the world and insists on having life on her terms. In the end, Edna could not reconcile herself to a life that stepped outside the boundaries of propriety. Ã
Thursday, October 24, 2019
Biology Paper on Evolution of Birds
Scott Lewis Evolution Lab BIO/101 University of Phoenix Evolution Lab The evolution lab report is based the theory of Darwin and Wallace and determining the type of seeds the birds feed on an average rainfall in the island of Galapagos. The birds in this experiment live on the island and survival is not easy and it is baking hot during the day, freezing cold at night and there isnââ¬â¢t much food available. Because of this, the birds have very specialized feeding behaviors. An example of evolution resulting from natural selection was discovered among birds living in the Galapagos Island.These birds have varieties that vary in what they eat and their appearance. The specialization developed allowed the birds to survive during the dry season or times of drought/low precipitation when little food is available. Then this specialized tool allows the birds to better compete for food resources with other birds and animals. The objective of this experiment is to differentiate and determin e what happen when the parameters are changed over time between the Darwin and Wallace report. The first experiment is meant to study the influence of beak size on the birdsââ¬â¢ population numbers.Deep breaks are suited to crack hard seeds, and shallow beaks are better suited for cracking soft seeds. To test out the hypothesis, I was able to change the beak size of Darwin to 17. 0mm and let Wallace Island at 12. 0mm. By doing so, the average beak size rose over time whereas it fluctuates for Wallace. The clutch size was changed from 10 eggs to 30 eggs for Darwin and left at 10 eggs for Wallace as well as population of 600 and 200 respectively. I also wondered about the changes of bird beaks from island to island.When I changed the cm on the beak, I was able to conclude that these numbers help them adapt to the island and make them more fit to survival on available food. The material that was used to create this hypothesis was accessed through the Evolution Lab on the student web site. I was able to change the clutch size as well as the beak because I felt that those where the most important aspects of these experiment. The determine reason for this according to the Darwin and Wallace, is the difference in temperature between summer and winter and the associated consequences for the life of the birds.The different approach that I used for the clutch size was related to biological characteristics, such as the body weight or environmental factors such as climate. I was able to input the two sizes into the data to come up with the results as far as how the population grows with each size. ================ Input Parameters ================ Parameter DARWIN WALLACE ââ¬âââ¬âââ¬âââ¬âââ¬âââ¬âââ¬âââ¬âââ¬âââ¬âââ¬âââ¬âââ¬âââ¬â- Initial Beak Size: 17. 0 mm 12. 0 mm Heritability: 0. 7 0. 7 Variance: 2. 0 2. 0 Clutch Size: 30. 0 eggs 10. 0 eggsPrecipitation: 27. 0 cm 27. 0 cm Population: 600. 0 birds 200. 0 birds Isl and Size: 1. 0 km 1. 0 km ==================== Experimental Results ==================== Year Dar Beak Dar Pop | Wal Beak Wal Pop ââ¬âââ¬âââ¬âââ¬âââ¬âââ¬âââ¬âââ¬â-+ââ¬âââ¬âââ¬âââ¬âââ¬âââ¬â- 1997 17. 08 600 | 12. 05 200 1998 17. 08 2142 | 12. 11 273 1999 17. 2 833 | 12. 16 401 2000 17. 35 2127 | 12. 27 447 2001 17. 46 866 | 12. 37 610 2002 17. 69 1875 | 12. 47 651 2003 17. 89 1096 | 12. 7 650 2004 18. 0 1924 | 12. 49 746 2005 18. 08 1149 | 12. 65 791 2006 18. 11 1727 | 12. 84 803 2007 18. 2 1280 | 13. 02 788 2008 18. 27 1885 | 13. 25 742 2009 18. 43 1100 | 13. 32 774 2010 18. 64 1999 | 13. 33 726 2011 18. 72 1097 | 13. 48 734 2012 18. 72 1974 | 13. 63 767 2013 18. 85 1063 | 13. 59 883 2014 18. 95 1960 | 13. 69 872 2015 18. 98 1225 | 13. 82 816 2016 19. 1 2039 | 13. 96 806 017 19. 16 1035 | 14. 11 815 2018 19. 27 2030 | 14. 16 805 2019 19. 31 1042 | 14. 34 859 2020 19. 37 2020 | 14. 47 803 2021 19. 41 1149 | 14. 59 908 2022 19. 4 6 2010 | 14. 69 1003 2023 19. 54 1108 | 14. 9 960 2024 19. 54 2090 | 15. 09 984 2025 19. 65 1000 | 15. 31 956 2026 19. 77 2150 | 15. 37 1049 2027 19. 84 1022 | 15. 41 950 2028 19. 94 2141 | 15. 56 974 2029 20. 03 1028 | 15. 67 961 030 20. 07 2196 | 15. 9 1024 2031 20. 1 924 | 16. 08 1090 2032 20. 15 2230 | 16. 12 989 2033 20. 11 897 | 16. 23 1051 2034 20. 13 2257 | 16. 33 1062 2035 20. 21 877 | 16. 5 1052 2036 20. 24 2286 | 16. 59 1052 2037 20. 23 865 | 16. 72 1094 2038 20. 29 2236 | 16. 83 1097 2039 20. 34 964 | 16. 97 1145 2040 20. 37 2261 | 17. 07 1133 2041 20. 48 916 | 17. 2 1133 2042 20. 52 2251 | 17. 5 1081 2043 20. 57 958 | 17. 37 1052 2044 20. 61 2331 | 17. 5 1095 2045 20. 66 847 | 17. 64 1082 2046 20. 74 2362 | 17. 78 1139 2047 20. 85 861 | 17. 9 1060 2048 20. 88 2518 | 17. 91 1097 2049 20. 82 703 | 18. 04 1160 2050 20. 77 2250 | 18. 16 1238 2051 20. 73 964 | 18. 3 1220 2052 20. 82 2231 | 18. 37 1211 2053 20. 92 930 | 18. 55 1135 2054 20. 96 2302 | 18. 72 1271 2055 21. 913 | 18. 85 1284 2056 21. 2 2254 | 18. 87 1189 2057 21. 28 902 | 18. 96 1224 2058 21. 29 2392 | 19. 09 1210 2059 21. 28 760 | 19. 23 1282 2060 21. 28 2463 | 19. 34 1150 2061 21. 29 735 | 19. 38 1196 2062 21. 38 2416 | 19. 39 1265 2063 21. 52 780 | 19. 47 1299 2064 21. 5 2431 | 19. 49 1268 2065 21. 51 824 | 19. 5 1348 2066 21. 53 2457 | 19. 55 1249 2067 21. 65 758 | 19. 62 1312 068 21. 73 2583 | 19. 65 1216 2069 21. 71 672 | 19. 85 1184 2070 21. 75 2334 | 19. 85 1291 2071 21. 66 870 | 19. 97 1248 2072 21. 68 2375 | 20. 06 1168 2073 21. 73 869 | 20. 12 1319 2074 21. 77 2302 | 20. 14 1316 2075 21. 77 894 | 20. 24 1230 2076 21. 74 2400 | 20. 32 1313 2077 21. 77 885 | 20. 4 1328 2078 21. 76 2316 | 20. 39 1297 2079 21. 78 911 | 20. 41 1343 2080 21. 78 2410 | 20. 5 1339 2081 21. 83 776 | 20. 44 1299 2082 21. 81 2550 | 20. 49 1286 2083 21. 8 712 | 20. 6 1303 2084 21. 88 2356 | 20. 69 1234 2085 21. 88 927 | 20. 75 1328 2086 21. 87 2318 | 20. 65 1347 2087 21. 87 856 | 20. 66 1405 2088 21. 89 239 6 | 20. 64 1296 2089 21. 9 875 | 20. 7 1327 2090 21. 93 2161 | 20. 7 1341 2091 22. 0 997 | 20. 74 1405 2092 22. 04 2458 | 20. 69 1328 2093 22. 7 781 | 20. 79 1246 2094 22. 09 2350 | 20. 81 1344 2095 22. 24 854 | 20. 83 1272 2096 22. 36 2432 | 20. 88 1293 2088 21. 98 2146 | 20. 6 1312 2089 22. 07 1051 | 20. 69 1368 2090 22. 14 2286 | 20. 71 1260 2091 22. 19 880 | 20. 83 1323 2092 22. 2 2386 | 20. 87 1316 2093 22. 24 869 | 20. 99 1336 2094 22. 33 2388 | 20. 96 1420 2095 22. 46 839 | 20. 97 1355 2096 22. 52 2362 | 20. 95 1389In conclusion, the hypothesis was accepted in the fact the environmental factors plays a huge role in the survival of the birds. The clutch size is very important in determining whether the population of the birds goes extinct on either island. Clutch size is the number of eggs that a female bird lays in her nest and in these experiment, birds mate for life and live for one year and each female produces only one clutch of eggs per year. References This is a hanging indent. To keep the hanging indent format, simply delete this line of text using the backspace key, and replace the information with your reference entry.
Wednesday, October 23, 2019
Careercup Top 150 Questions
Cracking the Technical Interview by Gayle Laakmann, CareerCup. com 150 Technical Interview Questions and Solutions, written by experts. PLUS: à » à » à » Behind the scenes look at Google Microsoft, Amazon and Yahoo interviews. Interview War Stories: the view from the other side. Advice on how to approach 24 types of interview questions. Copyright Information Copyright 2009 by Gayle Laakmann All rights reserved exclusively for [emailà protected] google. com www. careercup. com Table of Contents Introduction Practice Interviews. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 The Microsoft Interview. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 The Amazon Interview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 The Google Interview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 The Yahoo Interview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 Interview War Stories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 Interview Questions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 Chapter 1 Chapter 2 Chapter 3 Chapter 4 Chapter 5 Chapter 6 Chapter 7 Chapter 8 Chapter 9 Chapter 10 Chapter 11 Chapter 12 Chapter 13 Chapter 14 Applied Mathematics. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 Arrays & Hash Tables. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 Bit Manipulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 Brain Teasers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 C / C++ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 Counting and Combinatorics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 Database. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 Debugging Existing Code. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 Games . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 Java. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 Large Scale & Memory Limits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 Linked Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 Low Level . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 Matrix. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 4 à © 2009 CAREERCUP exclusively for [emailà protected] google. com Table of ContentsChapter 15 Chapter 16 Chapter 17 Chapter 18 Chapter 19 Chapter 20 Chapter 21 Chapter 22 Chapter 23 Chapter 24 Networking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 Object Oriented Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 Probability and Randomness . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 Software and System Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 Sorting and Searching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 Stacks and Queues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 Strings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 Threads And Locks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 Trees and Graphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 Solutions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69 à © 20 09 CAREERCUP 5 Practice Interviews Studying helps, but nothing can prepare you like the real thing. Each CareerCup interviewer has given over a hundred interviews at Google, Microsoft, or Amazon. To nail your interview, sit down with a trained interviewer and get their experienced feedback. See www. careercup. om/interview for more details. One Hour Interview with Real Interviewers Our interviewers will give you a real interview, just like youââ¬â¢d get at Google, Microsoft or Amazon. Weââ¬â¢ll test you on the same types of questions that they do. Weââ¬â¢ll grade you the same way they do. How can we do this? Weââ¬â¢ve done over 100 interviews each for these companies. Weââ¬â¢ve screened resumes. Weââ¬â¢ve been part of their hiring committees. We know what they want. Weââ¬â¢ll Also Give Youâ⬠¦ à » à » à » à » à » An . mp3 recording of your interview. Feedback on where you shined and where you struggled. Specific suggestions on how to improve.Instructions on how to approach tough problems Lessons on what interviewers look for in your code. A Typical Interview A typical interview includes a brief discussion of your resume and one or more technical questions. Each interview will do coding via a shared document. When the interview is completed, weââ¬â¢ll give you immediate feedback on how you did while itââ¬â¢s still fresh in your mind. Later that day, youââ¬â¢ll receive an mp3 of the interview to refresh your memory. Schedule Your Interview Today! See http://www. careercup. com/interview for pricing and details! 6 à © 2009 CAREERCUP xclusively for [emailà protected] google. com The Microsoft Interview Microsoft wants smart people. Geeks. People who are passionate about technology. You probably wonââ¬â¢t be tested on the ins and outs of C++ APIs, but you will be expected to write code on the board. In a typical interview, youââ¬â¢ll show up at Microsoft at some time in the morning and fill out initial paper work. Youà ¢â¬â¢ll have a short interview with a recruiter where he or she will give you a sample question. Be nice to your recruiters; while they may not evaluate your technical skills in depth, they can fight for you to be hired ââ¬â or not.Throughout the day, youââ¬â¢ll move around from interviewer to interviewer, visiting each one in their office. Use this time to look around and get a feel for what the team culture. Interviewers are not allowed to share their feedback on you with other interviewers, due to concerns of bias. Nonetheless, many sources indicate that some feedback is shared. When you complete your interviews with a team, you might speak with a hiring manager. If so, thatââ¬â¢s a great sign! It likely means that you passed the interviews with a particular team. Itââ¬â¢s now down to the hiring manDefinitely Prepare: agerââ¬â¢s decision.You might get a decision that day, or it might be a week. After one week of no word from HR, send them a friendly email asking for a status update. ââ¬Å"Why do you want to work for Microsoft? â⬠In this question, Microsoft wants to see that youââ¬â¢re passionate about technology. A great answer might be, ââ¬Å"Iââ¬â¢ve been using Microsoft software as long as I can remember, and Iââ¬â¢m really impressed at how Microsoft creates manages to create a product that is universally excellent. For example, Iââ¬â¢ve been using Visual Studio recently to learn game programming, and itââ¬â¢s APIs are excellent. â⬠Note how this shows a passion for technology!Whatââ¬â¢s Unique: Youââ¬â¢ll only reach the hiring manager if youââ¬â¢ve done well, but if you do, thatââ¬â¢s a great sign! [emailà protected] google. com à © 2009 CAREERCUP 7 The Amazon Interview Amazonââ¬â¢s recruiting process usually begins with one or two phone screens in which you interview with a specific team. The engineer who interviews you will usually ask you to write simple code and read it aloud on the pho ne. They will ask a broad set of questions to explore what areas of technology youââ¬â¢re familiar with. Next, you fly to Seattle for four or five interviews with one or two teams which have selected you based on your resume and phone interviews.You will have to code on a whiteboard, and some interviewers will stress other skills. Interviewers are each assigned a specific area to probe and may seem very different from each other. They can not see other feedback until they have submitted their own and they are discouraged from discussing it until the hiring meeting. Amazonââ¬â¢s ââ¬Å"bar raiserâ⬠interviewer is charged with keeping the interview bar high. They attend special training and will interview candidates outside their group in order to balance out the group itself.If one interview seems significantly harder and different, thatââ¬â¢s most likely the bar raiser. This person has both significant experience with interviews Definitely Prepare: and veto power in th e hiring decision. You Amazon is a web-based company, and will meet with your recruiter at the end of the day. that means that they care about scale. Once your interviewers have entered their feedback, they will meet to discuss it. They will be the people making the hiring decision. While Amazonââ¬â¢s recruiters are excellent at following up with candidates, occasionally there are delays.If you havenââ¬â¢t heard from Amazon within a week, we recommend a friendly email. Make sure you prepare questions in ââ¬Å"Large Scale. â⬠You donââ¬â¢t need a background in distributed systems to answer these questions. Just answer the question for one system and then think, how does your solution change with multiple computers? Additionally, Amazon tends to ask a lot of questions that are based in mathematics and randomness. Whatââ¬â¢s Unique: The Bar Raiser, who is brought in from a different team to keep the bar high. 8 à © 2009 CAREERCUP exclusively for [emailà protected] google. com The Google InterviewThere are many scary stories floating around about Google interviews, but itââ¬â¢s mostly just that: stories. The interview is not terribly different from Microsoftââ¬â¢s or Amazonââ¬â¢s. However, because Google HR can be a little disorganized, we recommend being proactive in communication. A Google engineer performs the first phone screen, so expect tough technical questions. On your onsite interview, youââ¬â¢ll interview with four to six people, one of whom will be a lunch interviewer. Interviewer feedback is kept confidential from the other interviewers, so you can be assured that you enter each interview with blank slate.Your lunch interviewer doesnââ¬â¢t submit feedback, so this is a great opportunity to ask honest questions. Written feedback is submitted to a hiring committee of engineers to make a hire/no-hire recommendation. Feedback is typically broken down into four categories (Analytical Ability, Coding, Experience and Commun ication) and you are given a score from 1. 0 to 4. 0 overall. The hiring committee understands that you canââ¬â¢t be expected to excel in every interview, but if multiple people raise the same red flag (arrogance, poor coding skills, etc), that can disqualify you.A hiring committee typically wants to see one interviewer who is an ââ¬Å"enthusiastic endorser. â⬠In other words, a packet with scores of 3. 6, 3. 1, 3. 1 and 2. 6 is better than all 3. 1ââ¬â¢s. Your phone screen is usually not a factor in the final decision. The Google hiring process can be slow. If you donââ¬â¢t hear back within one week, politely ask your recruiter for an update. A lack of response says nothing about your performance. Definitely Prepare: As a web-based company, Google cares about how to design scalable system. So, make sure you prepare question from ââ¬Å"Large Scale. Additionally, many Google interviewers will ask questions involving bit shifting and Bit Manipulation, so please brush u p on these questions. Whatââ¬â¢s Different: Your interviewers do not make the hiring decision. Rather, they enter feedback which is passed to a hiring committee. The hiring committee recommends a decision which can beââ¬âthough rarely isââ¬ârejected by Google executives. [emailà protected] google. com à © 2009 CAREERCUP 9 The Yahoo Interview Resume Selection & Screening: While Yahoo tends to only recruit at the top 10 ââ¬â 20 schools, other candidates can still get interviewed throughYahooââ¬â¢s job board (or ââ¬â better yet ââ¬â if they can get an internal referral). If youââ¬â¢re one of the lucky ones selected, your interview process will start off with a phone screen. Your phone screen will be with a senior employee (tech lead, manager, etc). Onsite Interview: You will typically interview with 6 ââ¬â 7 people on the same team for 45 minutes each. Each interviewer will have an area of focus. For example, one interviewer might focus on databases, while another interviewer might focus on your understanding of computer architecture.Interviews will often be composed as follows: 5 minutes: General conversation. Tell me about yourself, your projects, etc. 20 minutes: Coding question. For example, implement merge sort. 20 minutes: System design. For example, design a large distributed cache. These questions will often focus on an area from your past experience or on something your interviewer is curDefinitely Prepare: rently working on. Decision: At the end of the day, you will likely meet with a Program Manager or someone else for a general conversation (product demos, concerns about the company, your competing offers, etc).Meanwhile, your interviewers will discuss your performance and attempt to come to a decision. The hiring manager has the ultimate say and will weigh the positive feedback against the negative. If you have done well, you will often get a decision that day, but this is not always the case. There can be many rea sons that you might not be told for several days ââ¬â for example, the team may feel it needs to interview several other people. Yahoo, almost as a rule, asks questions about system design, so make sure you prepare that. They want to know that you can not only write code, but that you can design software.Donââ¬â¢t worry if you donââ¬â¢t have a background in this ââ¬â you can still reason your way through it! Whatââ¬â¢s Unique: Your phone interview will likely be performed by someone with more influence, such as a hiring manager. Yahoo is also unusual in that it often gives a decision (if youââ¬â¢re hired) on the same day. Your interviewers will discuss your performance while you meet with a final interviewer. 10 à © 2009 CAREERCUP exclusively for [emailà protected] google. com Interview War Stories The View from the Other Side of the Front, by Peter BaileyFor the eager candidate getting ready for a big job interview, Cracking the Technical Interview is an inva luable reference, containing excellent coaching and practice material that gives you an inside edge on the interview process. However, as you go over your old data structures textbook and drill yourself with homemade discrete math flash cards, donââ¬â¢t make the mistake of thinking of the interview as a kind of high-pressure game show ââ¬â that if you just give all the right answers to the tech questions, you too can win a shiny new career (this week, on Who Wants to be a Software Engineer? While the technical questions on computer science obviously are very important, the most important interview question is not covered in this guidebook. In fact, itââ¬â¢s often the single most important question in your interviewersââ¬â¢ minds as they grill you in that little room. Despite the questions on polymorphism and heaps and virtual machines, the question they really want an answer to is â⬠¦ Would I have a beer with this guy? Donââ¬â¢t look at me like that, Iââ¬â¢m s erious! Well, I may be embellishing a little, but hear me out.The point Iââ¬â¢m trying to make is that interviewers, especially those that you might work with, are probably just as anxious as you are. Nonsense, you say, as a nervous young professional, checking your pants for lint while you bite your fingernails, waiting for the interview team to show up in the front lobby. After all, this is the big leagues, and these guys are just waiting for you to slip up so they can rip you apart, laugh at your shriveled corpse, and grind your career dreams to dust beneath the heels of their boots. Right? Just like pledge week, back in freshman year?Right? Hmmm? Nothing could be further from the truth. The team of developers and managers interviewing you have their own tasks and projects waiting for them, back at their own desks. Believe me, theyââ¬â¢re hoping that every interview is going to be the last one. Theyââ¬â¢d rather be doing anything else. There might be a batch of upcoming projects looming on their calendar, and they need more manpower if theyââ¬â¢re going to even have a prayer of making their deadline. But the last guy the agency sent over was a complete flake who railed about Microsoftââ¬â¢s evil for half an hour.And the one before that couldnââ¬â¢t code his way out of a wet paper bag without using copy-and-paste. Sheesh, they think, where is HR getting these guys? How hard can it be to hire one lousy person? While they may not literally be asking themselves ââ¬Å"Would I have a beer with this guy (or gal)â⬠, they are looking to see how well you would fit in with the team, and how you would affect team chemistry. If they hire you, youââ¬â¢re all going to be spending a lot of time together for 11 à © 2009 CAREERCUP exclusively for [emailà protected] google. com Interview War Stories he next few months or years, and they want to know that they can rely on you ââ¬â and maybe even come to consider you a friend and colleague. The y want to know that they can depend on you. And as tempting as it might be to them to just settle and hire the next person who comes along, they know better. In many companies, particularly large U. S. companies, itââ¬â¢s harder to fire somebody than it is to hire somebody. (Welcome to the US: Land of Lawsuits! ) If they hire a dud, theyââ¬â¢re stuck with them. That person might be unproductive or, even worse, a drain on the teamââ¬â¢s productivity.So they keep interviewing, until they find the right person. They know that itââ¬â¢s better to reject a good candidate than hire a bad one. Some of those interviews are real doozies. Once youââ¬â¢ve interviewed long enough, you build up a repertoire of horror stories. War stories, of candidates who looked promising on paper until the interviews went terribly, terribly wrong. These war stories are not only humorous ââ¬â theyââ¬â¢re also instructive. Names have been changed to protect the innocent ââ¬â or downright ridiculous. zyxwvutsrqponmlkjihgfedcba ZYXWVUTSRQPONMLKJIHGFEDCBA [emailà protected] google. comkjlslen 0987654321+_=-)(*&^%$#@! ~[]{};ââ¬â¢:â⬠,. /? ABCDEZYXW abcdeyxw asdsasdFGJwRXGs75rpqR3oFWHMJHp-RQ. Lââ¬âLqJ. H-rsdkktNNsasdf [emailà protected] google. com [emailà protected] google. com à © 2009 CAREERCUP 12 Interview War Stories Pop Divas Need Not Apply Leonard was a very promising C++ coder, three years out of college, with a solid work history and an impressive skill set. He proved on the phone screen that he was above-average technically, and so he was invited in for an interview. We needed a savvy C++ person to work on a piece of middleware that interfaced with our database, and Leonard seemed like a sure fit.However, once we started talking to him, things went south in a hurry. He spent most of the interview criticizing every tool and platform that we questioned him on. We used SQL Server as our database? Puhleease. We were planning to switch to Oracle s oon, right? Whatââ¬â¢s that? Our team used Tool A to do all our coding in? Unacceptable. He used Tool B, and only Tool B, and after he was hired, weââ¬â¢d all have to switch to Tool B. And weââ¬â¢d have to switch to Java, because he really wanted to work with Java, despite the fact that 75 percent of the codebase would have to be rewritten.Weââ¬â¢d thank him later. And oh, by the way, he wouldnââ¬â¢t be making any meetings before ten oââ¬â¢clock. Needless to say, we encouraged Leonard to seek opportunities elsewhere. It wasnââ¬â¢t that his ideas were bad ââ¬â in fact, he was ââ¬Å"technicallyâ⬠right about many things, and his (strong) opinions were all backed with solid fact and sound reason (except for the ten oââ¬â¢clock thing ââ¬â we think he may have just been making a ââ¬Å"power playâ⬠. ) But it was obvious that, if hired, Leonard wasnââ¬â¢t going to play well with others ââ¬â he would have been toxic kryptonite for team chem istry.He actually managed to offend two of the team members during the forty-five minutes of his interview. Leonard also made the mistake of assuming that Code Purity and Algorithm Beauty were always more important than a business deadline. In the real world, there are always compromises to be made, and knowing how to work with the business analysts is just as important as knowing how to refactor a blob of code. If Leonard would not have gotten along with other IT people, he definitely wouldnââ¬â¢t have gotten along with the business folks. Maybe you can get away ith hiring a Leonard if heââ¬â¢s one of the best ten coders in the world (he wasnââ¬â¢t). But he was the classic failure example for the ââ¬Å"Would you have a beer with this guy? â⬠test. 13 à © 2009 CAREERCUP exclusively for [emailà protected] google. com Interview War Stories What We Have Here is Failure to Communicate Trisha was a mid-level Java developer with a solid history of middleware and JSP work on her resume. Since she was local, we invited her in for an interview without a phone screen. When we started asking her questions, it quickly became obvious that Trisha was a woman of few words.Her answers were short and often composed of ââ¬Å"yes/noâ⬠responses, even to questions that were meant to start a dialog. Once she did start opening up, I still wasnââ¬â¢t sure she was actually talking. I saw her lips moving, and heard mumbling sounds coming out, but it wasnââ¬â¢t anything that sounded like English. Iââ¬â¢m not sure if Trisha was nervous or just shy, but either way, I had to ask her numerous times to repeat herself. Now I was the one getting nervous! I didnââ¬â¢t want to be the guy who ââ¬Å"ruinedâ⬠the interview, so I pulled back on my questions. The other folks in the room and I exchanged uneasy glances.We felt like we were on a Seinfeld episode. It was almost impossible to understand Trisha, and when she did speak up, her halting, uncertain, c onfused speech patterns made us feel more like code breakers than interviewers. I am not exaggerating to say that I did not understand a single answer she gave during the interview. Knowing, alone, isnââ¬â¢t good enough. Youââ¬â¢re going to be talking with other technical people, and youââ¬â¢re going to be talking to customers, and sales reps, and Betty from Marketing. You will write something eventually, whether itââ¬â¢s documentation, or a project plan, or a requirements document.The word processor might correct your spelling, but it wonââ¬â¢t correct your lousy writing. The ability to communicate thoughts and ideas, in a clear, concise manner, is an absolutely invaluable skill that employers seek. The same goes for verbal communication. I used to work with a co-worker who doubled the length of every meeting he was in, because he could not answer a question in less than ten minutes. ââ¬Å"Hey, Dennis, what time is it? â⬠ââ¬Å"Well, thatââ¬â¢s kind of inte resting, because I just happened to be reading an article on cesium clocks and leap seconds and the history of the Gregorian Calendar and â⬠¦ Iââ¬â¢ll spare you the rest. [emailà protected] google. com à © 2009 CAREERCUP 14 Interview War Stories You Can Count on Me, Just Not Until Early Afternoon Ahhh, 1999. The crest of the dot-com bubble, and the tightest labor market in history. Our company was racing to expand its development team, and we would have hired a German Shepherd if it knew HTML. Instead, we wound up hiring Ian. We shouldââ¬â¢ve hired the dog. Ian was a cheerful, friendly guy who had a gift of natural charisma. He got along fantastically with all of the interviewers, and seemed very intelligent.Skillwise, he was adequate. He hadnââ¬â¢t written a single line of computer code outside of his college courses, and didnââ¬â¢t even have his own e-mail address. When we gave Ian the chance to ask us questions at the end of the interview, he asked about flexib le work hours, and how soon he could take vacation time. Instead of showing an interest in the career opportunities, or in companyââ¬â¢s growth prospects, he asked whether he could take the all-you-could-drink break room soda home with him. The questions grew more bizarre from there. Ian was very interested in our Legal Assistance benefit.He wanted to know if it covered the cost of filing lawsuits, if it covered him if he got sued himself, if it applied to any lawsuits he currently was involved in, and if he could ââ¬Å"theoreticallyâ⬠use it to sue the company itself. He also asked us if he could use it to help him ââ¬Å"fixâ⬠some unpaid speeding tickets. In any other year, that should have been it for Ian right there. But, in 1999, we were hiring anybody who was even remotely competent. Ian collected paychecks from us for eighteen months, and he was about as productive as a traffic cone.He usually sauntered into the office around ten-thirty with some sort of lame e xcuse (by my count, he had to wait for the cable guy sixteen times in a six-month period). He usually killed the morning by answering e-mail and playing ping-pong, before breaking for a two-hour lunch. After lunch, it was more pingpong, and maybe an hour of writing bad code, before bolting the office sometime around three. He was the dictionary definition of unreliable. Remember, your potential future team members need to know that they can rely on you. And they need to know that you wonââ¬â¢t need constant supervision and hand-holding.They need to know that youââ¬â¢re able to figure things out on your own. One of the most important messages that you, as a candidate, can convey in your interview is hiring me will make your lives easier. In fact, this is a large part of the reason for the famously difficult interview questions at places like Amazon and Google; if you can handle that kind of unpredictable pressure in an interview, then you stand a good chance of being useful to them on real projects. To cite a more subtle example, once I was on a four person team that was desperately trying to recruit new members to help work on an old pile of software.It was a real mess; weââ¬â¢d inherited a nasty ball of spaghetti, and we needed people who could jump in, figure things out, and be part of the solution. There was one very smart fellow, Terry, who would have been a great asset for our team ââ¬â 15 à © 2009 CAREERCUP exclusively for [emailà protected] google. com Interview War Stories but we didnââ¬â¢t hire him, despite his excellent technical and personal skills. It was because he insisted on meticulous written instructions for every step of the coding process.He wasnââ¬â¢t going to make a suggestion or take any initiative ââ¬â or blow his nose, for that matter ââ¬â without a mile-long audit trail and a dozen signatures. While he insisted that he worked that way for reasons of quality (a defensible point), we got the impression that it had more to do with butt-covering, and we simply didnââ¬â¢t have the time for that kind of bureaucracy. Terry would have been an excellent fit in a government or aerospace IT department, something that required ISO 9000 procedures. But he would have never fit into our team; he would have been a burden, not an asset.[emailà protected] google. com à © 2009 CAREERCUP 16 Interview War Stories My Spider Senses are Tingling I can think of lots of interviews that just fell into the general category of weird and uncomfortable: à » à » à » à » à » à » The Java coder who apparently considered hygiene optional, and had the interview room smelling like week-old blue cheese within ten minutes (my eyes were watering). The young fresh-out-of-college graduate with a tongue piercing that kept tick-tick-ticking against his teeth as he talked (after half an hour, it was like Chinese water torture).The girl who wore an iPod through her interview, with the volume turned loud enough that s he actually had to ask the interviewers to repeat themselves a few times. The poor, hyper-nervous fellow who was sweating like a marathon runner for half an hour. The girl who wore a T-shirt with an obscene political slogan to her interview. The guy who asked (seriously) at the end of his interview, ââ¬Å"So, are there any hot chicks in our department? â⬠Those are the interviews where we politely thank the people for their time, shake their hand (except for the sweaty guy), then turn to each other after the door closes and ask ââ¬â did that really just happen?Nobody is saying that you have to be a bland, boring robot in a Brooks Brothers suit and tie. Remember, the interview team wants you to be ââ¬Å"the oneâ⬠, but theyââ¬â¢re also very worried about the possibility that youââ¬â¢re going to be more of a distraction than an asset. Donââ¬â¢t talk or behave in a way that will set off their early warning radar. Whether or not somebody bothers to behave profess ionally during an interview is often a very good indicator of what kind of teammate theyââ¬â¢re going to be. Rudimentary social skills are part of the answer to ââ¬Å"Would I have a beer with this guy? , or at least, ââ¬Å"Will I mind working next to this guy for six months? â⬠From the interviewerââ¬â¢s point of view, theyââ¬â¢re picking a neighbor that theyââ¬â¢re going to live and work with 200 hours per week for foreseeable future. Would you really want a neighbor that smelled like a hog rendering plant? 17 à © 2009 CAREERCUP exclusively for [emailà protected] google. com Interview Questions Study hard, practice and good luck! How this Book is Organized The interview questions in this book are grouped into categories, with a page preceding each category offering advice and other information.Within each category, the questions are sorted by approximate level of difficulty. Solutions for all questions are at the back. How to Use this Book An effective intervi ew is not about memorizing interview questions, but rather, about applying an understanding of concepts and demonstrating your problem solving ability. Use these questions to find the gaps in your knowledge and to learn problem solving techniques that you can apply to new questions. Advice for Devs Your interview will be most likely not be conducted on a computer. Thus, when you practice the problems in this book, we recommend writing them down on paper first.Then, type your solution into the computer exactly as you wrote it and see how you did. Special Advice for SDETs Not only do SDETs have to be great testers, but they also have to be great coders. Thus, we recommend that you complete the coding problems in this book with an eye for testing them. Even when the question doesnââ¬â¢t specifically ask it, you should ask yourself, ââ¬Å"how would I test this? â⬠Remember: any problem can be an SDET problem. Suggestions and Corrections While we do our best to ensure that all t he solutions are correct, mistakes will be made. Moreover, sometimes there is no ââ¬Å"rightâ⬠answer.If youââ¬â¢d like to offer a suggestion or correction, please submit it at http:// xrl. us/ccbook [emailà protected] google. com à © 2009 CAREERCUP 18 Applied Mathematics How to Approach: CHAPTER-1 Many of the so-called ââ¬Å"Applied Mathematicsâ⬠problems read as brain teasers at first, but can be worked through in a logical way. Just remember to rely on the rules of mathematics to develop an approach, and then to carefully translate that idea into code. Example: Given two numbers m and n, write a method to return the first number r that is divisible by both (e. g. , the least common multiple).The Approach: What does it mean for r to be divisible by m and n? It means that all the primes in m must go into r, and all primes in n must be in r. What if m and n have primes in common? For example, if m is divisible by 3^5 and n is divisible by 3^7, what does this mean a bout r? It means r must be divisible by 3^7. The Rule: For each prime p such that p^a m (e. g. , m is divisible by p^a) and p^b n, r must be divisible by p^max(a, b) The Algorithm: Define q to be 1. for each prime number p less than m and n: find the largest a and b such that p^a m and p^b n let q = q * p^max(a, b) return qThings to Watch Out For: 1. 2. Be careful with the difference in precision between floats vs. doubles. Donââ¬â¢t assume that a value (such as the slope of a line) is an int unless youââ¬â¢ve been told so. Prime Numbers 1. 2. Every number can be written as a product of primes. Example: 504 = 2^3 * 3^2 * 7 f x is divisible by y, then every prime factor in y must be found in x. Example: If 504 is divisible by y, then y could be 168 (2^3 * 3 * 7), or 21 (3 * 7), or 4 (2^2), or many other things. Y could not, however, be equal to 10 (5 * 2), since 5 is not found in x 19 à © 2009 CAREERCUP exclusively for [emailà protected] oogle. com Applied Mathematics CH APTER-1 1. 1 Write a method to generate the nth Fibonacci number _______________________________________________________________________pg 69 1. 2 Write a method to count the number of 2ââ¬â¢s between 0 and n. EXAMPLE input: 35 output: 14 [list of 2ââ¬â¢s: 2, 12, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 32] _______________________________________________________________________pg 70 1. 3 Given two lines on a Cartesian plane, determine whether the two lines would intersect. _______________________________________________________________________pg 74 1. Given two squares on a two dimensional plane, find a line that would cut these two squares in half. _______________________________________________________________________pg 75 1. 5 Write an algorithm which computes the number of trailing zeros in n factorial. EXAMPLE input: 11 output: 2 (11! = 39916800) _______________________________________________________________________pg 76 1. 6 Write a function that adds two numbers. You sh ould not use + or any arithmetic operators. _______________________________________________________________________pg 77 1. Write a method to implement *, ââ¬â , / operations. You should use only the + operator. _______________________________________________________________________pg 79 1. 8 Design an algorithm to find the kth number such that the only prime factors are 3, 5, and 7. _______________________________________________________________________pg 81 1. 9 A circus is designing a tower routine consisting of people standing atop one anotherââ¬â¢s shoulders. For practical and aesthetic reasons, each person must be both shorter and lighter than the person below him or her.Given the heights and weights of each person in the circus, write a method to compute the largest possible number of people in such a tower. EXAMPLE: Input(ht, wt) : (65, 100) (70, 150) (56, 90) (75, 190) (60, 95) (68, 110) Output: The longest tower is length 6 and includes from top to bottom: (56,90) ( 60,95) (65,100) (68,110) (70,150) (75,190) _______________________________________________________________________pg 84 1. 10 Given a two dimensional graph with 6000 points on it, find a line which passes the most number of points. ______________________________________________________________________pg 86 à © 2009 CAREERCUP 20 Arrays & Hash Tables How to Approach CHAPTER-2 While not all problem can be solved with a hash table, a shocking number of interview problems can be. Keeping track of which items youââ¬â¢ve already seen? Hash table. Needing a way to efficiently look up data? Hash table. The list goes on and on. You should become very extremely comfortable with hash tables: how to implement them and how to use them. Hash Tables A hash table is a data structure that associates keys with values for O(1) lookup.Hash tables are frequently, though not always, implemented with an array. A simple implementation of a hash table that hashes a string to a Person is as follows: class HashTable { Person[] data = new Person[MAX_HASH_KEY]; int getId(string s) { /* return a key for this string */ }; bool contains(string key) { int id = getId(key); if (data247) return true; return false; } void insert(string s, Person p) { data[getId(s)]; } Note: This implementation does not handle collision. Collisions can be handled by ââ¬Å"chainingâ⬠(eg, using a linked list), or a variety of other ways. Vector (Dynamically Resizing Array):A vector, or a dynamically resizing array, is an array that resizes itself as needed while still providing O(1) access. A typical implementation is that when a vector is full, the array doubles in size. Each doubling takes a long time (O(n)), but happens so rarely that its asymptotic time is still O(1). 21 à © 2009 CAREERCUP exclusively for [emailà protected] google. com Arrays CHAPTER-2 2. 1 Suppose we have an array a1, a2, â⬠¦ , an, b1, b2, â⬠¦ , bn. Implement an algorithm to change this array to a1, b1, a2, b2, â⬠¦ , an , bn. _______________________________________________________________________pg 87 . 2 Design an algorithm and write code to remove the duplicate characters in a string without using any additional buffer. NOTE: One or two additional variables is fine. An extra copy of the array is not. FOLLOW UP Write the test cases for this method. _______________________________________________________________________pg 88 2. 3 You are given an array of integers (both positive and negative). Find the continuous sequence with the largest sum. Return the sum. EXAMPLE input: {2, -8, 3, -2, 4, -10} output: 5 [ eg, {3, -2, 4} ] _______________________________________________________________________pg 90 2. Design an algorithm to find all pairs of integers within an array which sum to a specified value. _______________________________________________________________________pg 91 2. 5 An array A[1â⬠¦ n] contains all the integers from 0 to n except for one number which is missing. In this problem, we cannot access an entire integer in A with a single operation. The elements of A are represented in binary, and the only operation we can use to access them is ââ¬Å"fetch the jth bit of A[i]â⬠, which takes constant time. Write code to find the missing integer. Can you do it in O(n) time? ______________________________________________________________________pg 93 à © 2009 CAREERCUP 22 Bit Manipulation How to Approach: CHAPTER-3 Bit manipulation can be a scary thing to many candidate, but it doesnââ¬â¢t need to be! If youââ¬â¢re shaky on bit manipulation, we recommend doing a couple arithmetic-like problems to boost your skills. Compute the following by hand: 1010 ââ¬â 0001 1010 > 1 1010 + 0110 1001^1001 0xFF ââ¬â 1 1100^1010 1001 & 1100 0xAB + 0x11 If youââ¬â¢re still uncomfortable, examine very careful what happens when you do subtraction, addition, etc in base 10. Can you repeat that work in base 2? Things to Watch Out For: Itââ¬â¢s really easy to make m istakes on these problem so, be careful! When youââ¬â¢re writing code, stop and thinking about what youââ¬â¢re writing every couple lines. When youââ¬â¢re done, check through your entire code. If youââ¬â¢re bit shifting, what happens when the digits get shifted off the end? Make sure to think about this case to ensure that youââ¬â¢re handling it correctly. 1 & 0 = 0 1 | 0 = 1 1 ^ 0 = 1 0 & 1 = 0 0 | 1 = 1 0 ^ 1 = 1 1 & 1 = 1 1 | 1 = 1 1 ^ 1 = 0 à » And (&): 0 & 0 = 0 Or (|): 0 | 0 = 0 Xor (^): 0 ^ 0 = 0 Left Shift: x > 2 = 00000110 00011001 >> 4 = 00000001 exclusively for [emailà protected] oogle. com 23 à © 2009 CAREERCUP Bit Manipulation CHAPTER-3 3. 1 Write a function int BitSwapReqd(int A, int B) to determine the number of bits required to convert integer A to integer B. EXAMPLE: _______________________________________________________________________pg 94 3. 2 If you were to write a program to swap odd and even bits in integer, what is the minimum number of in structions required? (eg, bit 0 and bit 1 are swapped, bit 2 and bit 3 are swapped, etc). EXAMPLE: _______________________________________________________________________pg 95 3. 3 Write a method which finds the maximum of two numbers.You should not use if-else or any other comparison operator. EXAMPLE: _______________________________________________________________________pg 96 3. 4 Given a (decimal ââ¬â e. g. 3. 72) number that is passed in as a string, print the binary representation. If the number can not be represented accurately in binary, print ââ¬Å"ERRORâ⬠_______________________________________________________________________pg 97 3. 5 You are given two 32-bit numbers, N and M, and a two bit positions, i and j. Write a method to set all bits between i and j in N equal to M (eg, M becomes a substring of N located at i and starting j).EXAMPLE: _______________________________________________________________________pg 99 3. 6 Write a function to swap a number in plac e without temporary variables. ______________________________________________________________________pg 100 3. 7 Given an integer, print the next smallest and next largest number that have the same number of 1 bits in their binary representation. ______________________________________________________________________pg 101 input: N = 10000000000, M = 10101, i = 2, j = 6 output: N = 10001010100 Input: 5, 10 Output: 10 Input: 10001010 Output: 01000101 Input: 31, 14 Output: 2 2009 CAREERCUP 24 Brain Teasers Do companies really ask brain teasers? CHAPTER-4 While many companies, including Google and Microsoft, have policies banning brain teasers, interviews still sometimes ask these tricky questions. Advice on Approaching Brain Teasers Donââ¬â¢t panic when you get a brain teaser. Interviewers want to see how you tackle a problem; they donââ¬â¢t expect you to immediately know the answer. Start talking, and show the interviewer how you approach a problem. In many cases, you will also find that the brain teasers have some connection back to fundamental laws or theories of computer science.If youââ¬â¢re stuck, we recommend simplifying the problem. Solve it for a small number of items or a special case, and then see if you can generalize it. Example: You are trying to cook an egg for exactly 15 minutes, but instead of a timer, you are given two ropes which burn for exactly 1 hour each. The ropes, however, are of uneven densities ââ¬â eg, half the rope length-wise might take only 2 minutes to burn. The approach: 1. 2. 3. 4. 5. 6. 7. What is important? Numbers usually have a meaning behind them. The fifteen minutes and two ropes were picked for a reason. Simplify!You can easily time one hour (burn just one rope). Now, can you time 30 minutes? Thatââ¬â¢s half the time it takes to burn one rope. Can you burn the rope twice as fast? Yes! (Light the rope at both ends. ) Youââ¬â¢ve now learned: (1) You can time 30 minutes. (2) You can burn a rope that takes X minutes in just X/2 minutes by lighting both ends. Work backwards: if you had a rope of burn-length 30 minutes, that would let you time 15 minutes. Can you remove 30 minutes of burn-time from a rope? You can remove 30 min of burn-time from Rope #2 by lighting Rope #1 at both ends and Rope #2 at one end.Now that you have Rope #2 at burn-length 30 min, start cooking the egg and light rope #2 at the other end. When Rope #2 burns up, your egg is done! 25 à © 2009 CAREERCUP exclusively for [emailà protected] google. com Brain Teasers CHAPTER-4 4. 1 Add arithmetic operators (plus, minus, times, divide) to make the following expression true: 3 1 3 6 = 8. You can use any parentheses youââ¬â¢d like. ______________________________________________________________________pg 103 4. 2 You have a 5 quart jug and 3 quart jug, and an unlimited supply of water (but no measuring cups). How would you come up with exactly four quarts of water?NOTE: The jugs are oddly shaped, such that filling up exactly ââ¬Ëhalfââ¬â¢ of the jug would be impossible. ______________________________________________________________________pg 104 4. 3 There is a building of 100 floors. If an egg drops from the Nth floor or above it will break. If itââ¬â¢s dropped from any floor below, it will not break. Youââ¬â¢re given 2 eggs. Find N, while minimizing the number of drops for the worse case. ______________________________________________________________________pg 105 4. 4 A bunch of men are on an island. A genie comes down and gathers everyone together and places a magical hat on some peopleââ¬â¢s heads (e. . , at least one). The hat is magical: it can be seen by other people, but not by the wearer of the hat himself. To remove the hat, you must dunk yourself underwater at exactly midnight. If there are n people and c hats, how long does it take the men remove the crowns? The men cannot tell each other (in any way) that they have a hat. FOLLOW UP Prove that your solution is correct . ______________________________________________________________________pg 106 4. 5 There are 100 closed lockers in a hallway. A man begins by opening all the 100 lockers. Next, he closes every second locker.Then he goes to every third locker and closes it if it is open or opens it if it is closed (eg, he toggles every third locker). After his 100th pass in the hallway, in which he toggles only locker number 100, how many lockers are open? ______________________________________________________________________pg 108 à © 2009 CAREERCUP 26 C / C++ How To Approach: CHAPTER-5 A good interviewer wonââ¬â¢t demand that you code in a language you donââ¬â¢t profess to know. Hopefully, if youââ¬â¢re asked to code in C++, itââ¬â¢s listed on your resume. If you donââ¬â¢t remember all the APIs, donââ¬â¢t worryââ¬âyour interviewer probably doesnââ¬â¢t either!We do recommend, however, studying up on basic C++ syntax. Pointer Syntax int p = v = Foo int *p; // Defines pointe r. &q; // Sets p to address of q. *p; // Set v to value of q. *f = new Foo(); // Initializes f. k = f->x; // Sets k equal to the value of fââ¬â¢s member variable. C++ Class Syntax class MyClass { private: double var; public: MyClass(double v) {var = v; } ~MyClass() {}; double Update(double v); }; double Complex::Update(double v) { var = v; return v; } C++ vs Java: A very common answer in an interview is ââ¬Å"describe the differences between C++ and Java. If you arenââ¬â¢t comfortable with any of these concepts, we recommend reading up on them. 1. 2. 3. 4. 5. 6. Java runs in a virtual machine. C++ natively supports unsigned arithmetic. In Java, parameters are always passed by value (or with objects, their references are passed by value). In C++, parameters can be passed by value, pointer, or by reference. Java has built-in garbage collection. C++ allows operator overloading. C++ allows multiple inheritance of classes. Thought: Which of these might be considered strengths or w eaknesses of C++ or Java? Why? In what cases might you choose one language over the other? 7 à © 2009 CAREERCUP exclusively for [emailà protected] google. com C / C++ CHAPTER-5 5. 1 What is the difference between a struct and a class? Where would you use each? ______________________________________________________________________pg 109 5. 2 Write a method to print the last ten lines of an input file using C. ______________________________________________________________________pg 110 5. 3 Compare and contrast a hash table vs. an STL map. How is a hash table implemented? If the number of inputs are small, what data structure options can be used instead of a hash table? _____________________________________________________________________pg 111 5. 4 How do a virtual functions work in C++? ______________________________________________________________________pg 112 5. 5 What is the difference between deep copy and shallow copy? Explain how you would use each. _______________________ _______________________________________________pg 113 5. 6 In a class, the ââ¬Ënewââ¬â¢ operator is used for allocating memory for new objects. Can this be done using malloc? If yes, how? If no, why not? Are there any restrictions associated with the use of malloc in place of new? _____________________________________________________________________pg 114 5. 7 What is the significance of the keyword ââ¬Å"volatileâ⬠in C? ______________________________________________________________________pg 115 5. 8 What is name hiding in C++? ______________________________________________________________________pg 116 5. 9 Why does a destructor in base class need to be declared virtual? ______________________________________________________________________pg 117 5. 10 Write a method that takes a pointer to a Node structure as a parameter and returns a complete copy of the passed-in data structure.The Node structure contains two pointers to other Node structures. For example, the meth od signature could look like so: Node* Copy(Node* root); Note: Do not make any assumptions about the data structure ââ¬â it could be a tree, linked list, graph etc. Feel free to choose the language you are most comfortable with (C# or C++ are preferred) In addition to the function code, write a complete suite of unit tests for this problem. ______________________________________________________________________pg 119 5. 11 Write a smart pointer (smart_ptr) class. _____________________________________________________________________pg 120 à © 2009 CAREERCUP 28 Counting and Combinatorics How to Approach: CHAPTER-6 While some problems in this chapter are simply coding problems, understanding the mathematical solution will help you ââ¬Å"sanity checkâ⬠your solution. For example, if you know how many subsets there are of a set, you can check to make sure that your algorithm to print all subsets will give you the correct number of subsets. When computing the number of ways of d oing something, think about doing it step by step. The following two examples will illustrate this technique.How many ways can you pick k elements from n elements, if order matters and elements are not replaced? Eg ââ¬â if we pick 5 different letters, ââ¬Å"abcdeâ⬠is considered to be different from ââ¬Å"edcbaâ⬠. The Approach: We have n choices for the first draw. For the second draw, we only have n-1 since one is removed. Then n-2, â⬠¦. When we draw k times, we get down to n-k+1 choices on the last draw. So, n * (n-1) * (n-2)*â⬠¦ * (n-k+1) The Solution: n! / (n-k)! How many ways can you pick k elements from n elements, if order does not matter and elements are not replaced? Weââ¬â¢re now just throwing letters into a bucket. Picking ââ¬Å"a, bâ⬠is the same thing as ââ¬Å"b, aâ⬠.The Approach: If you compare this problem to the previous one, weââ¬â¢ve essentially double (or triple, quadruple, etc) counted items. That is, ââ¬Å"abcâ⬠, à ¢â¬Å"acbâ⬠, ââ¬Å"bacâ⬠, ââ¬Å"bcaâ⬠, ââ¬Å"cabâ⬠, ââ¬Å"cbaâ⬠were all considered unique in the previous solution but now theyââ¬â¢re considered the same. Just how many times has ââ¬Å"abcâ⬠been included (in its other forms)? 3! times, since there are 3! ways of rearranging ââ¬Å"abcâ⬠. In fact, every item has been included 3! times, when it should have been included just once! So, we divide our previous answer by 3! (or, more generally, k! ). We now get n! / (k! * (n-k)! ). This solution is often written as n-choose-k or nCk. 9 à © 2009 CAREERCUP exclusively for [emailà protected] google. com Counting and Combinatorics CHAPTER-6 6. 1 In how many different ways can a cube be painted by using three different colors of paint? ______________________________________________________________________pg 121 6. 2 Imagine a robot sitting on the upper left hand corner of an NxN grid. The robot can only move in two directions: right and down. Ho w many possible paths are there for the robot? FOLLOW-UP Imagine certain squares are ââ¬Å"off limitsâ⬠, such that the robot can not step on them. Design an algorithm to print all possible paths for the robot. _____________________________________________________________________pg 122 6. 3 Write a method to compute all permutations of a string. ______________________________________________________________________pg 123 6. 4 Implement an algorithm to print all valid (eg, properly opened and closed) combinations of n-pairs of parentheses. EXAMPLE: input: 3 (eg, 3 pairs of parentheses) output: ()()(), ()(()), (())(), ((())) ______________________________________________________________________pg 124 6. 5 Write a method that returns all subsets of a set. ______________________________________________________________________pg 125 2009 CAREERCUP 30 Database How to Approach: CHAPTER-7 You could be asked about databases in a variety of ways: write a SQL query, design a database to h old certain data, or to design a large database. Weââ¬â¢ll go through the latter two types here. Small Database Design Imagine you are asked to design a system to represent a schoolââ¬â¢s registrar: course information, departments, course enrollment, teachers, etc. What are the key objects? Student. Professor. Course. Department. How do they relate to each other? *NOTE: Iââ¬â¢m going to make some assumptions here for the purposes of writing up this explanation.In your interview, donââ¬â¢t make assumptions! Ask your interviewer instead. Many-to-Many: à » A course can belong to multiple departments, and each department can have multiple courses. So, create a separate table DepartmentCourse that acts as a ââ¬Å"pairingâ⬠of the two. DepartmentCourse has just a department_id field and a course_id field. A student can be in multiple courses, a course can have multiple students. So, do the same as above and create a StudentCourse table. A course only has one professor. A professor can teach multiple courses. So, add a field professor_id to the Courses table. à » One-to-Many: à »Large Database Design When designing a large, scalable database, joins (which are required in the above examples), are generally very slow. Thus, you must denormalize your data. Think carefully about what when data will be usedââ¬âyouââ¬â¢ll probably need to duplicate it in multiple tables. 31 à © 2009 CAREERCUP exclusively for [emailà protected] google. com Database CHAPTER-7 7. 1 Write a method to find the number of employees in each department when we have the following tables: ______________________________________________________________________pg 126 7. 2 What are the different types of joins?Please explain how they differ and why certain types are better in certain situations. ______________________________________________________________________pg 127 7. 3 What is normalization? Explain the pros and cons. _________________________________________________ _____________________pg 128 7. 4 Draw a entity-relationship diagram for a database with companies, people, and professionals (people who work for companies). ______________________________________________________________________pg 129 7. 5 You have to design a database that can store terabytes of data. It should support efficient range queries. How would you do it? _____________________________________________________________________pg 130 Employees containing: Emp_ID, Emp_Name and Dept_ID (Primary key) Departments containing: Dept_Name and Dept_ID (foreign key) à © 2009 CAREERCUP 32 Debugging Existing Code How to Approach CHAPTER-8 Sometimes, in an interview, an interviewer asks you to look at a piece of code and identify the mistakes. We recommend the following approach: 1. 2. 3. Examine the code and understand what itââ¬â¢s expected to do. Ask your interviewer what types of data itââ¬â¢s expected to handle, where itââ¬â¢ll be used, etc. Look for syntax errors: does ever ything type check? s the class declaration correct? Look for ââ¬Å"hot spotsâ⬠: à » à » à » à » à » 4. à » à » 5. If you see float and doubles, check for precision errors If you see division, check for rounding errors If you see memory allocation, check for memory leaks If you see unsigned ints, check to see if the int might ever be negative If you see bit manipulation, check for correctness The ââ¬Å"normalâ⬠case The boundary cases (null, 0, 1, MAX, etc) Run through the code with a few examples: Does it do everything itââ¬â¢s expect to? For example, if the code is supposed to return everyone in a database under 21, does it only look for students?Maybe it should be looking for teach-ers as well? Does it handle unexpected cases? What if it takes in a list and it has a loop? 6. Further Advice 1. 2. Look at the space and time complexityââ¬âcan you improve it? Correct the mistakes in the code. But do so carefully! Donââ¬â¢t simply make changes until it work s. Deeply understand the issues and then correct them. 33 à © 2009 CAREERCUP exclusively for [emailà protected] google. com Debugging Existing Code 8. 1 Explain what the following code does: ((n & (n-1)) == 0) CHAPTER-8 ______________________________________________________________________pg 131 8. Find the mistake(s) in the following code: unsigned int i; for (i = 100; i ::Other { int foo() { printf(ââ¬Å"here we are â⬠); }; }; main() { typedef Foo typedef Derived Derived_inst; Derived_inst ii; ii. foo(); } ______________________________________________________________________pg 133 à © 2009 CAREERCUP 34 Games How To Approach: CHAPTER-9 Sometimes interviewers ask these problems simply because theyââ¬â¢re ââ¬Å"fun,â⬠but often, itââ¬â¢s also because ââ¬Å"gameâ⬠problems are heavy on object oriented design. Gaming problems tend to be more ââ¬Å"free formâ⬠and thus they give you the chance to demonstrate how you really code.Define Data Structures W hen implementing something so free form, ask yourself, ââ¬Å"Where can I define a class or a struct? â⬠When in doubt, define a new class or struct. It tells the interviewer that you care about the maintainability of your code. Validate Your Assumptions Be careful about making assumptions. Suppose youââ¬â¢re asked to implement the word game Scrabble. Donââ¬â¢t assume that the dictionary will be in Englishââ¬âor even in that character set. It could be in any language! Ask your interviewer lots and lots of questions so that you know what to implement. Are you solving this problem once, or many times?Sometimes the solution will change depending on whether or not your code will be called multiple times. For example, suppose youââ¬â¢re asked to find all anagrams of a word. If youââ¬â¢re calling this code just once, it may be fastest just to rearrange the letters and check if theyââ¬â¢re in the dictionary. But, if youââ¬â¢re going to call the code multiple time s, itââ¬â¢s now fastest to precompute data by iterating through all the words in the dictionary. Can you generalize your code, or part of it? If you really want to go above and beyond, try writing your code as though it were a more generalized case.For example, if youââ¬â¢re trying to figure out if a tic-tac-toe board has a winner, you might suggest to your interviewer solving it for the more general NxN case. If you go down this path though, be warnedââ¬âsometimes problems are trickier than they appear. Also, make sure you discuss this with your interviewer so he/she knows what youââ¬â¢re doing. 35 à © 2009 CAREERCUP exclusively for [emailà protected] google. com Games CHAPTER-9 9. 1 Design an algorithm to figure out if someone has won in a game of tic-tac-toe. ______________________________________________________________________pg 135 9. The Game of Master Mind is played as follows: ââ¬â The computer has four slots containing balls that are red (R), yellow (Y) , green (G) or blue (B). For example, the computer might have RGGB (eg, Slot #1 is red, Slots #2 and #3 are green, #4 is blue). ââ¬â You, the user, are trying to guess the solution. You might, for example, guess YRGB. ââ¬â When you guess right color for the right slot, you get a ââ¬Å"hitâ⬠. If you guess a color that exists but is in the wrong slot, you get a ââ¬Å"psuedo-hitâ⬠. For example, the guess YRGB has 2 hits and one pseudo-hit. For each guess, you are told the number of hits and pseudo hits.Write a method that, given a guess and a solution, returns the number of hits and pseudo hits. ______________________________________________________________________pg 137 9. 3 There is an 8Ãâ"8 chess board in which two diagonally opposite corners have been cut off. You are given 31 dominos in which a single domino can cover exactly two squares. Can you use the 31 dominos to cover the entire board? Prove your answer (by providing an example, or showing why itââ¬â ¢s impossible). ______________________________________________________________________pg 138 9. Find a way to arrange 8 queens on a chess board so that none of them share the same row, column or diagonal. ______________________________________________________________________pg 139 9. 5 Othello is played as follows: Each Othello piece is white on one side and black on the other. On your turn, you place a piece on the board so that your color is facing up. You must pick a spot such that your opponentââ¬â¢s pieces are either on the left and the right, or on the top and the bottom. All of your opponentââ¬â¢s pieces on the line between two of yours are then turned over, to become yours. Your goal is to own the most pieces.Design the game Othello. Write a method to check whether someone has won the game. ______________________________________________________________________pg 141 à © 2009 CAREERCUP 36 Java How to Approach: CHAPTER-10 While Java related questions are found throughou t this book, this chapter deals with questions about the language and syntax. You generally will not find many questions like this at the larger software companies (Microsoft, Google, Amazon, etc), which tend to avoid ââ¬Ëtriviaââ¬â¢ based questions, but these questions are very common at many smaller companies. What do you do when you donââ¬â¢t know the answer?If you donââ¬â¢t know the answer to a question about the Java language, try to figure it out by doing the following: (1) Think about what other languages do. (2) Create an example of the scenario. (3) Ask yourself how you would handle the scenario if you were designing the language. Your interviewer will likely be equallyââ¬âor moreââ¬âimpressed if you
Tuesday, October 22, 2019
American schools Essay Example
American schools Essay Example American schools Essay American schools Essay American schools operate on two systems of assessment internal and external. A number of studies on the benefits of these have been carried out which generally indicate that external system when over emphasized can reduce the opportunities to learn while internal system when systematically delivered can provide better learning and improve teaching. Portfolio based systems on the whole provide ownership for the student and support the teacher in teaching students to achieve learning goals and develop interests. The article relates to a study which was carried out in alternative assessment system in Charles Ruff Middle School in Northern California. There were primarily two groups, one was based on an alternative assessment system and was issued with report card grades which were given by the external examination committee of local English teachers, while the second group was with customary assessment where grades were determined by individual classroom teachers. The study used a rigorous methodology including quantitative and qualitative assessments based on the grounded theory method of ethnographic research. Data was analyzed using three mixed model analysis of variance with dependent variables measured repeatedly. The qualitative and quantitative findings were matching. The results have indicated that in reading achievement, the alternative assessment was more favorable while in writing achievement there was no significant difference. The key variation was seen in levels of learning goal orientation in which students of alternative assessment scored higher while no differences were seen on scales in measuring advancement and goal approvals. The impact of portfolio based teaching on reading and motivation was the major aspect which has provided the critical difference of this system of assessment. Since grades were important, caring about grades rather than portfolios was never a problem and students appeared to harmonize both. However the school despite considerable advancement shown in implementation of portfolio system did not utilize it fully due to lack of adequate conviction amongst the teaching staff and resources.
Subscribe to:
Posts (Atom)