darwinrlo / public

0 stars 0 forks source link

Software Engineering Interviews #2

Open darwinrlo opened 4 years ago

darwinrlo commented 4 years ago

It is April 23rd. My interview at Google is May 19th, which is on a Tuesday. This means I have 24 days left to prepare -- just about three weeks.

I'd like to spend the final week on the distributed systems course and approximate methods for solving NP-complete problems. For my ambitions, there is a real time crunch here.

The two days before that date will be spent reviewing already-processed material. No new material will be processed during those two days. Effectively, there is a deadline of midnight the Sunday before for the processing of new material.

On the morning of the interview, I will undergo a recall & reconstruction sequence to load the most high-impact knowledge into my working memory. I will tinker with this sequence between now and then. I need a first draft of this sequence by the end of this weekend.

darwinrlo commented 4 years ago

I'm already good at putting the pieces together. I just need to learn what the pieces are.

darwinrlo commented 4 years ago

Students can understand things by writing code.

Set theory is also important. So is abstract algebra. And perhaps topology?

darwinrlo commented 4 years ago

Discrete math, algorithms and data structures, and the theory of computation are weight-lifting for the brain.

Developing a terminology is very important.

darwinrlo commented 4 years ago

I'd like to call them "review prompts." "Prompts" because they may not be questions. And their purpose is to give you an idea of what to summon into working memory.

Recalling something elevates its priority to your brain. It also identifies the specific points where you need to get clarification.

darwinrlo commented 4 years ago

If I could go back, I would start with the Big-O and technical interview chapters in CtCI.

darwinrlo commented 4 years ago

It's important for two recall sessions to have a full night of sleep in between.

After a recall session, make sure to get a full night of sleep that night.

darwinrlo commented 4 years ago

If you're struggling with designing the high-level algorithm, don't worry about the edge cases. The former is hard enough without having to worry about the latter. You can get to edge cases once you're confident in your ability to design algorithms at a high-level.

darwinrlo commented 4 years ago

If I work at Google, I can study Jeff Dean's code. Peter Norvig is also there.

John Carmack is at Facebook.

I want to develop tools to improve the output of the entire company -- just like MapReduce did.

DeepMind is part of Google. Also, it's in London, which is really cool.

darwinrlo commented 4 years ago

If you don't know how to learn, learn how to learn first before earnestly preparing for interviews. Interview prep can be used to learn how to learn.

darwinrlo commented 4 years ago

Also important is learning how to do. For some people, learning is rewarding for its own sake. For most people -- including myself to a large extent -- learning is valuable to the extent that it enables me to do things I want to do.

The week, for many, feels natural as an execution cycle.

darwinrlo commented 4 years ago

Hacking a Google Interview

This is very condensed. Probably good to start with.

A strategy is to look for others who are more experienced to distill, condense, and filter the material for you. You should be able to exceed those who have gone before you -- not just match their performance and timeline.

darwinrlo commented 4 years ago

Break things up into solid, near-solid, and shaky.

Reference Julia's article.

darwinrlo commented 4 years ago

With the proliferation of products and content to help with interview preparation, the performance of the field has improved markedly -- and consequently, expectations at the top companies, such as AirBnb, Facebook, and Google, have gotten much higher.

