From 29dca3761215946ca3558a7371d6b408c478cf14 Mon Sep 17 00:00:00 2001 From: Vahagn Khachatryan Date: Fri, 26 Mar 2021 19:35:59 +0000 Subject: [PATCH] interview questions facebook/google --- puzzles/interviews/BehaviralInterview.md | 265 ++++++++++++++++++ .../Facebook Interview Questions.md | 34 +++ .../interviews/Google Interview Questions.md | 125 +++++++++ puzzles/interviews/SystemDesign.md | 45 +++ 4 files changed, 469 insertions(+) create mode 100644 puzzles/interviews/BehaviralInterview.md create mode 100644 puzzles/interviews/Facebook Interview Questions.md create mode 100644 puzzles/interviews/Google Interview Questions.md create mode 100644 puzzles/interviews/SystemDesign.md diff --git a/puzzles/interviews/BehaviralInterview.md b/puzzles/interviews/BehaviralInterview.md new file mode 100644 index 0000000..9ee4f1a --- /dev/null +++ b/puzzles/interviews/BehaviralInterview.md @@ -0,0 +1,265 @@ +## Areas +- Decision making and problem-solving +- Leadership +- Motivation and Values +- Conflict/Disagreement/Communication +- Mistakes/Failures +- Work Ethic Questions +- Teamwork/Collaboration +- Interpersonal skills +- Ability to Adapt +- Planning and organization +- Time Management Skills +- Professional feedback + + + + +## Examples + +- mifid II + - #Leadership, #ManagingUp, #ProblemSolving, #SelfStarter, + #DecisionMaking + +- oxe tasks + - #Mentoring, #DecisionMakeing, #SelfStarter, #Motivation + +- proposal to migrate tcs to linux + - #Collaboration, #Teamwork + +- failed synopsys project + - #Failure + - we cannot achieve success separately + +- Metrics (how to measure erichment time) +- refroot +- refactoring blo - dpkg blo + - #Conflict, #Disagreement + - try to be constructive + + +- Vika's feedback + - #ProfessionalFeedback +- I do not articulate architectual changes early on. +- Visibility + +- I was against cashing in liquidity offloading service + + + + Where do you see yourself in 2-3 years? (career growth) + + +- **Why Facebook** + + - Philosophy ("break things move fast") matches. + - *Not sure about move fast* + - *I like open box thinking, break boundaries if they don't work.* + - Successful. + - *I can contribute to company, and the company can contribute to me.* + + +## Decision making and problem-solving +- Describe a situation in which you used good judgment and logic to solve a problem. +- Give me an example of a time when you had to be quick in coming to a decision. +- Can you tell me about the last time you had to act and there was no formal procedure on how to do so? +- How do you approach a task that you’ve never done before? +- Can you tell me about a time when you had to deal with a customer that made unreasonable or stretched demands and how you created a win-win situation? +- We’ve all been asked on occasion to perform tasks to accomplish a goal where the instructions are really ambiguous. Can you tell me about a time that this happened to you and what you did to achieve the goal? +- Talk about a time where you had to make an important decision quickly. What did you decide? What were the results? + +- Tell me about a time you made a difficult decision. +- Tell me about a problem you solved in a creative way. +- Tell me about a time when you handled a challenging situation. +- Tell me about a time when you made a mistake. What did you do to correct it? +- Tell me about a goal you set and reached and how you achieved it. +- Talk about a difficult problem you’ve had to solve. How did you solve it? +- Talk about a time when you had to adapt to big changes at work. +- Tell me about a time when you had to be creative to solve a problem. + +- **Difficult problem to solve** + - AKA: Tell me about a difficult work challenge you’ve had. + - *MIFID II project* + + +## Leadership + +- Tell me about a time when you stepped up into a leadership position. +- Talk about a time when you’ve had to manage up. + - *How I became Synopsys manager.* + +- Tell me about a time when you felt like a good leader. +- Can you tell us about a time you took initiative on a project? + - *Mifid II project.* + +- Tell me about a time you had to stand up for your beliefs. +- Tell me about a time you disagreed with a supervisor. +- Tell me about a time when you had to say “no.” + - *Refroot.* + +- Give me an example of a time when you persuaded someone. How’d you do it and why? +- Describe the most challenging group from which you’ve had to gain cooperation. +- Have you ever had trouble getting others to agree with your ideas? - Tell me about a time when you collaborated with others who were different than you. +- Have you ever had to convince your team to do a job they were reluctant to do? + +- How do you manage the outcomes of your team members? +- Share an example of how you were able to motivate a coworker, your peers or your team. + - gggg + + +- Tell me about a time when you disagreed with your manager’s leadership style or team culture. + - Harries micromanagement. Did nothing other than accepting it. + - Ben's micromanagement. Digging into reasons why he wants to do this or that. Understand the problem, and propose solution for the problem. + +- Who have you mentored or coached to achieve success? + - Hamlet - Manager in Amazon + - Adrian - Working on oxe + +- Describe a time when you led by example. + +- Can you give me an example of how you’ve contributed to the culture of previous teams, companies or groups? +- What have you done when colleagues have been stressed out by a project? + + + +## Motivation and Values + +- Can you give me an example of a time when you felt dissatisfied with your work? +- Tell me about a time when you went above and beyond the call of duty. + +- Give me an example of a situation in which you positively influenced the actions of others. +- Give an example of a goal you reached, and tell me how you achieved it. + +- Give me an example of how you set goals. +- Tell me about a time you felt you went above and beyond. +- Tell me about a time when you had to fight for an idea at work. +- Tell me about your proudest moment in your professional career why it was meaningful to you. + +- What Do You Do To Stay Motivated? +``` +As long as there are problems to solve I am motivated usually. +Trying to find better ways to improve things. +Looking for new projects. +``` + + +## Conflict/Disagreement/Communication + +- Describe a situation in which you were able to communicate with another individual who did not personally like you (or vice versa). +- Describe a time you had to use written communication to convey an important argument or idea. +- Have you ever unintentionally offended or upset somebody? Can you describe the details? + +- Talk about a time when you’ve had to sell an idea to your colleagues. +- Give me an example of a time you made a decision that was unpopular and explain how you handled implementing it. + + + +- Give me an example of a time when you had to respond to an angry customer. + + +- Tell me about a time when you had a difference of opinion with a teammate. +- Tell me about a time when you disagreed with your supervisor. How did you handle it? + - ff + + +## Mistakes/Failures + +- Tell me about a goal you failed to achieve. +- Tell me about a major setback you’ve had. How did you deal with it? +- Tell me about a decision you regret making. +- What is your biggest professional mistake? How did you handle it? +- Tell me about a time you wish you’d handled something differently. +- Tell me about a time you failed. + + - For me, failure is about not living up to others’ expectations, but also not meeting my own expectations for myself. In my marketing class last year, we were assigned a group project, and each person had his or her individual assignment. I had a ton of papers due, and I got behind—and I didn’t want to burden my team by giving them more work. I met the deadline, but it wasn’t my best work. If I had communicated that I was behind, my team could have worked with me to ensure everything was done well. We did fine on the project, but I knew I could have done better on my end. Now, I always communicate from day one on any project, scheduling regular check-ins and providing frequent updates. + +``` +Grigor who was under the cap. +Management experience. +``` + +## Work Ethic Questions + + +- What are you most proud of? Why? + - I previously worked as a project assistant at a leadership development firm, and the project manager had to drop out of a big engagement one week beforehand due to a family emergency. Because I’d been supporting the team closely, they asked me to take over that role and manage the engagement as the key organizer and client liaison. I flew to Texas for the delivery, and I managed the engagement from start to finish. The lead consultant was so happy that she asked me to come back for the remaining sessions. This was outside of the original scope of my job, and I was able to support the client with a successful engagement. Afterwards, my supervisor put me on track for a promotion to project manager. + +- Tell me about a time when you went above and beyond to get the job done. +- Share a time when you had to juggle multiple important projects at the same time. How did you deal with that? +- Have you ever been in a business situation that was ethically questionable? What did you do? + + +## Teamwork/Collaboration + +- Talk about a time when you had to work closely with someone whose personality was very different from yours. +- Give me an example of a time you faced a conflict while working on a team. How did you handle that? +- Describe a time when you struggled to build a relationship with someone important. How did you eventually overcome that? +- We all make mistakes we wish we could take back. Tell me about a time you wish you’d handled a situation differently with a colleague. +- Tell me about a time you needed to get information from someone who wasn’t very responsive. What did you do? + + +- What’s the most successful team project you’ve worked on? +- Tell me about a time when you had to work on a team and felt disappointed in the outcome. + - I took an anthropology class last year, which I absolutely loved. For the final project, we broke into teams of three, with each team given a different area to research and present on. My team decided to divvy up each aspect of the project. I was responsible for writing the text for the poster, another teammate was responsible for making the images and graphs, and another for writing our speech. + - I didn’t want to micromanage and was focused on my own work, so I just forged ahead. I checked in with my teammates two days before the presentation, and one had done absolutely nothing. I was furious. However, I took a deep breath, and the three of us met up. We worked all night long to make those graphs and get the poster designed. In the end, it wasn’t great, but it was something. It taught me that on a team, everyone needs to work together to ensure a great outcome. Now, I always schedule regular check-ins with team members, making sure that we’re on the same page and moving forward in a timely manner. +- Share a time when you had to work with a teammate who wasn’t pulling their weight on a project. What happened? + +- **Collaboration Experience** + + +## Interpersonal skills + +- Give me examples of what you’ve done in the past to nurture teamwork. +- Give an example of an unpopular decision you’ve made, what the result was, and how you managed it. +- What was your relationship with the best boss you ever had? +- Can you tell me about a time that you let someone down? How did you handle it? + +- Tell me about a time when you were in conflict with a peer and how the situation was resolved. +- Talk about a time when a co-worker was not doing their share on a project. How did you handle it? +- How have you dealt with an angry or upset customer? +- Tell me about a time your co-workers had a conflict. How did you handle it? +- How Do You Build Relationships? + +## Ability to Adapt + +- Tell me about a time you were under a lot of pressure. What was going on, and how did you get through it? +- Describe a time when your team or company was undergoing some change. How did that impact you, and how did you adapt? +- Tell me about the first job you’ve ever had. What did you do to learn the ropes? +- Give me an example of a time when you had to think on your feet in order to delicately extricate yourself from a difficult or awkward situation. +- Tell me about a time you failed. How did you deal with the situation? + +- Tell me about how you work under pressure. +- Tell me about a time you had to learn quickly. +- Have you ever had a project that had to change drastically while it was in progress? Why? How did you do it? +- Can you share about a time you had to be flexible or adaptable? + + +## Planning and organization + +- When scheduling your time, what method do you use to decide which items are priorities? +- Describe how you’ve handled a sudden interruption to your schedule. +- Give me an example of a time you had to prioritize certain tasks or projects over others. +- How have you prioritized being assigned multiple projects? +- Tell me about the last time your workday ended before you were able to get everything done. +- Have you ever had a deadline you were not able to meet? What happened? What did you do? + + +## Time Management Skills + +- Tell me about a time you had to be very strategic in order to meet all your top priorities. +- Describe a long-term project that you managed. How did you keep everything moving along in a timely manner? +- Sometimes it’s just not possible to get everything on your to-do list done. Tell me about a time your responsibilities got a little overwhelming. What did you do? +- Tell me about a time you set a goal for yourself. How did you go about ensuring that you would meet your objective? +- Give me an example of a time you managed numerous responsibilities. How did you handle that? + + +## Professional feedback + +- What’s been the toughest criticism you received so far in your career? What did you do with it? +- Can you describe the details of a time you were unfairly criticized? +- When was the last time you got constructive feedback? What was it? What did you do with it? + +- Tell me about a stressful situation at work and how you handled it. + +- Can you give an example of a valuable piece of feedback that you have received? +- When did you receive constructive/negative/difficult feedback? How did you act upon this? diff --git a/puzzles/interviews/Facebook Interview Questions.md b/puzzles/interviews/Facebook Interview Questions.md new file mode 100644 index 0000000..0dcae74 --- /dev/null +++ b/puzzles/interviews/Facebook Interview Questions.md @@ -0,0 +1,34 @@ +# Facebook Interview Questions + +## Coding Interview 1 + +### Problem 1 +Given alphabet [c b a] +sort the array in alphabetical order +[[a b b][a b c][c][b]] -> [[c][b][a b c][a b b]] + + +### Problem 2 +Given a tree, calculate sum of all path sums + +``` + 4 + / \ + 9 0 + / \ + 5 1 +``` +495+491+40 + +This one I remember vaguely. + +## Coding Interview 2 + +### Problem 1 +How many unbalance parentheses are the in a given string. + +e.g. )(())(() -> 2 + +### Problem 2 + +Given m sorted arrays, return k-th element from joined sorted array. diff --git a/puzzles/interviews/Google Interview Questions.md b/puzzles/interviews/Google Interview Questions.md new file mode 100644 index 0000000..5eff256 --- /dev/null +++ b/puzzles/interviews/Google Interview Questions.md @@ -0,0 +1,125 @@ +# Google Interview + +## Coding Interview 1 + +[['a1', 'a2', 'a1b'], ['b1', 'b2'], ['c1', 'c2']] + +### problem 1 + +print all combinations, like +``` +a1b1c1 +a1b1c2 +a1b2c1 +a1b2c2 +a2b1c1 +a2b1c2 +a2b2c1 +a2b2c2 +a1bb1c1 +a1bb1c2 +a1bb2c1 +a1bb2c2 +``` +### problem 2 + +given a string 'a2b2c1', is it one of combinations from above. + +solved by dynamic programming. + + + +## Coding Interview 2 + +### Problem 1 +given a tree (not a binary one) + +``` + o + /|\ + / | \ + o o o + / \ / \ + o o o o + | | + o o +``` +Find nodes with similar structure. Like all life nodes are similar. + +My solution was to come up with a signature for each node, like +sig node = ,(),(),() ...; +then create a map -> set of similar nodes. + +if we know that nodes are divers, then we could actually create a hash. + +### Problem 2 +Represent a number in (-2) base, like a*(-2)^4+b*(-2)^3+c*(-2)^2+d*(-2)^1+e*(-2)^0 + +e.g. 1 -2 4 -8 16 -32 + + 0 = 0000 + 1 = 0001 +-1 = 0011 + 2 = 0110 +-2 = 0010 + 3 = 0111 +-3 = 1111 +.... + + +## System Design 1 + +800 Billions query log entries, 8 machines +top million query by frequency + +unique queries? take samples to estimate the unique query, shrinks by 1 factor of ten + +distribute queries evenly by machine + +go over the logs in each machine +and create 10B key value pairs (assume 10x reduction) + +For all machines = 4T +average query length = 50B + +Data per machine = 500GB of data (This produced from 5T) + (use hash map, split data in chunks ~1T or 0.5T + Produce about 50GB for each chunks, do this 5-10 time for all data) + +reading from disk is going to be 20h at 200MB/s -> but we have 6 disks -> 3.5h to read everything + +Another way to do this is to sort each chunk (by query), merge those. Produce all 500GB of data. + +idea: merge the data between machines in pairs (1.5h to send to wire) + +Somehow sort 500GB data on each machine and produce 1 M query per machine. +(50Meg Data) +About 10x50GB chunks. Create another hash count->set of queries.) + +Do chunks have overlapping queries? yes they wiil + + +Send all data to one machine (400Meg Data) +Apply some sort of heap sort and merge presorted arrays. + + +Correctness of data + +how big are the machines? +32 cores of 3 GHz +120 G of RAM +6x2T each (spinning disk) +10Gbps network connection + +you can store 5T in each machine + +how to do the key value pair? +have an hash map + +Run Time + +2M querie 100MB data per machine, (1GB data transfered for all) May be another 1GB for the second phase. + +~4-5h to process this data. + + diff --git a/puzzles/interviews/SystemDesign.md b/puzzles/interviews/SystemDesign.md new file mode 100644 index 0000000..3673916 --- /dev/null +++ b/puzzles/interviews/SystemDesign.md @@ -0,0 +1,45 @@ + +Request Per Second + +Data Store Characteristics + - size / growth rate + - latency / bandwidth + - availability / consistency + +Cache + - size + - expiration + +High Level Design + - failover + + + +Top Facebook System Design Interview Questions +1. Design Facebook News Feed +2. Design Facebook Status Search +3. Design Live Commenting +4. Design Facebook Messenger or WhatsApp +5. Design Instagram + + +1. Design Proximity Server +2. Design Typeahead Suggestions +3. Design Top N Songs +4. Design Privacy Settings at Facebook +5. Design Web Crawler + +Learn more about the design goals, scale estimations, high-level design overview, and detailed architecture diagram of these problems in this video - youtube.com/watch?v=Hq8pZ8G2Lm8 + +Part 1: youtube.com/watch?v=hykjbT5Z0oE + + + + +## coding + +- find target in chess board with given start position of knight + +- Given an integer array and an integer K, find the number of sub arrays in which all elements are less than K. + - Follow up + - Given an integer array and an integer K, find the number of non overlapping unordered pairs of sub arrays in which all elements are less than K.