Monday, January 31, 2022

Microsoft interview

1. Ask clarifying questions before diving into coding the solution. This is a

common pitfall.

    • While the interviewer won’t try to trick you, they might be intentionally vague. It’s important to know what sort of design the interviewer is looking for, so ask questions.
    • This should typically be the first thing you do before writing any code

2. Pay attention to probing questions as they may be hints that the interviewer wants you to go another direction with your solution/response. This is a common pitfall.

3. Don’t forget to test your code before you say you’re done! Remember, the basic


responsibility is to make sure the feature works.

Core competencies

  • We hire for One Microsoft and focus on certain attributes that make our employees successful in any position they move into later in their career. You will be evaluated on each of the 4 following Core Competencies:

1. Adaptability: Demonstrates curiosity and actively explores options. Responds efficiently to changing demands and circumstances. Functions effectively in ambiguous situations. Maintains a constructive attitude in times of stress.

2. Collaboration: Drives alignment and teamwork within a team, department, or across organizational boundaries. Combines resources and joins efforts to achieve company-wide goals.

3. Customer Focus: Anticipates customer needs, and proactively meets and exceeds customer expectations. Recognizes the issues that customers want to resolve, and creates, or facilitates the creation of, products and services to address customer needs.

4. Drive for Results: Tenaciously pursues positive outcomes by using effective approaches to solve problems. Delivers on commitments and seeks increasingly challenging work. Takes responsibility and holds others accountable for actions, decisions, and goals.

  • Think and mull over 1-3 examples for each competency where you exemplified these attributes. Add context (problem/situation/challenge, approach, result, impact, etc.) to the examples as applicable. Make sure to remind yourself of the context to be able to provide “meaty” answers if needed. This way the experience will be fresh in your mind—you’ll only need to organize your thought process and respond.


Friday, January 28, 2022

236. Lowest Common Ancestor of a Binary Tree

 Jan. 28, 2022

Here is the link. 


C# Data structure talk: List, Stack, Queue, HashMap, HashSet and Tuple

May 27, 2020

It is important for me to train myself to get familar with C# data structure and also think better what to choose in design process. There are more than five solutions I like to share using C# data struture: List, Stack, Queue, Dictionary (HashMap), HashSet, Tuple.

Here are my highlights:

  1. First and most important, it is to learn and get familiar using List, and understand tree traversal, use one path as List variable to solve backtracking issue;
  2. Next it is important to learn how to solve the algorithm using recursive function without any data structure;
  3. Advanced topic is to try ideas using Tuple<TreeNode, int> and experience how efficient it is to design and remove ambiguity in design, follow Single Responsiblity Principle SRP.
  4. Try other options like Stack, HashSet if you have time to practice.

Data structure is the tool to get organized

Let us get started. First one is combination of Queue, Dictionary, HashSet

No 1 combinations: C# Data structure: Queue, Dictionary, HashSet
child-parent map, parent node, BFS (May 11, 2019)

No 1 combinations: C# Data structure: Queue, Dictionary, HashSet
how to build a path from p or q to root (May 11, 2019)





Next is data structure C# List

C# List is enough to solve the problem - topics: backtracking, space optimization

No 2 combinations: C# Data structure: List
how to build a path from root to p (May 23, 2019)

Backtracking learning
Recursive solution with backtracking (May 23, 2019)

Space complexity analysis
learn elegent solution using back tracking and space efficiency, avoid timeout (May 23, 2019)

backtrack to find path from root node to given node p
C# backtrack to find root node to given node p





Next is C# HashSet

No 3 combinations: C# Data structure: HashSet
Find the path H for node p, and find path for node q and also check hashset for path H, June 14, 2019 mock interview case study Clever idea!

June 25, 2019

find one path first and then look up path for second given node q
C# find path from given node p to root first and then find q and lowest common ancestor

find one path first top down and then look up path for second given node q
C# Find top down path for a given node p and then find q's path and look up lowest common ancestor





Next is C# Stack

Stack is perfect to maintain the order in last in first out order.

No 4 combinations: C# Data structure: Stack
Using Stack data structure
Recursive function using Stack return Stack (June 10, 2019)
Recursive function using Stack return bool (June 10, 2019)





Next is C# Tuple

