Lurker News
Hi HN — I'm 43, and at a bit of a crossroads. I sold my share in a company last year and have been taking time off to figure out my next move, and while I've mostly done startups my whole career, I am considering going for a job at a big tech company (FAANG/Lyft/Stripe/etc.). Does anyone have any experience doing this? I can still keep up coding, but should I do that, or try for management? What skills should I brush up on particularly? Mostly, I am a bit fed up with the stress and uncertainty of startups and looking for something more stable, at least for a while.

Comments (184) 47 threads

Show all comments

Showing thread 4 of 47

cmsonger3 replies#
I joined Google at the age of 50. Just send a resume. They are not trying to surprise you and want you to do your best. Consequently, not only do they tell you what to expect from the interview process, the recruiter will send you a PDF that talks through what to expect along with a reading list you can use to prepare. (For example: cracking the coding interview and CLRS are on it.)

That said, I just went in cold. If you've been coding and are current in one of the 3 big interview languages (C++/Java/Python), and if you still understand your undergraduate level algorithms course and the corresponding vocabulary, then you know what you need to know.
Side note: A thing that no one told me but that I had to figure out on my own is that your technical writing skills are one of the most important skills to doing well at google. It was unironically said to me that the highest reward/effort one can do at Google is to write documents. The person who said it was correct about that IMO.

decebalus17 replies#
You advice is sound but incomplete.

> if you still understand your undergraduate level algorithms course and the corresponding vocabulary, then you know what you need to know
speaking from experience, this would not get you nowhere near the level you have to be for passing the Google interview (or any other FAANG interview for that matter). You need to study long and hard in addition to solving OJ problems and familiarize yourself with different problem patterns. Let me give you and example of what I got at Google: https://leetcode.com/problems/remove-duplicate-letters/ Solving this problem optimally with only what you remember from undergrad algo courses is impossible. You either need to have a knack for these types of challenges or solve enough of them to identify a solution pattern.

matt-attack3 replies#
> You must make sure your result is the smallest in lexicographical order among all possible results.

Can someone explain this? I can't even parse that sentence.

kayoone2 replies#
in other words, the shortest string in alphabetical order

Continue this thread — 2 replies

Blakestr#
Basically alphabetical order, but if you don't say lexicographical, it doesn't sound as smart. (I am assuming it's a more comprehensive term, having to do with other characters, other than simple letters, so that if integers were used, it would appear as 1234, where saying "in alphabetical order"doesn't make sense. But yeah, I did a double take.
grahamburger#
If you remove the duplicates from the string:

CACB
You can get either CAB or ACB. If you were to order all of the possible results of removing duplicates (in this case only two, but obviously many more for more complex strings) and order them alphabetically, then take the lowest one, that would be the right answer.

jefftk1 reply#
For what it's worth, I've interviewed 200+ engineers at Google and I think the problem you linked is not a good interview problem. I'm sorry you were asked it!

A good problem gives people with algorithms ability a space to demonstrate that, but it should also give space for demonstrating strengths in design, coding, communication, etc. This one is almost all algorithms, of the "have you seen things like this before" variety, plus a small amount of code.

seanmcdirmid2 replies#
Does Google interview training emphasize that? Even in companies that claim not to give leetcode questions, they do pop up; everyone isn't really on the same page and there seems to be a lot of luck involved.

Continue this thread — 2 replies

krn1 reply#
> Let me give you and example of what I got at Google: [...] Solving this problem optimally with only what you remember from undergrad algo courses is impossible. You either need to have a knack for these types of challenges or solve enough of them to identify a solution pattern.

I have never tried to solve such problems before, but wouldn't it be enough to convert the string into a set of chars, then into an array of chars, sort it, and return it as a string?

decebalus15 replies#
> wouldn't it be enough to convert the string into a set of chars, then into an array of chars, sort it, and return as a string?

No. Please re-read the problem statement. It's way more complicated than that. If you figure out how to do it, try to figure out how to do it in O(N).

Continue this thread — 5 replies

MaximumYComb3 replies#
I've just finished the 2nd year of my CS degree. In about 3 minutes I came up with:

1) create an empty string, call it "S2" 2) loop over each char in original string 3) if the char isn't in S2, add it to the end of S2. If the char is already present in S2 then lexicographically compare the prior S2 verse S2 with this char shifted to the end. Keep the lower ordered one.
This took about 3-4 minutes of thinking and is O(n). It might not be optimal, it might not even be a correct solution as I've spent only a few minutes on it. However, I feel it's close and it wouldn't take much to flesh out.
EDIT: This solution is incorrect.

thaumasiotes1 reply#
Here's what I came up with after experimenting with handling the leetcode example ("given cbacdcbc, produce acdb") manually:

