How to pass a technical interview for a fresh Software Engineering role?

Today two guys asked me about how to pass an interview for a Software Engineering position (as I was offered SE jobs from Palantir and Google, and failed at tons of others). My answer was simple: think hard of a good solution and speak out loud what you are thinking, try to code without bugs, know how to test it and know what you are talking about, especially different data structures.

What I mean by “know” is that you should be able to explain the concept in a simple way and to answer most of the questions related to the concept.

To give an example, in an interview question, you can be asked: “Given a stream of sales: (item_id, number_of_items), how would you recommend a top N best-selling items”. Then be prepared to expect the conversation to be like:

Possible Question: how do you solve the problem?
Possible Answer: I use a max heap to remain the order of items with most sales. For any query, I return the top N items out of the heap. It takes O(NlgK) where K is the number of items in the heap.
Possible Question: How do you update the heap when a new tuple is received?
Possible Answer: For each tuple received from the stream, I update the counter of item_id in the heap, it takes O(lgK).
Possible Question: How do you know which node in the heap to update?
Possible Answer: In order to know which node to update in the heap, I use a hashmap item_id->node_id to keep track of where the item is located in the heap.
Possible Question: How does a hashmap work?
Possbile Answer: It keeps a list of linked list of (key, value). For lookup/modification, it uses the hash function of the key to locate the linked link, then iterates through the linked list to search for the key or add the new item to the linked list.
Possible Question: Implement a hashmap?
Possible Answer:
class HashMap(object):
def put(k, v):
….
def get(k):
….
Possible Question: How to remain O(1) for get/put?
Possible Answer: Keep the hash function of the key to be uniformly distributed.
Possible Question: What happens when the number of items is larger than the size of the list.
Possible Answer: I double the size of the list. Then, redistribute the items to the new list based on the hash(key) % list.size
Possible Question: How do you design the hash function?
Possible Answer: Do s.t like this: f(x)=(((31+x.t1)31+x.t2)31+x.t3) as suggested in Effective Java by Joshua Bloch.
Possible Question: Why do you choose 31?
Possible Answer: Because 31 is prime
Possible Question: Why do you choose a prime number?
Possible Answer: Assuming k=abf(x)=(((ab+t1)ab+t2)ab+t3)f(x)=(((abab+t1ab+t2)ab+t3)=(((ababab+t1abab+t2ab+t3)).    Then, (t1=a,t3=abab)  collides with (t1=1,t3=aabab). Hence, the less factors k has, the less collisions can happen.
Finally, interviewer will possibly say “cool”. Other possible questions include “how does the heap work?”, “implement a heap”, “what if I want top N-items in only last week”, “how to get top N from the heap in O(NlgN)”, “how does arraylist work?”, “implement LRU”,…

Make sure you know when interviewing for a grad level role:
  • Data structures: array, vector, trees, queue, stack, heap, hashmap, treemap.
  • Algorithms: sorts, recursive programming, dynamic programming, string matching, basic Graph algorithms (BFS, DFS, Dijkstra).
  • Concurrency: forking, deadlock, mutex, semaphore, Map/Combiner/Reduce.
  • Memory allocation and garbage collection.
  • Sql, database transaction and different isolation levels.
  • Bit operations: |, &, ^, <<, >>.
  • How disk works (seek, read, write).
  • Maintainability: different design patterns, git/svn, service-oriented architecture.
  • Scalability: load balancers, cache, proxy, index, shards, queue, replication.
  • Availability: share-nothing architecture (so SPOF), eventual consistency, RAIDs.
  • Consistency: vector clock, CAP theorem, FLP theorem, different levels of consistency, 2 phase, 3 phase commit, names of some concensus algorithms, consistent hashing, gossip protocols.
  • Basic concrete maths and probability.
  • Zen of Python (my bonus ;)).
Places to practice: Leetcode, Careercup, Glassdoor. Topcoder and Codeforces for more advanced algorithms.

Apart from technical performance, make sure you are polite, humble, and clear. Despite all of these effort, you still may fail for some unknown reasons. Not all interviewers are looking for the same thing or there will be other people who can do better than you. Just try your best and move on.

41 comments :

Amirtha rao said...

Nice post! I always preferred blogger to get ideas, because its provides more information over the books & here I gathered more precious skill from the professional, thanks for taking your to discussing this topic.
Regards,
Best JAVA Training in Chennai|JAVA Training

Priya R said...

Excellent post!!!. The strategy you have posted on this technology helped me to get into the next level and had lot of information in it.
cloud computing training in chennai | cloud computing courses in chennai

vensika said...

Great blog with useful information. Thanks for sharing such a nice blog. Kindly keep updating like this article. Software Testing Training in Chennai | Selenium Training in Chennai

Deshma Teja said...

Good post. I had read your blog, it's very nice and informative content.. Web Designing Training Institute in Chennai | Web Designing Training Institute in Velachery.

Siva Seo said...

Good post..Keep Sharing.! I'm working in brave technologies private limited.

Mehgna Sharma said...

Nice post Thanks for the Sharing this information Big Data Hadoop Training | PHP Training in Noida

prabash said...

Awesome blog., Java Training in Chennai | Dot Net Training in Chennai

rupesh rupi said...

Wonderful blog. I will gained more information from your post..Selenium Training Institute in Chennai | Selenium Training Institute in Velachery.

praveen said...

Nice Blog..Thanks for sharing..


Linux Training in Chennai | No.1 Linux Training Institute in Chennai | Red Hat Linux Training in Chennai | Online Linux Training in Chennai

revathi said...

Excellent post. I have read your blog it's very interesting and informative.Java Training Institute in Chennai | Java Training Institute in Velachery.

Webtrackker Sohit said...

Sas Training Institute in Noida-Webtrackker is the best sas training institute in noida. SAS has taken the lead role for a long time, where most companies have standard software. While you have this certification under your belt, give big rewards to the IT industry, it can also serve as an important payer on the business side of the economy. SAS can read data files created by other statistical packages. Therefore, for experienced users of these statistical packages, SAS does not threaten to create data files created by these packages in a SAS file format.
Sap Training Institute in Noida
PHP Training Institute in Noida
Hadoop Training Institute in Noida
Oracle Training Institute in Noida
Linux Training Institute in Noida
Dot net Training Institute in Noida
Salesforce training institute in noida
Java training institute in noida

ASO Services said...

Good post and I like it very much. By the way, anybody try this increase app downloads? I do not how to use.

dushyant sharma said...

Webtrackker Indirapuram offers an inclusive software testing training in Indirapuram. The extensive practical training provided by the Software Testing training institute in Indirapuram, equips live projects and simulations. Such a detailed course in Software Testing has helped our students to obtain work in several multinationals. The Webtrackker trainers are subject to specialized corporate professionals who offer an in-depth study in the Software Testing course in Indirapuram.
software testing institute in Indirapuram

dushyant sharma said...

Webtrackker Indirapuram offers an inclusive software testing training in Indirapuram. The extensive practical training provided by the Software Testing training institute in Indirapuram, equips live projects and simulations. Such a detailed course in Software Testing has helped our students to obtain work in several multinationals. The Webtrackker trainers are subject to specialized corporate professionals who offer an in-depth study in the Software Testing course in Indirapuram.
software testing institute in Indirapuram

aashutosh webtrackker said...


Aws online training in india
Aws online training in india – Webtrackker is the best AWS stands for Amazon Web Services, the name given to the cloud computing facilities of the Amazon group. It has a comprehensive training program based on solutions that should be known to those who aspire to develop their skills in cloud computing. Applicants can receive a high quality AWS training experience from experts from reputable training institutes. Many different skills are taught to applicants in AWS. Candidates are exposed to the main functionalities of the main Webtrackker is the best AWS services in India, key concepts, applications, security and architectural patterns. Industry experts allow candidates to work on best practices in AWS. The knowledge of the concepts in a practical environment helps the aspirants to use practical exercises during the training.
Aws online training in india

aashutosh webtrackker said...

Webtrackker is the best Salesforce online training in india, Do not assume that all sales employees have understood how the training should be applied. Sales training is largely generic. There may be a gap between knowing how to apply a principle. You want to make sure you close that gap. If necessary, take a new language. If the training requires a new language or terms that you have not used before, adjust the new terms as part of your sales vocabulary. This will help strengthen the training. Webtrackker is the best training in India Do not conduct sales training that is not in line with your sales philosophy. Before investing in a sales training program, make sure the curriculum matches your sales philosophy. For example, if you use a strategic sales process, do not send your salespeople to training that focuses primarily on tactics and not strategies. Keep the goals of the sales team members that you want to achieve with the salesforce training before the salesforce training begins. Knowing what you want to stop training before you start training is very valuable.

Salesforce online training in india

Sunil Dubey said...

SAS training institute in noida
php training institute in noida
linux training institute in noida
cloud Computing Training in Noida
hadoop training institute in noida

Adlina Jessi said...

Thank you for taking the time to provide us with your valuable information.Android Training Institute in Chennai | IOS Training Institute in Chennai | Core Java Training Institute in Chennai

Sunil Dubey said...

SAS training institute in noida
php training institute in noida
linux training institute in noida
cloud Computing Training in Noida
hadoop training institute in noida
Python R Training Institute in Noida

kri pav said...

I am reading your post from the beginning, it was so interesting to read & I feel thanks to you for posting such a good blog, keep updates regularly. 
No.1 Software Testing Training Institute in Chennai | Best Selenium Training Institute in Chennai | ISTQB Certification Center in Velachery

Sunil Dubey said...

SAS training institute in noida
php training institute in noida
linux training institute in noida
cloud Computing Training in Noida
hadoop training institute in noida
Python R Training Institute in Noida

Sunil Dubey said...

SAS training institute in noida
php training institute in noida
linux training institute in noida
cloud Computing Training in Noida
hadoop training institute in noida
Python R Training Institute in Noida

aashutoshtiwari said...

Oracle DBA online training in India

dushyant sharma said...

NEW YEAR OFFERS 2018

Flipkart New Year Offers on Mobile Phones


Ebay New Year Offers On Mobile Phones

Inigo joseph said...

Needed to compose you a very little word to thank you yet again regarding the nice suggestions you’ve contributed here.
software testing training in chennai

dushyant sharma said...

SEO Company In Cape Town

SEO company in Durban

SEO Company in india
SEO company in Johannesburg

dushyant sharma said...

Seo company in zimbabwe

Seo company in washington

Seo company in wakefield

Seo company in virginia

Seo company in usa

deepti said...

Wow..Nice post to updating...I have learn so many things from your blog...Diploma Projects Center in Chennai | Diploma Projects Center in Velachery

srihariparu said...

Great and nice one... thanks for sharing your information... keep updating and rocks...
Best Mat Lab Project Center in Chennai | IEEE Mat Lab Projects in Velachery

Sirkus System IT Services Pvt. Ltd. said...

Sirkus System Bangalore Reviews- Sirkus System IT Services Pvt Ltd a logo name specialized in product improvement & answers for mobile environment and other platforms Sirkus device Bangalore critiques- Quality development, dedicated work approach and professional attitude are some of the traits which outline Sirkus Systems IT Services Pvt Ltd.

Sirkus system
sirkus system
Sirkus Systems
sirkus system review
Sirkus System
Sirkus System Reviews
Sirkus System
Sirkus System Review





















Riya karakoti said...

Java training in indirapuram- There are multiple structures and streams for developing a product or utility. When we talk of technology and programming languages, Java is the maximum desired platform. It is used to expand a whole lot of programs for the systems and embedded devices like cellular telephones, drugs, laptops, and many others.

Java training in indirapuram

Hadoop training in indirapuram

sas training in indirapuram

sap training in indirapuram

linux training in indirapuram

sap fico training in indirapuram

web design training in indirapuram

php training in indirapuram

JamesWilliam said...


Interesting post! This is really helpful for me. I like it! Thanks for sharing!
Mobile application developers in Chennai | PHP developers Chennai

Riya karakoti said...

Best Hadoop Training Institutes In Noida

best sas training institutes in noida

best sap training institutes in noida

best linux training institutes in noida

best salesforce training institutes in noida

best software testing training institutes in noida

Riya karakoti said...

best python training institutes in noida

best oracle training institutes in noida

best android training institutes in noida

best php training institutes in noida

best web design training institutes in noida

best java training institutes in noida

Riya karakoti said...

best sap mm training institutes in noida

best sap sd training institutes in noida

best sap hr training institutes in noida

best tableau training institutes in noida

best automation anywhere training institutes in noida

best rpa training institutes in noida

best blue prism training institutes in noida

best digital marketing training institutes in noida

best angularjs 5 training institutes in noida

best net training institutes in noida

Vinoth Kumar said...

PLC Training in Chennai | PLC Training Institute in Chennai | PLC Training Center in Chennai | PLC SCADA Training in Chennai | PLC SCADA DCS Training in Chennai | Best PLC Training in Chennai | Best PLC Training Institute in Chennai | PLC Training Centre in Chennai | Automation Training in Chennai | Automation Training Institute in Chennai

aashutosh webtrackker said...

Vermeer Vermeer- prints are covered in complete within this text, in which the career of famous Dutch artist Johannes Vermeer is also discussed in complete.Vermeer's profession became vast and big, but it's miles typically regular that his best art work protected the likes of Girl with a Pearl Earring,

srihariparu said...

Your blog is informative and impressive..Thanks for sharing..
Robotics Project Center in Chennai | Best Robotics Projects in Chennai | IEEE Robotics Project Center in Chennai | No.1 Robotics Project Center in Velachery

dharu dhari said...

Thanks For Your valuable posting, it was very informative..Mat Lab Projects Center in Chennai | Mat Lab Projects Center in Velachery

roja sun said...

Great article..Thanks for sharing your informative and impressive post..
No.1 Electrical Project Center in Chennai | Electrical Project Center in Velachery

sherin angel said...

Nice Blog with useful concept. I feel happy to see your informative blog, Thanks for sharing such a nice blog.
Final Year Project Center in Chennai | Final Year Project Center in Velachery