Tuple is so powerful and time-efficient, good at strong type definition to avoid run time errors. Give it a try!

No 4 combinations: C# Data structure: Tuple
Return Tuple<TreeNode, int> or ArrayList? Always strong typing
C# Postorder traversal and count nodes found practice in 2020 Learn from ex-facebook engineer, super performance, April 30, 2020

May 25, 2020
C# Tuple<TreeNode, int> design talk and second practice on May 25 2020
C# Tuple<TreeNode, int> design talk and quick practice in May 25 2020

It is time for me to learn to review my own code. Track my progress and I was so surprised to learn that I need to practice backtracking in 2019, 53 year old.

Extra topic: backtracking, List
Follow up with review
May 26, 2020
C# Find path from root to p practice on May 26, 2020
C# Critic my own code written on May 7, 2019 Write review for my own code after 12 months

hashmapbacktrackinglisthashsetstackqueuetree traversalspace optimizationc# tuplecode review

Matteo Berrettini

 

Matteo Berrettini

From Wikipedia, the free encyclopedia
Jump to navigationJump to search
Matteo Berrettini
Matteo Berrettini, 2021.jpg
Berrettini in 2021
Country (sports) Italy
ResidenceMonte Carlo, Monaco
Born12 April 1996 (age 25)[1]
RomeLazio, Italy
Height1.96 m (6 ft 5 in)
Turned pro2015
PlaysRight-handed (two-handed backhand)
CoachVincenzo Santopadre, Marco Gulisano, Umberto Rianna
Prize moneyUS$ 7,605,702[2]
Singles
Career record118–66 (64.1% in ATP Tour and Grand Slam main draw matches, and in Davis Cup)
Career titles5
Highest rankingNo. 7 (13 September 2021) [3]
Current rankingNo. 7 (13 September 2021)
Grand Slam Singles results
Australian OpenSF (2022)
French OpenQF (2021)
WimbledonF (2021)
US OpenSF (2019)
Other tournaments
Tour FinalsRR (20192021)
Doubles
Career record21–16 (56.8% in ATP Tour and Grand Slam main draw matches, and in Davis Cup)
Career titles2
Highest rankingNo. 105 (22 July 2019)
Current rankingNo. 210 (13 September 2021)[4]
Grand Slam Doubles results
Australian Open1R (2019)
French Open2R (2019)
Wimbledon1R (2018)
US Open2R (2018)
Last updated on: 13 September 2021.

Matteo Berrettini (Italian pronunciation: [matˈtɛːo berretˈtiːni];[5][6] born 12 April 1996) is an Italian professional tennis player.[7] He has a career high ATP singles ranking of world No. 7, achieved on 13 September 2021, and a career high ATP doubles ranking of world No. 105, achieved on 22 July 2019.

He won his first ATP 500 level event at the 2021 Queen's Club Championships. He also reached the final of the 2021 Wimbledon Championships and the semifinals of the 2019 US Open and 2022 Australian Open.

Danielle Collins

 

Danielle Collins

From Wikipedia, the free encyclopedia
Jump to navigationJump to search
Danielle Collins
Collins RG19 (14) (48199420917).jpg
Collins at the 2019 French Open
Full nameDanielle Rose Collins
Country (sports) United States
BornDecember 13, 1993 (age 28)
St. Petersburg, Florida, U.S.
Height5 ft 10 in (1.78 m)
Turned pro2016[1]
PlaysRight-handed (two-handed backhand)
CollegeUniversity of Virginia
Prize moneyUS$ 3,750,895[2]
Singles
Career record185–109 (62.9%)
Career titles2
Highest rankingNo. 30 (17 January, 2022)
Current rankingNo. 30 (17 January 2022)[3]
Grand Slam Singles results
Australian OpenF (2022)
French OpenQF (2020)
Wimbledon3R (2019)
US Open3R (2021)
Doubles
Career record13–17 (43.3%)
Career titles0
Highest rankingNo. 86 (2 March 2020)
Current rankingNo. 493 (17 January 2022)
Grand Slam Doubles results
Australian Open3R (2022)
French Open2R (2019)
WimbledonQF (2019)
US Open3R (2019)
Team competitions
BJK CupSF (2021)
Last updated on: 17 January 2022.

