Saturday, December 24, 2016

Stackexchange.com code review - Find all stepping numbers in range n to m

Dec. 24, 2016

Problem for code review:

http://codereview.stackexchange.com/questions/149096/given-n-and-m-find-all-stepping-numbers-in-range-n-to-m/149456#149456

Detail:


I really like the code review conducted by @twohundredping, the Advanced topic with code is my most favorite one (Given N and M find all stepping numbers in range N to M). I put together C# code and also test the code using input: start = 10, end = 20.
I also learned the coding standards @twohundredping as well. If it is ok, I like to post as an answer, technically, I like to post it as comment, but less than 50 reputation, I could not do it.
Please read my code using C#, the solution is an excellent workout for algorithm problem solving. The code link: https://gist.github.com/jianminchen/28b656f16aa58a00687e823eb0aaf212

Actionable Items:
Understand why a post is deleted. 









Friday, December 23, 2016

How to be best people for the job?

Dec. 23, 2016

Introduction

It is the second time to read the same article in 2016. So, Julia likes to take notes this time.

Share her own personal story as well. One time, Julia was in the important meeting, and then, she noticed that some one was typing on the laptop very loud, and then, she was kind of nervous. She got distracted, and lost focus on the question. Her first thought was that people are getting trained to take notes. It is like on the court.

Haha, it is a game tactics, and test your ability to stay focus, despite distractions.

Write down some notes, and do some research later.

Here is the article call hiring best people ...

Workout


Always write down the great ideas, and then, think about more later. 

1. Begin phone screens 15 minutes early, 15 minutes late, or not at all. 
Why? 
To find people who are always ready for the job. 

2. Make the interview schedule as confusing and unpredictable as possible. 
Why? 
To find people who don't need instructions. 

3. Make sure something goes wrong during the presentation Why? To see how the candidate adjusts to less-than-ideal circumstances

4. During the interview, make a ton of incorrect assumptions
Why?
To weed out candidates who are easily annoyed. 

Is he a jerk about it or does he stay cool? This is how tech companies find out what a candidate would be like to work with when the shit inevitably hits the fan. 

5. Ask the candidate to solve your own, specific problems
Just pretend we already tried that and it didn't work
Why? 
Because you really need help with this problem

6. Have the interview frequently move between different rooms
Why?
To find people who are still excited, even when they're uncomfortable

7. Ask the same questions over and over again
Now that we've talked about your experience, let's talk about  your experience. 

Why? 
To test consistency

In the tech world, predictability is a good thing. This a great tool for testing the candidate's consistency. Candidates should only be wildly inconsistent with their answers when interviewing for senior roles. 

8. Conduct dual interviews with a good cop / bad cop vibe
Why? 
To find people who can multi-task under pressure

Put the candidate in the middle of a conference room with interviewers at both ends of the table. Is the candidate able to simultaneously direct her attention to both interviewers while sufficiently answering each question at the same time? Or is she clearly exhausted and wondering why she even agreed to this interview? This is a great indicator of how the candidate will perform during a crunch. 

9. Ask a question, then start typing very loudly

Why?
 To find people who remain focused despite distractions

Ask the candidate a question. Then, as soon as he starts to answer, start typing loudly. Apologize and say you're "listening, just taking notes." You could be taking notes, or you could be writing an email to your estranged father, doesn't matter. See if the candidate can remain focused on the question or if he gets lost. This will help you find candidates who don't let tiny distractions get in the way of finishing the job. 

10. Three months later, call and offer the candidate a job she didn't apply for
Why? 
To find people who are determined


This is a great way to weed out people who obviously didn't really want the job in the first place. Does the candidate fight for the job he wanted? Does he take the offer because he thinks it's the best he can get? Or does he turn it down because he already found another job months ago? This tactic is a good way to suss that out. 

Feb. 27, 2017
Additional reading: here's Google's secret to hire the best people. 

Thursday, December 22, 2016

HackerRank - weekcode 27 - Tailor Shop

Dec. 22, 2016

Problem statement:

https://www.hackerrank.com/contests/w27/challenges/tailor-shop

Easy algorithm, need to work on timeout issue carefully.

C# solution:  score 15.8   maximum score: 20

https://gist.github.com/jianminchen/3a412f04331e23c0d57b1f28b3147bf1

Comparison

Comparison with the top 1 player on Dec. 22, 2016:

https://www.hackerrank.com/contests/w27/compare/jianminchen_fl/rickytheta

https://www.hackerrank.com/contests/w27/compare/jianminchen_fl/Rima

https://www.hackerrank.com/contests/w27/compare/jianminchen_fl/evanlimanto

https://www.hackerrank.com/contests/w27/compare/jianminchen_fl/pablo_aguilar

Actionable Items:

Please write down the analysis. Give some warmup talk on this algorithm.




Time complexity - code review

Dec. 22, 2016

Just quickly review stackexchange.com code review  - :

