Ask HN: How can I prepare for a coding interview in a week?

By mattdue - 2 days ago

Showing first level comment(s)

Truthfully, you don't have enough time. There are so many candidates who basically eat and breathe Data Structure and Algorithm for at least few months so that they can get into big five that your last one week preparation might not match up to them, especially without any prior experience like a course. I don't want to demoralize you, but how about you tell them that you aren't prepared right now, and would like to interview after 4-5 months. I think these companies are always looking for good talent, and don't mind interviewing someone later if they find the profile interesting.

shankr - 2 days ago

I'm in a similar situation RN, and this is my battle plan:

๐——๐—ฎ๐˜† 01

* Backtracking - know how to solve 1 problem (Knight's tour)

* Tree - implement BST

* Tree traversal - implement DFS, BFS & DFS iterative

๐——๐—ฎ๐˜† 02

* Quicksort - know how to implement

* Mergesort - know how to implement

* Binary search - know how to implement

* Min/Max Heap (priority queue) - know how to implement

๐——๐—ฎ๐˜† 03

* Graph - implement adjacency list

* Graph traversal - implement DFS, BFS & DFS iterative

* Graph algo - implement "Prim Minimum Spanning Tree"

* Graph algo - Implement "Detect Cycles algo"

๐——๐—ฎ๐˜† 04

* Graph algo - Implement "Detect Connected Components" algo

* Graph algo - Implement "Lowest Common Ancestor" algo

* Graph algo - Implement Djikstra single shortest path algo

๐——๐—ฎ๐˜† 05

* Sets - Determine all subsets of a set

* Sets - Determine Maximum consecutive subarray sum

* Sets - Determine 2 sets intersection

๐——๐—ฎ๐˜† 06

* String - Implement Levensthein Edit distance

* String - Implement Polynomial Hash

* String - Determine all substrings

* String - Find anagrams

๐——๐—ฎ๐˜† 07

* String - Implement KNP algorithm for pattern matching

* Basic DS - Implement Queue, Stack, Dynamic array, Linked list absolutely cold

----

I chose javascript as the language for all this brushing up (no need to manage memory, and I can focus on the algo)

It's a big list, but it's a traversal of the CS engineering domain that makes sense to me, and it's only a fraction of the expected knowledge for that kind of interview.

----

Edit: I pushed some of the code of this list on GH here: https://github.com/netgusto/brushup

I struggle to implement each concept in the smallest, simplest way possible. I'll keep adding code as I write it.

netgusto - 2 days ago

I'm doing a lot of interviewing at a big five company, but speaking personally and unofficially - when it comes to code, I'm looking for fluency more than anything else. At the phone screen level (which I assume is where you're at), the questions I ask are in the same complexity ballpark as fizzbuzz (ie the task will be fully specified in 5 sentences and assumes no prior knowledge), and I expect a candidate to be able to implement that without having to google for "how do I access an array element in <language that the candidate has freely chosen and claims to have mastered>?". The bar for on-site interviews is somewhat higher, but for the first round of interviews, just "do they struggle with basic syntax" is enough to filter out a remarkably large number of people...

Also (again personal opinion) - python is the most practical language for doing interview questions, because interviews are heavily time-constrained and python allows the developer to go from idea to implementation in the shortest amount of time. I'm not going to penalize anyone for their language choice, but somebody who completes the task in 5 minutes and then spends 25 minutes getting bonus points for things like "what if the input data is larger than RAM?" is going to come across stronger than someone who spends 30 minutes on parsing the input and runs out of time before they get to the algorithm.

Shish2k - 2 days ago

I was in this exact position a month ago and I landed a great job because of doing very well in two technical interviews. I also am a strong Python programmer who was rusty on the classic CS stuff. Go to Codility's programming lessons page:

https://app.codility.com/programmers/lessons/1-iterations/

and try to do at least two exercises from each lesson up to lesson 15 if you can. The open reading material at the top of each section is excellent and discusses all the CS theory you will need.

Good luck!

baruchthescribe - 2 days ago

Read chapters 2-5 of Skienaโ€™s book, then do leetcode eight hours a day until your interview. Start with high-pass-rate mediums, then work your way up, and try to solve some hards. Spend about half an hour on each problem, and if you canโ€™t think of an answer, look at the solution, reimplement it, and think hard about the underlying concepts.

This will not guarantee you a pass โ€” honestly, some people spend months preparing for the big 5 interviews โ€” but it may give you a fighting chance, and either way it will give you a good foundation for future interviews.

badatshipping - 2 days ago

I'm surprised nobody mentioned LeetCode. You can start solving 100 most popular interview questions (sort them by difficulty first):

https://leetcode.com/problemset/top-100-liked-questions/

If you've never took any algorithm course and have only a week for preparation, it would be very difficult to prepare for coding interview. But I think you can at least finish all easy problems from this list. In this case, you may at least pass screening coding interview.

Right now, I'm very actively interviewing with pretty selective high-frequency trading companies. I can say that LeetCode has pretty relevant set of interview problems.

One more thing. Even if you solved a problem, always look at description of solution, if there is no description of solution, you should look at discussion.

From there, you can find references to common algorithms/themes like binary search etc.

hal9000xp - 2 days ago

You aren't going to gain the skills gained by a four year education in a week. And if you try it will likely be obvious. Interviewers (at least the good ones) aren't looking for someone who knows a particular algorithm by memory, they are looking for someone who is familiar with the concepts. And familiarity is easy to distinguish from rote memorization.

The good news though is that unless you lied on your resume, they already know that and are still interested in you. So you likely have other characteristics they are interested in.

I would concentrate instead on learning about the company you are interested in. That's something you can do in the course of a week.

nwbrown - 2 days ago

Ask your recruiter what the test contains and how it relates to the position they are interested in hiring you for, and then just strait up tell them, that you are not strong in algorithms and data structures, but you are strong in ECE and machine learning, and they should hire you for those things.

wodenokoto - 2 days ago

You could try reading/skimming over the book "Cracking the code interview" to get some insight in how the company handles interviews. The big five are in there so you'd get more information that way. Besides that, a week should be okay if you study hard and got good resources.

Improvotter - 2 days ago

Man, I've never studied for an interview...

I turn up on the day, but then these interviews asking difficult algorithm question seem to be a rarity in the UK, thankfully.

Our interview process seems to be much more reasonable.

LandR - 2 days ago