Build a suffix tree ( https://en.wikipedia.org/wiki/Suffix_tree ) of the input with two modifications:
1. When adding a letter to the suffix tree, skip any paths that already contain that letter. (Thus, each path will contain a given letter no more than once.)
2. Include accounting information in each node specifying the length of the longest suffix including that node.
From wikipedia, construction of an ordinary suffix tree takes time and space linear in the length of the input string. At this level of analysis, I'm just hoping that modification #2 doesn't affect that. #1 certainly won't, in that it involves spending less time and less space than otherwise (by bailing out early under some circumstances).
Once the tree is constructed, just walk it, selecting at every point the child that is lexicographically earliest among all children with the maximum suffix length.
Observation: constructing this tree by hand really feels exponential; I suspect that the linear time and space requirements lean on an assumption that the size of the alphabet is finite.
Observation #2: Based on the comment timestamps, this took about 40 minutes of thinking. I think it's a good solution, but it probably wouldn't look great in an interview. (Also, handwaving "construct a suffix tree" is fast, but actually producing the code to do it takes extra time.) :/
Observation #3: assuming your solution is correct, it is essentially a reduction by dynamic programming of this one, only doing the calculations that are necessary to produce the lexicographically earliest string where I produce them all.

thaumasiotes#
After playing with suffix trees a little more, I need to make a correction:

This problem asks for subsequences rather than substrings. As a result, when adding a node to the "suffix tree", it will need to be added as the child of more nodes than it would if we were building an actual suffix tree.
This seems like the type of change that might make construction of the tree harder than O(n). In particular, it will violate the constraint that a suffix tree for a string of length n has only n leaves.

1712433 replies#
input: "bcabc"

  1. "b"
  2. "bc"
  3. "bca"
  4. "bca"
  5. "bca"
What am I missing?

Continue this thread — 3 replies

mmierz4 replies#
That solution as written is O(n^3)

This is not an easy problem.

Continue this thread — 4 replies

sfgweilr4f#
I think I'd rather solve real problems than some basic algo I'd never bother to write myself. If Google just wants basic algos and will likely filter me out during interview because of that, I'd sooner not bother. This is probably why big companies complain of talent shortages. Also why they forget real people and start going on very strange tangents. Stupid filters. Good.

I'll stick with creating actual solutions for real people with real problems. So much easier. shrug

hiram1121 reply#
As I'm in a similar boat to the OP, this is exactly why I'm hesitant to even interview with any of these companies, even as a test to see where I stand, simply because I fear I'd be blacklisted on some list these companies might share, should I bomb one without a lot of time spent reviewing.

I sometimes follow a Reddit sub geared for mostly recent CS grads. Every week or two will be a post from someone who got a FAANG job, detailing what he did in order to pass the interview. And some of these are pretty absurd - graduating last semester and since then spending 6 months going through leetcode 6 hours a day, studying algorithms, paying for interview training classes, etc.
And as an older guy who has a decent CS degree but hasn't needed to use 90% of anything related to algorithms in 15 years, I'd have to study a lot, and along with the numerous days of vacation time used for these interviews in California, it doesn't seem worth the effort.

hiyer#
> I fear I'd be blacklisted on some list these companies might share, should I bomb one without a lot of time spent reviewing.

AFAIK they only blacklist you for 6 months and then you can try again. Even that may be relaxed if you're trying for a different department or, especially, geographical location.
> numerous days of vacation time used for these interviews in California, it doesn't seem worth the effort.
In India at least, the big companies handle this better than smaller ones - they have one or two telephonic interviews to begin with and then finish off all the face-to-face interviews in a single day.

grahamburger1 reply#
Well this was a fun distraction! Took my no-CS-degree self a few tries to get it, but I got it[1]. I doubt I could have done it very well in an interview setting, though. A bit trickier than it looks at first for sure. Good practice because I have a coding interview tomorrow.[2]

12ms w/ 2.1MB memory usage - apparently 25 percentile for speed and lower memory usage than 100% of submissions in ~50 lines of Go.
[1] https://leetcode.com/submissions/detail/292246392/ (Not sure if you can deep link in to leetcode like this?)
[2] I am looking for a job! Hit me up! https://news.ycombinator.com/item?id=21937576

derangedHorse1 reply#
Can you elaborate on how technical writing can help you excel at a google? I write docs at my company all the time (that garner a lot of views) but I feel like most of the time it goes unappreciated except for those few individuals that actually need them to finish a random one-off task they were assigned.
alexgartrell1 reply#
(At Facebook, not Google) when the technical writing is used to influence a technical outcome. Particularly a strategic one. a well written memo can change the way business is done and there’s not much ambiguity around where the idea came from.

That said, being an eager doc writer in an effort to claim credit or inflate the perception of your own work is a great way to lose friends and alienate people.

rapphil1 reply#
Why do they get offended that you are consolidating knowledge?

Continue this thread — 1 reply

sdnlafkjh34rw2 replies#
Just as one data point - I went through the onsite recently and I personally found that PDF to be unhelpful. While it does list everything you need to know, it also lists way too many things that you probably don't need to know. It's basically an exhaustive list of basically every resource and topic that could possibly show up in the algorithmic interview. In my view you just need to cover Cracking the Coding Interview and then do 50-100 Leetcode questions. If you have a strong grasp of intro algorithms that would work too, except for engineers like me who didn't major in CS and hence never took an algos course.

--- Here's the actual PDF contents -------
Algorithm Complexity: ○ Please review complex algorithms, including big O notation. For more information on algorithms, visit the links below and your friendly local algorithms textbook. ■ Online Resources: Topcoder - Data Science Tutorials, The Stony Brook Algorithm Repository ■ Book Recommendations: Review of Basic Algorithms: Introduction to the Design and Analysis of Algorithms by Anany Levitin, Algorithms by S. Dasgupta, C.H. Papadimitriou, and U.V. Vazirani, Algorithms For Interviews by Adnan Aziz and Amit Prakash, Algorithms Course Materials by Jeff Erickson, Introduction to Algorithms by Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest and Clifford Stein
● Sorting: ○ Know how to sort. Don't do bubble-sort. ○ You should know the details of at least one nlog(n) sorting algorithm, preferably two (say, quicksort and merge sort). Merge sort can be highly useful in situations where quicksort is impractical, so take a look at it.
● Hash Tables: ○ Be prepared to explain how they work, and be able to implement one using only arrays in your favorite language, in about the space of one interview.
● Trees and Graphs: ○ Study up on trees: tree construction, traversal, and manipulation algorithms. You should be familiar with binary trees, n-ary trees, and trie-trees at the very least. You should be familiar with at least one flavor of balanced binary tree, whether it's a red/black tree, a splay tree or an AVL tree, and you should know how it's implemented. ○ More generally, there are three basic ways to represent a graph in memory (objects and pointers, matrix, and adjacency list), and you should familiarize yourself with each representation and its pros and cons. ○ Tree traversal algorithms: BFS and DFS, and know the difference between inorder, postorder and preorder traversal (for trees). You should know their computational complexity, their tradeoffs, and how to implement them in real code.
○ If you get a chance, study up on fancier algorithms, such as Dijkstra and A (for graphs). ● Other data structures: ○ You should study up on as many other data structures and algorithms as possible. You should especially know about the most famous classes of NP-complete problems, such as traveling salesman and the knapsack problem, and be able to recognize them when an interviewer asks you them in disguise.
● Operating Systems, Systems Programming and Concurrency: ○ Know about processes, threads, and concurrency issues. Know about locks, mutexes, semaphores and monitors, and how they work. Know about deadlock and livelock and how to avoid them. ○ Know what resources a processes needs, a thread needs, how context switching works, and how it's initiated by the operating system and underlying hardware. ○ Know a little about scheduling. The world is rapidly moving towards multi-core, so know the fundamentals of "modern" concurrency constructs.
● Coding: ○ You should know at least one programming language really well, preferably C/C++, Java, Python, Go, or Javascript. (Or C# since it's similar to Java.) ○ You will be expected to write code in your interviews and you will be expected to know a fair amount of detail about your favorite programming language. ○ Book Recommendation: Programming Interviews Exposed; Secrets to landing your next job by John Monagan and Noah Suojanen (Wiley Computer Publishing)
● Recursion and Induction: ○ You should be able to solve a problem recursively, and know how to use and repurpose common recursive algorithms to solve new problems. ○ Conversely, you should be able to take a given algorithm and prove inductively that it will do what you claim it will do. ● Data Structure Analysis and Discrete Math: ○ Some interviewers ask basic discrete math questions. This is more prevalent at Google than at other companies because we are surrounded by counting problems, probability problems, and other Discrete Math 101 situations. ○ Spend some time before the interview on the essentials of combinatorics and probability. You should be familiar with n-choose-k problems and their ilk – the more the better.
● System Design: ○ You should be able to take a big problem, decompose it into its basic subproblems, and talk about the pros and cons of different approaches to solving those subproblems as they relate to the original goal. ○ Google solves a lot of big problems; here are some explanations of how we solved a few to get your wheels turning. ■ Online Resources: Research at Google: Distributed Systems and Parallel Computing ■ Google File System ■ Google Bigtable ■ Google MapReduce
● Development Practices and Open-Ended Discussion: ○ Sample topics include validating designs, testing whiteboard code, preventing bugs, code maintainability and readability, refactor/review sample code. ○ Sample topics: biggest challenges faced, best/worst designs seen, performance analysis and optimization, testing and ideas for improving existing products.

ralphc1 reply#
Once you get into a FAANG company, do you actually use these algorithms? OOP/FP design, "clean code", the System design I would see as important, but in an actual dev job how much does the hard-core algorithm stuff come up?
bakuninsbart#
Big O is always extremely relevant. - A lot of the typical algorithms in djikstra, merge sort etc. are not important to know by heart, but they represent important concepts to know to solve complex problems. Divide and Conquer and Greedy or topics that come up implicitly at least once a week, usually more often.

Continue this thread — 1 more reply