1. Sort by votes: 48 result:
keyword for search:
time complexity analysis

http://codereview.stackexchange.com/search?q=user:40480+[time-limit-exceeded]

http://codereview.stackexchange.com/search?q=user:11728+[time-limit-exceeded]

http://codereview.stackexchange.com/search?tab=votes&q=time%20complexity%20analysis

2. keyword for search:
space trade for time
24 results:
http://codereview.stackexchange.com/search?tab=votes&q=space%20trade%20for%20time

3. keyword for search:
brute force
Sorted by votes, 456 results:
http://codereview.stackexchange.com/search?tab=votes&q=brute%20force%20

3. keyword for search:

http://codereview.stackexchange.com/questions/tagged/cyclomatic-complexity

http://codereview.stackexchange.com/users/54718/caridorc?tab=tags


HackerRank - week of code 27

Dec. 12, 2016

Work on HackerRank week of code contest first time. Here is the contest information:

https://www.hackerrank.com/contests/w27/challenges

Continue to work on Day 4 -

Zero-Move Nim

Medium level algorithm, maximum score 50, Julia made it 12.50

So, she likes to do some research and see if she can understand the algorithm, and write a short algorithm. Time: 8:50pm, 3 more hours before the closing time.

Study the lecture notes first:

http://www.math.ucla.edu/~tom/Game_Theory/comb.pdf
http://codeforces.com/blog/entry/20357


Two submissions:
1. One uses recursive solution.


2. One used Nim knowledge.


Monday, December 19, 2016

Stackexchange.com - Let JavaScript experts come to you

Dec. 19, 2016

Introduction

If you work hard and share your JavaScript knowledge, the expert will come to help you and then give out answer to the same question, so you learn from the other how to do an excellent job. 

Julia chose to review radix sorting algorithm, answer one of code review in JavaScript. She edited her answer over 10 times.  She spent 2 hours the first day, and then, she added more hours, reviewed the structure of JavaScript, so she added "revealing module pattern" code, in order to encapsulate better using an object. Suddenly, she found out that some one wrote a very good answer 10 hours ago.

What a surprise! 

Read more about this talent - My JavaScript teacher:
http://codereview.stackexchange.com/search?q=user:120556+[javascript]

Favorite answer:
http://codereview.stackexchange.com/questions/144803/implementing-radixsort-using-javascript/150288#150288

Julia found another JavaScript teacher: 
http://codereview.stackexchange.com/search?q=user:11919+[javascript]

Workout plan


Highlights of reviewed compared to Julia's

http://codereview.stackexchange.com/a/150288/123986

1. The radix sort is more time-efficiency - optimise with saved sorted items first, only apply radix sort iteration to unsorted numbers.

2. JavaScript - more knowledge, more advice
3. Excellent code in JavaScript

Julia got her first hat on stackexchange.com. She was too excited!

Searching and reading......
http://codereview.stackexchange.com/users/489/jerry-coffin?tab=tags

http://codereview.stackexchange.com/users/18427/malachi?tab=tags

http://codereview.stackexchange.com/users/53773/ismael-miguel?tab=tags&sort=votes&page=1

http://codereview.stackexchange.com/users/42401/peilonrayz

http://codereview.stackexchange.com/users/34073/hosch250?tab=tags

Sunday, December 18, 2016

StackExchange.com - How to find a mentor? (II)

Dec. 18, 2016

Introduction
Julia did get first up-vote from stackexchange.com yesterday through her answer to the question, that is very important one, and also her work was quickly proved in less than 1 hour to be an answer by the moderator janos.

She wrote down in the comment to document the joy: Unbelievable! I got my first teacher badge and also privilege to comment anywhere since I just reached 50 reputation. So excited. Actually, the code is written by ICPC coach, and the author link:   linkedin.com/in/derekhh 

It takes a lot of time for Julia to know how to find stackexchange.com code review, she tried so many things and she learned in 2016, but she stopped. Pramp.com is such a great tool to connect to other peers, but Julia decided to quit after 8 times experience. After that, she tried to facebook code lab. She enjoyed the experience but she still felt that her time is limited, and she liked to work on something better. She kept searching...

A lonely journey to search the ways to improve, and the stackexchange.com makes it a little challenge for Julia. Julia started to learn how it works.

But she also started to ask help to improve her coding practice mainly on HackerRank, she get a lot of quality work from highly-reputation people from stackexchange, she felt that if people saw her potential as a good player, people will welcome her with more quick and efficiently response.

http://codereview.stackexchange.com/users/12390/janos

http://www.janosgyerik.com/


https://www.codementor.io/janosgyerik

http://www.janosgyerik.com/apps/

Workout plan

program challenge: 120
http://codereview.stackexchange.com/search?q=user:12390+[programming-challenge]

JavaScript: 161
http://codereview.stackexchange.com/search?q=user:12390+[javascript]

string:
http://codereview.stackexchange.com/search?tab=votes&q=user%3a12390%20%5bstrings%5d

