- Took the BMW online test. 8 questions. Each was a 1-3m video recording of my answer.
- All had unlimited time to think - I was kinda hoping they'd be restricted in time and in #takes (could shine more I guess).
- The whole test was java heavy.
- JDK/JRE/JVM. Generics.
- Creational design patterns. Prototype, factory, singleton.
- JEE APIs. JavaMail - like flask-mail. Persistence - like sqlalchemy. Security API - like flask-user and flask-admin.
- Join differences.
- I know these, just typing out for refresher:
- Inner. Normal, condition matches in both tables.
- Left. Return the full left table with matching records from the right, and null otherwise.
- Right. Return the full right table with matching records from the left, and null otherwise.
- Full. Return both left and right (basically stitch both tables together and fill null with nothing).
- Good summary: http://www.sql-join.com/sql-join-types.
- Flash will not be supported on chrome at the end of 2020. I'm still amazed Amazon's conference room requires it.
- Apple TV+, Disney+, Hulu, Showtime, HBO, Netflix, Peacock (NBC) coming soon.
- Smoked a pork shoulder. Handpressed tacos with maseca.
- Cooked a couple pounds of garbanzo beans.
- Turns out that the IR lamp in the terrarium isn't dead, I simply had the outlet disabled.
- Supercontest.
- Had to decide to implement an offseason explicitly or simply extend week 17 to last through the remainder of the year. The latter is much easier, so I did that. The former bleeds into g.current_week, current_season, and downstream into is_paid_user, leagues, and much more. It's more proper, but much more complicated and unnecessary at this point. If I need an offseason-specific view in the future, I can add this.
- Fixed and deployed.
- Practice problems.
- Whiteboard most of these. Transferred to computer to check syntax.
- Another thing above leetcode that's superior to hackerrank: it reports time and mem usage, as well as your percentile.
- https://www.hackerrank.com/challenges/counting-valleys/problem.
- https://www.hackerrank.com/challenges/jumping-on-the-clouds/problem.
- https://www.hackerrank.com/challenges/repeated-string/problem.
- https://www.hackerrank.com/challenges/2d-array/problem.
- https://www.hackerrank.com/challenges/ctci-array-left-rotation/problem.
- https://www.hackerrank.com/challenges/new-year-chaos/problem. This was started to get a little tougher. Write down a few simple cases, reason through the logic.
- https://www.hackerrank.com/challenges/minimum-swaps-2/problem. This one is dumb. Hacker rank has some pretty misleading/bad questions.
- https://www.hackerrank.com/challenges/crush/problem.
- Sometimes a problem has two dimensions that you can iterate over, say N and M, and it’s worth putting an IF statement in your whole algorithm to dictate which you do.
- https://www.hackerrank.com/challenges/ctci-ransom-note/problem. Remember hash tables are faster lookup than arrays. If you’re going to access more than once later, it’s usually worth iterating over the array a single time creating a dict with word counts, and then accessing that later, rather than finding the word in the original array.
- https://www.hackerrank.com/challenges/two-strings/problem. Hash for lookup speed!
- https://www.hackerrank.com/challenges/sherlock-and-anagrams/problem. Dumb questions. Worded with zero clarity. Accepts a brute force O(n!) solution, but indicates nothing of such constraints.
- https://www.hackerrank.com/challenges/count-triplets-1/problem. Remember remember. For COUNTING problems, your gut should tell you to use a hashtable for fast lookup. I got a general solution that passed most the tests, but the final answer that passes all is VERY elegant. Was cool to read.
- https://www.hackerrank.com/challenges/frequency-queries/problem. Crushed it. Defaultdicts, tested with int, list, and dict. Kinda cool to have a defaultdict whose default is a nested dict.
- Went through the 4 basic "approach" videos as well: https://www.hackerrank.com/interview/interview-preparation-kit/tips-and-guidelines/videos.
- A factorial multiplies each integer's product, but in some cases for combinations you need to add them, like the sum of all integers from n to 1. This is called the binomial coefficient, and it's n(n+1)/2. It always yields an integer. This comes up in regular life way more often than you might think; pay attention for it.
- In python, collections.defaultdict(int) will make the default zero. Similarly, (list) will make the default an empty list. This is very useful to avoid the annoying "check if key exists, append if so, create if not" clauses.
- defaultdict is a little faster than Counter, as well.
Friday, January 3, 2020
Subscribe to:
Posts (Atom)