Danielle Rose Collins (born December 13, 1993) is an American professional tennis player. She reached a career-high ranking of world No. 30 in singles on 17 January 2022, and No. 86 in doubles on 2 March 2020. Collins has won two WTA Tour singles titles, at the 2021 Palermo Open and the 2021 Silicon Valley Classic. She reached her first major singles final at the 2022 Australian Open.

Collins played collegiate tennis at the University of Virginia and won the NCAA singles title twice, 2014 and 2016, during her sophomore and senior years. She finished her career at Virginia in 2016 as the top-ranked collegiate player. Having first established herself on the WTA Tour when she reached the semifinals of the 2018 Miami Open as a qualifier, her breakthrough came at the 2019 Australian Open, where she reached the semifinals, defeating world No. 2 Angelique Kerber en route. Collins was also a quarterfinalist at the 2020 French Open in singles and the 2019 Wimbledon Championships in doubles. She has won one WTA 125 and four ITF singles titles.

Iga Świątek

 

Iga Świątek

From Wikipedia, the free encyclopedia
Jump to navigationJump to search
Iga Świątek
Swiatek RG19 (1) (48199020336).jpg
Świątek at the 2019 French Open
Country (sports) Poland
ResidenceRaszyn, Poland
Born31 May 2001 (age 20)
Warsaw, Poland
Height1.76 m (5 ft 9 in)
PlaysRight-handed (two-handed backhand)
CoachTomasz Wiktorowski
Prize moneyUS$ 4,898,553
Singles
Career record154–48 (76.2%)
Career titles3
Highest rankingNo. 4 (27 September 2021)
Current rankingNo. 8 (10 January 2022)
Grand Slam Singles results
Australian OpenSF (2022)
French OpenW (2020)
Wimbledon4R (2021)
US Open4R (2021)
Other tournaments
Tour FinalsRR (2021)
Olympic Games2R (2021)
Doubles
Career record27–14 (65.9%)
Career titles0
Highest rankingNo. 41 (18 October 2021)
Current rankingNo. 41 (18 October 2021)
Grand Slam Doubles results
French OpenF (2021)
US Open2R (2019)
Mixed doubles
Career record5–4 (55.6%)
Career titles0
Grand Slam Mixed Doubles results
Australian OpenQF (2020)
Other mixed doubles tournaments
Olympic GamesQF (2020)
Team competitions
BJK CupPO (2020)
hide
Medal record
Women's tennis
Representing  Mixed-NOCs (MIX)
Summer Youth Olympics
Gold medal – first place2018 Buenos AiresDoubles
Last updated on: 10 January 2022.

Iga Natalia Świątek (Polish pronunciation: [ˈiɡa ˈɕfʲɔntɛk];[1] born 31 May 2001) is a Polish professional tennis player. She is the youngest player in the top ten of the Women's Tennis Association (WTA) rankings, and has a career-high ranking of No. 4 in the world. Świątek was the champion at the 2020 French Open and is the first Polish player to win a Grand Slam singles title. With her French Open title, she also became the youngest singles champion at the tournament since Rafael Nadal in 2005, and the youngest women's singles champion at a major since Maria Sharapova at Wimbledon 2004.

Świątek's father Tomasz was an Olympic rower. As a junior, Świątek was the 2018 French Open girls' doubles champion alongside Caty McNally, and the 2018 Wimbledon girls' singles champion. She also led Poland to the Junior Fed Cup crown in 2016 and won a doubles gold medal for Poland at the 2018 Summer Youth Olympics with Slovenian Kaja Juvan. Świątek began playing regularly on the WTA Tour in 2019, the same year she made her tour debut. She entered the top 50 at 18 years old after her first appearance in a WTA final and a fourth-round appearance at the French Open, where she was defeated by Simona Halep. During her dominant French Open title run in 2020, Świątek defeated Halep in the same round and did not drop a set or lose more than five games in any singles match. She entered the top ten of the WTA rankings for the first time on 17 May 2021, after winning the Italian Open, defeating former world No. 1 Karolína Plíšková in the final without conceding a game.

Świątek has an all-court style of play. She won the WTA Fan Favorite Shot of the Year in 2019 with a drop shot from the baseline, and was voted WTA Fan Favorite Singles Player of the Year in 2020.