http://codereview.stackexchange.com/users/9452/josay?tab=tags

http://codereview.stackexchange.com/search?q=user:9452+[programming-challenge]



StackExchange.com study - Great writer

Dec. 18, 2016

Introduction:

Julia chose to study the answers provided by the profile
http://codereview.stackexchange.com/users/40480/vnp?tab=profile

She likes the profile:
An ultimate optimizer is math.
Thou shalt not bruteforce.
When in doubt, sort.

It makes some sense: 
Let us repeat once more time:

An ultimate optimizer is math.
Thou shalt not bruteforce.
When in doubt, sort.

http://codereview.stackexchange.com/search?q=user:40480+[time-limit-exceeded]


Program challenge:  71 challenges
http://codereview.stackexchange.com/search?q=user:40480+[programming-challenge]


Workout plan:


Enjoy the reading, about time complexity:
http://codereview.stackexchange.com/questions/123176/google-code-jam-store-credit-java-solution/123250#123250


Julia's object-oriented design mentor - stackchange.com

Dec. 18, 2016

Introduction
Julia chooses to focus on algorithm and data structure workout daily, but she also likes to
develop object-oriented, system design skills through daily workout. Recently, she posted
a question about Spiral Message, she stumbled on the easy algorithm in HackerRank
NCR codesprint, so she decided to practice until she cannot get it wrong. And, some one
came out to give out great design of the problem.

Julia found her mentor to work on object-oriented design, maybe, system design, or more.

t3chb0t (Top 0.17% this quarter)

http://codereview.stackexchange.com/users/59161/t3chb0t

http://codereview.stackexchange.com/users/59161/t3chb0t?tab=tags

Comparative review:
http://codereview.stackexchange.com/search?q=user:59161+[comparative-review]

Interview questions:
http://codereview.stackexchange.com/search?q=user:59161+[interview-questions]


Workout plan

Julia's favorite post about SQL injection attack:
http://codereview.stackexchange.com/questions/148347/listliststring-vs-datatable/148379#148379


Julia's C, C# mentor on stackexchange.com - How to find a mentor?

Dec. 18, 2016

Introduction
Julia got some help on her question on code review section, minimum cost, JS1 (Top 0.5%) helped Julia to find the analog in C# GetViewBetween API: C++ set, Java TreeSet floor api. 

This is real life story, although the mentor is staying in anonymous, and then, Julia still likes to read more about the user's contribution:

Program Challenge: 58
http://codereview.stackexchange.com/search?q=user:58193+[programming-challenge]

C++:  85 results
http://codereview.stackexchange.com/search?q=user:58193+[c%2b%2b]

Performance: 101 results
http://codereview.stackexchange.com/search?q=user:58193+[performance]

Java: 154 results

http://codereview.stackexchange.com/search?q=user:58193+[java]

C: 230 results
http://codereview.stackexchange.com/search?q=user:58193+[c]

Find things to read:
Interview, interview-questions, comparative-review, recursion, time-limit-exceeded, sorting, performance, community-challenge.

http://codereview.stackexchange.com/users/58193/js1?tab=tags

Workout plan:

Plan to spend 3 hours to read those posts. Learn a few things and write down notes to share here.

http://codereview.stackexchange.com/questions/36915/poker-hand-evaluation-finding-a-straight/90888#90888

Community-Challenge:
http://codereview.stackexchange.com/questions/36915/poker-hand-evaluation-finding-a-straight/90888#90888

http://codereview.stackexchange.com/questions/88525/permutation-and-combination-calculator/88537#88537

Leander Paes - tennis legendary

Dec. 18, 2016

Leander Paes visits the Live @ Wimbledon studio

https://www.youtube.com/watch?v=EzIeDoqvkhU

Julia observed Leander practice in China open 2016 in Beijing, now she spent over 20 minutes how he thought and her analysis. He is smart and very good teaching about tennis. Leander had his father in his team to accompany him, his dad was also Olympic champion. I saw the dad on the court as well. 

Julia had a good time to enjoy the video. 

Longevity of the career, 6 time Olympics player. Play over 24 years. 
https://www.youtube.com/watch?v=LI90SHIUw5o

Walk the talk with Leander Paes (Aired: 2003)
https://www.youtube.com/watch?v=3REv_AOAwOk



Stackoverflow - study and research (II)

Dec. 18, 2016

Watch the video:
Triangulation 277: Joel Spolsky
https://www.youtube.com/watch?v=Yfi2vWanXS0

Take some notes for further research, keyword, or ideas.

Thursday, December 15, 2016

Radix Sort - Code Review

Dec. 15, 2016

Introduction


Review the radix sort - in C#, a blog written in May, 2016.

Since last workout Julia took 4 hours to understand the algorithm, Julia likes to do warmup in short future; design the algorithm better for easy to understand, and then, post the algorithm on stackexchange.com code review.

Will come back very soon.