CtCI says: (quote about how your performance is judged relative to others' performance)

Facebook goes right out and says you need to be able to confidently do two Medium problems from Leetcode within 35 minutes.

darwinrlo commented 4 years ago

Schedule a mock interview using Gainlo for a month out. Each week, prepare for the next LeetCode competition. Start by going through Grokking the Coding Interview.

darwinrlo commented 4 years ago

During my interviews at Facebook, I did well at the coding interviews. But I failed the system design interview. I had never heard of them and didn't know what they were.

darwinrlo commented 4 years ago

Grokking: TinyURL

To cache 20% of these requests

I don't think caching 20% of requests is a particularly relevant thing to do. Rather, 80% of requests will be for 20% of the short links of the day. This will take 20% of the memory that would be needed to store objects if each request was for a distinct resource.

darwinrlo commented 4 years ago

Without a rigid structure, motivation can lapse -- even if you have deadlines set up.

You feel like you're digging a bottomless hole. This is a bad feeling. If you feel this way, you need to change something.

You need both deadlines and structure.

At the same time, there has to be room for improvisation -- unplanned work. Space needs to be created for luck and breakthroughs to happen.

Getting all the pieces together is difficult. Even knowing what they are is difficult!

The weekend and evenings are terrific candidates for improvisation.

darwinrlo commented 4 years ago

Half-hour to hour-long session to set up your mindset for the day.

darwinrlo commented 4 years ago

Have a separate project management system for each session.

darwinrlo commented 4 years ago

It takes time to understand things. You need to do what you need to do to get to understanding. You can't be anymore efficient than that.

Your understanding has to take the form of a story.

darwinrlo commented 4 years ago

You need to work in fixed-time blocks (and to take breaks). You need to evaluate how you did and how you need to improve on the next block. You need to lift your head from the weeds and make sure you're still pointed in the right direction.

darwinrlo commented 4 years ago

Grokking the Coding Interview is a huge step forward for interview preparation and competitive programming training. Someone with a lot of experience has distilled a vast body of knowledge into the tightest presentation of the materials ever created.

darwinrlo commented 4 years ago

Have the courage to follow half-baked ideas. "Take a leap of faith."

darwinrlo commented 4 years ago

It is more efficient and more effective to work on being able to write the story and then to be able to tell the story using speech than it is to go straight to speech.

darwinrlo commented 4 years ago

It takes several attempts on different days to write the story that makes you feel resolved, in particular, makes you feel that you understand.

The process of creating the story leads to making realizations and connections.

It takes several drafts.

Creating a diagram may be another way to achieve the same thing.

darwinrlo commented 4 years ago

CtCI is on the easy side. You may be able to get into Google but not necessarily at a high rank or salary.

But it's a decent place to start.

darwinrlo commented 4 years ago

Example of a reflection:

I would get deep in thought. Then I'd "come to" and not know where I am in the session.

darwinrlo commented 4 years ago

Meditating after a work bout releases your mental resources. It makes you feel fresh and clear-headed for the next work bout. It also pulls you out of the weeds so you can see the big picture again.

darwinrlo commented 4 years ago

Turn reflections from one work bout to intentions (or even commitments) in the next work bout. Iterate quickly. Don't have to wait a whole day to make changes.

darwinrlo commented 4 years ago

You have to finalize the current version before you can iterate on it.

Instead of working on the next version, you could be working on the current version well past the point of diminishing returns.

It can be anything that gives you the feeling of closure.

Closure: releasing mental resources and freeing them up for other uses

darwinrlo commented 4 years ago

I don't really need Python. I have Python-like pseudocode already.

darwinrlo commented 4 years ago

Monday Master Class: Conquer Complicated Material with the Mini-Textbook Method

A reader recently asked me for some study advice. He was facing an exam in a course with unusually complicated material. The concepts were numerous, and tricky to understand, and connected to each other in non-obvious ways. It was clear that there was too much information to be efficiently handled by standard quiz-and-recall, so I referred him to my favorite under-appreciated study technique: the focused cluster method.

This was still, however, not enough. As the reader was quick to observe, there was so much material connected in so many different ways that even creating a quick rapid-fire question for each key point would soon spiral out of control. There would be way too many review questions.

When faced with a course with large volumes of complicated material, reduce your notes to a collection of textbook-style chapters. Write these like a real textbook. That is, use complete sentences and logical explanations.

Your goal should be to reduce and synthesize. A good rule of thumb is to have at most one succinct chapter per each week of notes.

Things you might include in the sample chapter:

A high-level description of the concepts covered in the chapter.

A list of definitions.

Good, succinct descriptions of the big ideas, theories, or frameworks.

A discussion of how the different elements from the previous item connect or compare and contrast.

The chapter writing process itself provides a powerful review, as it helps you construct a structure that transforms copious notes into coherent and compact form that is easier to review.

The next step of the process is to construct a chapter prompt sheet for each of these chapters. On the prompt sheet, record a basic outline for the chapter.

Finally, to review, do the following. For each chapter consider the corresponding outline. Load up your favorite word processor, and, using only the outline as a guide, attempt to type, from scratch, a new draft of the textbook chapter. Don’t peek at the original chapter.

After your done, check your result against the original chapter; just like in the quiz-and-recall method, go back and try again later if there are areas where you had trouble.

For classes with a large volume of complicated, interconnected material, the advantages of this method are two-fold. First, condensing the material into textbook chapters reduces the amount of information to review. A synthesized chapter will be more succinct than a long multi-page list of the type of rapid-fire questions used in a technique like the focused-cluster method.

Second, typing the sample textbook chapter can prove quicker than trying to explain things out loud.The reason: it’s easier to express complicated ideas by typing rather than speaking. With typing, you can edit sentences, and go back and rearrange your structure as needed. When speaking, on the other hand, if the concepts are tricky and connected in intricate ways, you’re prone to getting tripped up.

This technique might be overkill in many situations. For upper-level classes, however, writing your own textbook from scratch, though somewhat slow, might still be the fastest way to actually master the material.

darwinrlo commented 4 years ago

Give examples of applying Cal Newport's techniques to interview prep, e.g. focused question clusters or even the mini-textbook method for system design concepts.

Give focused question clusters a shot before attempting the mini-textbook method.

darwinrlo commented 4 years ago

Monday Master Class: Use Focused Question Clusters to Study for Multiple Choice Tests

From experience, I know that it can take a long time to transform your notes into the focused question clusters. This follows directly from the volume of rapid-fire questions you end up having to record. To keep things painless, it’s highly recommended that you consider transforming your notes into these clusters every week as you proceed through the term. This will keeps the studying itself a reasonable chore.

darwinrlo commented 4 years ago

You Know What You Write: The Textbook Method for Ultra-Learning

The comparison highlights the power of a simple act: describing and organizing information in your own words.

darwinrlo commented 4 years ago

Building Secure & Reliable Systems

darwinrlo commented 4 years ago

I think annotating code lists could be the way to go. Maybe quiz-and-recall questions for very important takeaways.

darwinrlo commented 4 years ago

Ben Lynn:

I’m fortunate I’ve always intuitively known how to attempt problems that I have no idea how to start. Well, “no idea” is inaccurate: I usually have some ideas, it’s just that they seem unlikely to work. But I’ll pursue them anyway, and with luck, understand more about the problem. With even more luck, this leads to more ideas, which eventually crack open the problem.

Ben Lynn: How I Solve It

darwinrlo commented 4 years ago

This might be the way to go:

Annotating a complicated example. Given a complicated example of a certain type of problem, a good TEQ might have you provide detailed annotation on each step; explaining the logic behind each.

Or just the key takeaways.

Source: Monday Master Class: Use Technical Explanation Questions When Studying For Technical Classes

darwinrlo commented 4 years ago

The functional equivalent of underlining an online text might be clipping out quotes and screenshots.

darwinrlo commented 4 years ago

A common path seems to be starting by solving the problem by assuming there are no duplicates and then evolving the solution to handle duplicates.

darwinrlo commented 4 years ago

Weekends

pgbovine: Working on Weekends:

I then came up with a better policy: I do only work that I want to do on weekends, not work that I need to do. In other words, I pick only tasks that I'm genuinely interested in doing, not those that I need to do out of professional obligation. As a result, sometimes I work a ton on weekends, and sometimes I barely work at all. But no matter what, I'm always doing what I want to do, not what I need to do.

As a result of these two rules, I often get my best work done on weekends because, unlike on weekdays, I have complete freedom to work on what I want without getting interrupted by tasks that other people put on my queue. At the same time, there is never any pressure to make real progress since, after all, it's my weekend! Any progress that I do make is a bonus.

The lack of immediate pressure enables me to try more unconventional approaches to my research on weekends. If whatever I attempt doesn't pan out, then that doesn't matter, because I was just playing around anyhow. If I'm in the mood, I skim through papers, browse technical websites, test new open-source software projects, draw concept sketches in my notebook, and do other vaguely research-related things for fun. The important thing is that my weekend work doesn't feel like work. I'm convinced that this sort of “playful quasi-work” is essential for making interesting creative leaps rather than just predictable incremental steps.

Rhadika Nagpal: How I Learned to Stop Worrying and Love the Tenure-Track Faculty Life

And at that point I decided that 50 would just have to be enough.

But of course less hours mean you get to do less work.

So eventually I came up with an easier solution. I decided on a priori "fixed amounts" in which I was allowed to agree to do things. Once the quota is up, I have to mandatorily say no.

I stop working late Friday night and I don't open my email client until Monday morning.

darwinrlo commented 4 years ago

The pseudocode used in many algorithms explanations is too far removed from actual code to help with assessing time complexity. This is something I think should change about how algorithms is taught.

darwinrlo commented 4 years ago

If you're interested in a topic, then the time-to-understanding and the retention are both boosted. It's worth factoring interest into the priority of a study topic.

Interest is a critical factor in "genius."

darwinrlo commented 4 years ago

Don't be focused on outcomes. Focus on the value intrinsic to the experience.

darwinrlo commented 4 years ago

Learn in Java. Then translate to Python.

darwinrlo commented 4 years ago

Whenever you have emotional difficulty making the right decision, say to yourself:

gooddecisionmaking

Or: #chooseoutcomesnotactions

darwinrlo commented 4 years ago

This is absolutely terrific for coding up solutions.

https://repl.it/

You can link to code snippets from Workflowy.

darwinrlo commented 4 years ago

If something strikes your interest, your ability to learn is significantly increased. This should factor into your prioritization as well.

darwinrlo commented 4 years ago

This does not make sense. It is likely wrong.

At every step of the algorithm, we find a vertex which is in the other set (set of not yet included) and has a minimum distance from the source.

Geeks for Geeks: Dijkstra's shortest path algorithm

Assign distance value as 0 for the source vertex so that it is picked first.

I don't like this. Just initialize the shortest path tree with the source vertex.