Come back on Dec. 16:

Julia came cross one question related to radix sort, and she decided to make learning more meaningful, planned to answer the question.

Code review - first teacher badge


Julia made it happen to choose a most popular post view 10,000 views, she got one up-vote by answering the question. 

After she got first teacher badge on stackexchange.com, and she tries to get second approval for answering the "radix sort" one in JavaScript.  

Julia used to be a teaching assistant in Florida Atlantic University when she worked on computer science Ph.D. program. 

Radix sort in Javascript


To answer the current question, Julia took close to 2 hours to work on the code. She learned a few things. 

Time spent: 3+ hours

Actionable Items:


No response on code review, so Julia will continue to study the radix sort, and continue to improve the answer until she gets one up-vote. 


Read  more radix sort on code review. 

Favorite ones:
1. Radix sort question in C

2. Radix sort

3. Radix sort in C#

4. Read more about this talent - My JavaScript teacher

Favorite answer

5. Julia found another JavaScript teacher







Wednesday, December 14, 2016

Leetcode 322: Coin Change - Find minimum number of coins

Dec. 14, 2016

Julia likes to choose most popular post in code review on stackexchange.com, study the post, write down some notes, and also practice to write her own answer. Try to get into the community as active learner, teacher, and hardworking helper.

Her first post to answer question - no response so far, Dec. 14, 2016 8:19pm
http://codereview.stackexchange.com/a/149598/123986

She likes to write a second one:

Problem: 14 votes, 6 answers, 11K views
http://codereview.stackexchange.com/questions/47397/find-minimum-number-of-coins?rq=1

Same problem:
Leetcode:  Coin Change

http://www.cnblogs.com/grandyang/p/5138186.html

http://blog.csdn.net/liyuefeilong/article/details/50687271

Best solution - using DP, bottom up - Temple Ph.D.
https://github.com/jianminchen/LeetCode-Java-Solutions/blob/master/322.coin-change.java

This may be the best solution - written by MSFT employee, ICPC coach - PH.D.
Time complexity:
Space complexity:
https://github.com/jianminchen/LeetCode-17/blob/master/322_v1.cpp

Post the answer on the code review here. Julia, work on reputation target: 50, right now, 45. Once Julia has 50 reputation, she can leave a comment in any post.

Or click the link:
http://codereview.stackexchange.com/a/150130/123986




Cheat sheet - 10+ advice to review

Dec. 14, 2016

My favorite time to do workout, write down notes from cheat sheet for various positions from well-respected companies.

Share her own experience first before the study.

Julia's personal experience:
1. Always set a small target, work on one small target a time.
2. Focus on one thing a time.
3. Do not get emotional - competition is like sports, the more you play sports, you will get stronger.
4. Work on a long term goal, more controllable things - "personal physical health is most important."
5. Try a new idea everyday.
6. Really enjoy sports activities
7. Be a hackerrank player, build a habit to attend contests
8. Explore new things - 2016 things Julia enjoyed:
      coding blog,
      facebook codelab,
      pramp,
      hackerrank,
      meetup,
      pluralsight.com,
      Udacity,
      Code school,  
      stackoverflow,
      stackexchange.com

9.  Control weight, have best nutrition daily food; keep learning more about healthy lifestyle
10. Learn to relax, watch some movies, write some blog about sports, attend tennis tournaments etc.

----

Amazon
My favorite advice:
Do not be vague - Use some number/ data to make it a case
Don't be stubborn - willing to adapt, open-minded; take hints and go for it.

https://www.bloomberg.com/graphics/2015-cheatsheets/amazon.html

Facebook:
My favorite advice:

How to Ace it
Do engage with your interviewer. "We're very team-oriented. And so the people that do well come in with that attitude, thinking not that we're quizzing them but they're part of the team, and interact with us in a way that they would as if they had the job."

Do know the products. "People that come in with a perspective on our products and ideas on how we can make them better - that's great."

Don't let yourself get stuck - It's OK to ask the interviewer to get their thoughts and ... make it conversational, to get hints.
https://www.bloomberg.com/graphics/2015-cheatsheets/facebook.html

StreetEasy
https://www.bloomberg.com/graphics/2015-cheatsheets/streeteasy.html


Microsoft
https://www.bloomberg.com/graphics/2015-cheatsheets/microsoft.html

The score:
We hire on talent and potential, so they don't need strong sales experience, necessarily.

How to Ace it
Do have a deep a passion for technology.
Do be curious and ask questions.
Do speak with confidence and intelligence.
Don't be overly format. "Don't act like somebody you're not - it's really a come-as-you-are environment."
Don't psych yourself out.

BainCapital
https://www.bloomberg.com/graphics/2015-cheatsheets/bain-capital-ventures.html

Read again, write short notes.

Boeing
https://www.bloomberg.com/graphics/2015-cheatsheets/boeing.html

Do be you.
Do ask for clarification. "Ask to have the question repeated if you don't understand it. We'd rather have you understand the question than answer the wrong one."
Do pose your own questions "at the end of the interviews to make sure you understand what the job is and if you're a good fit for it."
Do some homework. Boeing wants to know "if you're going to have the right thought process, you're going to develop into a good leader." Do not overprepare either.
Don't drag the past along with you. "Don't complain about your prior job or boss. That's always a bad one. Don't be negative. Don't reveal any confidential information about your prior employer or any prior experience you'v had."
Don't make the interviewers dig. "Don't rely on the panel to pull information from you. Make sure that you answer the question, you answer it fully." Don't bore the interviewers, but take your time. "Expand upon the points that highlight your skill set."

Uber
https://www.bloomberg.com/graphics/2015-cheatsheets/uber.html

First round: the standout skills and weakness

The Score:
Can the candidate really help identify a problem and ... drive toward clarity?

Don't leap to solution without grasping the issue. "The best interviews actually spend more time defining the problem."

Amtrak
https://www.bloomberg.com/graphics/2015-cheatsheets/amtrak.html

Don't pose generic questions on Amtrak. The questions that you can find out on the internet in five seconds, do not waste it by asking questions.

Salesforce
https://www.bloomberg.com/graphics/2015-cheatsheets/salesforce.html

Don't brag about being a star. "When candidates tell me about how they took over a project, that doesn't show collaboration. Tell me about a disagreement you had, how you compromised with your teammates and figured it out."

Don't freak out if you don't have all the answers.

Novo Nordisk
https://www.bloomberg.com/graphics/2015-cheatsheets/novo-nordisk.html

Don't be fake.
Don't ignore the rest of the world.
Don't neglect your elevator pitch. "If the person can't represent themselves well and provide me with a coherent picture of their background, I have concerns about their communication skills, especially in situations where there may be controversy."

Boston Consulting Group
https://www.bloomberg.com/graphics/2015-cheatsheets/boston-consulting-group.html

Do look at all the angles of a case. "We're impressed by someone who is creative and hypothesis-driven, not necessarily the person who gets the right answer the fastest."

Don't over-prepare. "Planning everything you're going to say and do in the case study portion of the interview makes for a stale presentation and misses the mark. The point of the case is to see how you approach problems in real time."

Don't fumble your elevator pitch. "Know your personal stories inside and out, because you'll only have time to give the interviewer one or two anecdotes to take away from the interview."

Walmart
https://www.bloomberg.com/graphics/2015-cheatsheets/walmart.html

Mobile web developer

Do live and breathe coding. "We want to see you submit your own apps to the app store, speak at conferences or write a blog, and compete in hackathons."

Don't expect buzzwords alone to be impressive.
Don't be a hero. "Be able to articulate your specific contributions instead of doing everything yourself."
Don't arrive wearing a suit. "It'll seem like you don't fit in here."


Pinterest
https://www.bloomberg.com/graphics/2015-cheatsheets/pinterest.html

Don't panic if a problem stumps you. "We're really trying to assess your thought process, so if you get stuck or make a mistake, don't stress out - nobody is perfect."

Don't stop thinking when the interviewer stops talking. "We'll leave time for candidates to ask questions, and sometimes people don't prepare for that, so make sure you have a couple of questions lined up."

Third Round:
Culture interview:  "startup" mentality

HERSHEY
https://www.bloomberg.com/graphics/2015-cheatsheets/hershey.html

Data scientist

Do know how to mine social media for information.
Do speak authoritatively.
Don't tiptoe around bad news in the case study.
Don't get too stuck in your own area.
Don't second-guess yourself. "You have to have confidence in your ability to make connections, because executives are going to challenging your recommendations. You'll be expected to back them up."

General Electric
https://www.bloomberg.com/graphics/2015-cheatsheets/general-electric.html

Experience Designer

How to Ace it
Do take a Myer-Briggs Type indicator personality test. The best user experience professionals tend to be intuitive types, according to the test. "You have to be able to observe the needs, emotional states, and goals of the people you're designing for."

Do practice your delivery.
Don't act like you know everything.
Don't take credit for things you didn't do.
Don't go it alone. "it's always a bonus if the candidate decides to do the case study with somebody. It shows a willingness to be open with others."

Adidas
https://www.bloomberg.com/graphics/2015-cheatsheets/adidas.html

senior design director

"three C's" - Adidas values: creativity, confidence, and collaboration

Do be tuned in to popular culture.
Do flaunt your underground experience.
Don't try to be someone you're not.
Don't be afraid to think abstractly.

Etsy
https://www.bloomberg.com/graphics/2015-cheatsheets/etsy.html

Engineering Manager
Lead a small team of engineers who will improve Etsy's browsing feature and make the website intuitive for sellers who aren't web experts.

"The interview isn't grading you on your improv skills, but whether you steer difficult conversations forward without falling for distraction."

Do bring your war stories.
Do explain how you tackled a complex project.
Don't understate your self-improvement goals. "Do you read Peter Drucker, Bob Sutton, or the RAND blog?" Not that we have a prescription philosophy, but we do think of leadership as a craft.
Don't stress if you're not a 10X coder. "Managers should understand the architecture of code and be able to help someone who is more junior, but the role does not involve coding on a day-to-day basis."
Don't be full of yourself. Like to see a bit of humility.

Yelp
https://www.bloomberg.com/graphics/2015-cheatsheets/yelp.html

Search and data mining engineer

Do research the challenges of aggregating stream-of-consciousness narratives into readable data.
Do talk about your side gig.
Don't pretend you know everything. "We love learning and have internal hackathons three times a year to encourage developers to collaborate with others and try something new."

LYA
https://www.bloomberg.com/graphics/2015-cheatsheets/lyft.html

software engineer

The score:
communication skills - how well they can describe their thought processes

How to Ace it
Don't pretend you like everything about Lyft.
Do be pumped about Lyft's stated values.
Do keep your cool through several rounds of coding tests.
"Can this person think on their feet and come up with solutions ... and can they code up these solutions neatly and efficiently?"
Do keep a lid on your loner tendencies and show that you can work in a team. "You'll be working in a fast-paced, open, collaborative environment."

January 5, 2016

Review notes, write down most favorite ones:

1. Don't be overly format. "Don't act like somebody you're not - it's really a come-as-you-are environment."
2. Don't second-guess yourself. "You have to have confidence in your ability to make connections, because executives are going to challenging your recommendations. You'll be expected to back them up."
3. Don't act like you know everything.
4. Don't stress if you're not a 10X coder.
5. "The interview isn't grading you on your improv skills, but whether you steer difficult conversations forward without falling for distraction."
6. Don't be a hero. "Be able to articulate your specific contributions instead of doing everything yourself."
7. Don't over-prepare. "Planning everything you're going to say and do in the case study portion of the interview makes for a stale presentation and misses the mark. The point of the case is to see how you approach problems in real time."
8. Don't panic if a problem stumps you. "We're really trying to assess your thought process, so if you get stuck or make a mistake, don't stress out - nobody is perfect."

HackerRank - Year-End warmup practice

Dec. 14, 2016

Plan to choose 10 algorithms worked in 2016, and find ways to do workout.

Focus on basics BFS, DFS, tree, sorting, time complexity, space complexity.

Will come back very soon.

Blog reading:

1. http://codereview.stackexchange.com/questions/47397/find-minimum-number-of-coins?rq=1

2. http://codereview.stackexchange.com/questions/147122/stacklistt-implementation

Segment Tree - kindergarten adventures algorithm - Make my mark

Dec. 14, 2016


Problem statement:
https://www.hackerrank.com/contests/university-codesprint/challenges/kindergarten-adventures

Introduction:
Kindergarten adventure algorithm is the algorithm on HackerRank university codespring contest in November, 2016, and it is medium level difficulty. Julia spent over one hour to think about the algorithm in the contest, but she did not come out the idea using binary indexed tree or segment tree to solve it. After the contest, she likes to master the algorithm.

The Previous two blogs about the algorithm and solutions:

HackerRank - university codesprint - kindergarten adventures (after the contest)

http://juliachencoding.blogspot.ca/2016/11/hackerrank-university-codesprint_16.html

Here is one C# solution she chose to study, here are her workout experience:
1. Put some analysis together,
2. Review code
3. Put together a new version
4. Share on stackexchange.com code review section.

https://gist.github.com/jianminchen/c3abd1d967c58132023b7235b69fdcdd

5. Post the question on the stackexchange.com as well.

Post the question on stackexchange.com code review:
http://codereview.stackexchange.com/questions/149613/hackerrank-university-codesprint-2016-kindergarten-adventures

6. StackExchange.come code review feedback:

put on hold as off-topic by Peilonrayz, forsvarir, BCdotWEB, Vogel612, t3chb0t 2 days ago

This question appears to be off-topic for this site. While what’s on- and off-topic is not always intuitive, you can learn more about it by reading the help center. The users who voted to close gave this specific reason:


8. Julia knew that she has to work on one algorithm a time, and this algorithm takes time. She started her own practice, failed 3 times:

8.1. Wrote my own version of segment tree, first try: 2.18 (maximum score 30)
only pass 4 test cases.
https://gist.github.com/jianminchen/3fc3df275c903e94b780e1612f0171f6

8.2. Second practice, score 1.08 max-score: 30, pass test case 0 and 1.
https://gist.github.com/jianminchen/98f38cfb31bace070184b641c95d14b9

8.3. Third practice, score 0  max-score: 30, pass test case 0, 1
https://gist.github.com/jianminchen/1411dc08a2a2c059454f788add19bceb

It is a really good study case for understanding depth of problem solving. Timeout issue is critical, at the beginning of construction of segment tree, the time complexity should be O(n^2), not O(n), n is the people in the group, n < 100000.

Better score 0 to write your own code, comparing to copy other's code score 30. Do not underestimate your own practice, the mistakes made, time spent all counts to the good learning experience.  

8. Go back to the study code C#: 

And google and try to find some article to help.
The solution is classical, some one already did research how to store the value in segment tree most efficient way, almost O(n) to build up a segment tree.

Find the article using similar idea: 

http://codeforces.com/blog/entry/18051?

Workout: 

1. Show some graph on analysis of solution provided:

2. Get out from the first breakdown on stackexchange.com code review: 
Have some sports therapy - 30 minutes 

Watched the video of Genie Bourchard interview twice while she did some stretch in the living room, for a sports workout. 
Eugenie Bouchard Live: 
https://www.youtube.com/watch?v=w02BSPblBEs&t=320s

(Eugenia is a young player, 20 years old when she was interviewed. She talked about in the interview Nick is her great coach, when she was 12 years, she was taught how to deal with mental issues in sports - stay at moment on the court, no matter what happens )

Do not be lazy. Work hard, fail a few times and then get better. Julia, if you are in uncomfortable zone, that is the learning zone. Do not miss the learning opportunities.

Fail to post, the algorithm written is not mine. Need to come out my own solution first, and then, get code review. Tried various solutions, failed all times. Get to know the algorithm better.

And then, Julia gave her 30 minutes therapy, chose one of top tennis players to motivate herself. Work on algorithm is not easy, to be competitive, Julia has to learn what to work on. No shortcut. Hands on experience, stay at moment. When practice, make as many mistakes as you can. If you can afford the time. 




Sunday, December 11, 2016

Array Construction - Code Review

Dec. 11, 2016

Introduction

Array construction is the first advanced algorithm Julia tried to work on in the contest, she did try to work on over 10 hours, but she scored 0 (maximum score 80). Through the contest, she started to understand the algorithm and built up strong interest in problem solving.

Later, she read one of solution, and then, spent over 4 hours to understand the pruning idea to avoid timeout issue.

Later, she did very intensive research on recursive function. But, she needs to get it on stackexchange.com, share her interest and questions, and then, see if she will get any surprise. Success after team work, Julia likes to practice the belief.

Previous blogs about the algorithm:
Labels: Array Construction (Series 1 of 5)

http://juliachencoding.blogspot.ca/2016/11/hackerrank-codesprint-array.html

Workout:

Plan to post a question on stackoverflow.com code review for code review.


StackExchange.com code review - program challenge ( new school day 5)

Dec. 11, 2016

Julia loves to find the top talent on code review to score high on program-challenge. She found one today:

http://codereview.stackexchange.com/users/66571/twohundredping

Programming-Challenge    Score 38  posts 10 posts %37

She plans to read as many as possible from the talent, meanwhile, try to find most talent person on programming-challenge.

Her most favorite post from the talent:
http://codereview.stackexchange.com/questions/149096/given-n-and-m-find-all-stepping-numbers-in-range-n-to-m/149456#149456

Always program the general case before edge cases. After you have an implementation of the general case see if it handles the edge case or if not, what minimally invasive changes you can make to the general case to handle edge cases. As a last resort, handle the edge case separately.


Julia likes to do some research on programming challenge, how to find great posts?

http://codereview.stackexchange.com/tags/programming-challenge/topusers

Start to read program-challenge answers by user 9357:

http://codereview.stackexchange.com/search?q=user:9357+[programming-challenge]


Algorithm: Given n and m, find all stepping numbers in the range

Dec. 11, 2016

Introduction:
Julia start to have good time to read code review post. She started to check her post, no update; but quickly she started to look for good ones to read, and give out a few of upvotes. She earned 36 reputation, after she got more than 30 reputation, she can upvote/ downvote any post.

Here is the post she loves to read. The way she can support people's code review, is to give a upvote.

http://codereview.stackexchange.com/questions/149096/given-n-and-m-find-all-stepping-numbers-in-range-n-to-m/149456

Workout:

Julia learns a few things through the code review. Will write down here.

Her favorite code review:

1. http://codereview.stackexchange.com/a/149157/123986

2. This one is better

http://codereview.stackexchange.com/a/149456/123986

Julia really likes the code review: Advanced topic, so she write the C# version,

https://gist.github.com/jianminchen/28b656f16aa58a00687e823eb0aaf212

She likes to share the code with comment, but she needs 50 reputation in order to post a comment.
So, Julia just wrote an answer for the question.

Here is the link:
http://codereview.stackexchange.com/a/149598/123986

Actionable Items:

1. There are over hundreds programmers write good answers on stackExchange.com code review. Julia, work with them, try their ideas first using C# code, and then, try to improve, and enhance the work. Add code with some test cases, and question some variable names, and write down the ideas to make code more quick to follow.

2. Read more badges - what they are, how they are defined, come out filters to search, find most valuable posts.

    Badges - read, learn, memorize, and enjoy the searching using badges knowledge.












Saturday, December 10, 2016

Segment Tree - kindergarten adventures algorithm - code review

Dec. 10, 2016

Problem statement:

Introduction

Kindergarten adventure algorithm is the algorithm on HackerRank university codespring contest in November, 2016, and it is medium level difficulty. Julia spent over one hour to think about the algorithm in the contest, but she did not come out the idea using binary indexed tree or segment tree to solve it. Julia was very lucky to find a C# solution actually implemented using segment tree.

The Previous two blogs about the algorithm and solutions:

HackerRank - university codesprint - kindergarten adventures (after the contest)



Julia found out that her learning of binary indexed tree is missing most important part, the experience to play and learn from a simple concrete example; she read a lot about segment tree, or binary index tree, but she needs to have some time to play with an example, have some fun. The skills will come afterwards, she believes.

Here is one C# solution she chose to study, here are steps:
1. Put some analysis together,
2. Review code
3. Put together a new version
4. Share on stackexchange.com code review section.

C# code

Plan to work on the algorithm 2 hours. Dec. 10, 2016, 11:36am - 1:36pm

Put some references together for further study.

Workout


C# code - Julia tries to figure out how to build a segment tree through sample test
case:
3
1 0 0
The segment tree in an array: {0,0,2,2,1,1}

Segment Tree:

C# code

Julia's concerns about segment tree:

Questions:

1. Why does Modify function skip one and only add value on odd number?

Line 114 - line 125,

        public void Modify(int start, int count, int value)
        {
            int size = tree.Length / 2;
            int left = start + size;
            int right = start + count + size; // open border

            for (; left < right; left >>= 1, right >>= 1)
            {
                if (left  % 2  == 1) tree[left++]   += value;
                if (right % 2 == 1) tree[--right]  += value;
            }
        }

2. How does the range of start/ end to be determined on this simple test case: 1 0 0?

Line 87 - Line 93:
private static SegmentTree BuildTree(int n, int[] extraMinutes)
    {
        var tree = new SegmentTree(n);
        for (int i = 0; i < n; i++)
        {
            int curr = extraMinutes[i];
            int len  = extraMinutes.Length;

            if (curr >= len) continue;

            int start = (i + 1) % len;
            int end   = (i + extraMinutes.Length - curr) % len;

            if (start <= end)
                tree.Modify(start, end - start + 1, 1);
            else
            {
                tree.Modify(start, len - start, 1);
                tree.Modify(0,     end + 1,     1);
            }
        }

        return tree;
    }

Why start = (i+1) % len? Guessing,  i = 0, ID counts from 1 to 3, not starting from 0.
Why end  = (i + extraMinutes.Length - curr) % len;

3. Question:
Study Query API: Why skip the root node?
for loop, i > 0

Line 132 - Line 139:
public int Query(int index)
        {
            int res = 0;
            int i = index + tree.Length / 2;
            for (; i > 0; i >>= 1)
                res += tree[i];
            return res;
        }


Actionable Items


Julia, only way, better way to learn segment tree, binary index tree, is to work on an algorithm, and then, ask good questions to yourself, and then, post the question on the stackexchange.com as well.

Post the question on stackexchange.com code review:

Code review is here. The code review was closed.

It is not acceptable to ask help to understand other people's code. That is the rule from stackexchange.com. Do not be lazy. Work hard, fail a few times and then get better. Julia, if you are in uncomfortable zone, that is the learning zone. Do not miss the learning opportunities.

Fail to post, the algorithm written is not mine. Need to come out my own solution first, and then, get code review. Tried various solutions, failed all times. Get to know the algorithm better.

1. Wrote my own version of segment tree, first try: 2.18 (maximum score 30)
only pass 4 test cases.

C# practice 1

2. Second practice, score 1.08 max-score: 30, pass test case 0 and 1.

C# practice 2

3. Third practice, score 0  max-score: 30, pass test case 0, 1

C# practice 3

It is a really good study case for understanding depth of problem solving. Timeout issue is critical, at the beginning of construction of segment tree, the time complexity should be O(n^2), not O(n), n is the people in the group, n < 100000.

Better score 0 to write your own code, comparing to copy other's code score 30. But do not understand the design and algorithm. 

References


1. Read the lecture note to help:

Lecture note to study.

2. Read the article about segment tree.



A short research - "Jane the Virgin" - Netflix TV series

Dec. 10, 2016

Julia found out that she did spend over 2 hours to watch Jane the Virgin on netflix.com in December. So many good memory about the place - Miami area, Julia's home town from 1996 to 2010.

Jane the Virgin - https://en.wikipedia.org/wiki/Jane_the_Virgin

Possible ideas to do research:

How to make TV series? What are actor/ actress practicing daily? Can I borrow some good ideas to write blogs?

TV series are very structured, short and focus on one topic each episode.

Will come back very soon.