






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
Coding is a special form of interviewing, and has certain standards, ... “Cracking the Coding Interview” can also be found on line (PDF version).
Typology: Exams
1 / 12
This page cannot be seen from the preview
Don't miss anything!
This presentation is for technical majors seeking technical degrees. Other fields? Hiring practices differ, so the content and format may differ from the advice in this presentation.
2
These are the goals for any interview. Coding is a special form of interviewing, and has certain standards, expectations, and protocol.
Note that confidence is important: confident people find ways to complete work and solve problems, even when they lack competence. They find ways to close gaps by using resources, such as peers and other sources of information. Applicants who do not appear confident raise doubts about their ability to succeed in the workplace.
Competence: is judged on resume items, and is the primary focus of the coding interview. Note, the competence for coding interviews is as much about SOLVING PROBLEMS as it is CODE ABILITY.
Enthusiasm: are you interested? I don’t want to go through the work of offering you the job if you are not interested. How do you show that? By indicating that you have taken some time to investigate the organization, the industry, … and that you have determined how your experience/expertise can fit into what work we have / problems we solve /.
Like and trust? Who wants to work with disagreeable co-workers? Not me either. Trust? Untrustworthy co-workers create work for managers and everyone else. This is the reason that errors or discrepancies on your resume will usually disqualify you for a position.
3
For the coding interview, we are going to cover these items: basic what-and-how-to items, a sample of coding exercises, and how to learn more.
4
How does this work? You will be on line (using an on line document that you share with the interviewer) or in an interview room with an interviewer (using a laptop or a whiteboard). They will give you a problem to solve.
Why are all these details important? Remember: confident – competent - …? It’s hard to be confident if you do not have all the mechanics of the interview in your favor. Board marker is dry or yucky color or --? This will take time out of your interview to resolve. Wiped the board with your hand? Oops, got marker dust all over your hand? Not the way to be confident.
efficiency?
5
Here’s what you do: Build your ”APPS”!
We are going to cover 4 points on the basics, and then we will use examples to illustrate.
Ask: Ask questions about the issue. This is a problem-solving exercise. You must be sure that you understand the problem and any boundary conditions, limitations, and requirements Plan: Explain your plan of attack. You want to solve the problem the simplest way. Brute force is ok. Program: State all assumptions as you go and describe what you are doing. Show: Discuss what you might do for a better result, if you have another option.
And be prepared for the interviewer to ask you some questions that make the problem different. For example, if the data set was 10x larger: how would the solution you proposed (when the assumption for the data was smaller) work?
Note: you are not assigned extra credit for solving the problem faster. Speed is not the criteria for this exercise. Take your time, be thorough, and be clear with the communication of the problem and the solution you have.
6
1. Develop a program to test if two words are anagrams. Student should ask about desired arguments and output (input strings, output Boolean). Student should ask about case, numbers, whitespace, etc. Solutions: Easy solution: Sort both strings and do a character by character comparison. Depending on the sorting algorithm, the best time complexity through this method is O (n log n)
Intermediate solution: Map each of the 26 English characters to a unique prime number. Then calculate the product of the string. By the fundamental theorem of arithmetic, 2 strings are anagrams if and only if their products are the same. O(n)
2. Given a linked list of unknown length, write an algorithm that returns the n to last element. Student should ask about desired arguments and output (input linked list and integer, output linked list node) Solutions: Easy solution: Iterate over linked list to find the length. Perform a second iteration (length – n) and return the node. Traverses the linked list twice Intermediate solution: Use two iterators (fast and slow). Iterate over the linked list and only increment the fast iterator till it is on node n. Then, start iterating over both iterators till the fast iterator gets to the last node. The slow iterator should be at node
7
“Cracking the Coding Interview” can also be found on line (PDF version). Tell students to read the first part of the book, not just the problems ;). The material in the first part of the book contains excellent advice for the broad subject of “interviewing” in general. https://epiportal.com/Ebooks/Cracking%20the%20Coding%20Interview%2C%204%20Edition% 0-%20150%20Programming%20Interview%20Questions%20and%20Solutions.pdf
Websites: Direct students to Codecademy, LeetCode, HackerRank, and any others you might be aware of.
Company websites:
8
Remind students to always review information on the company website. Probably a good idea to review sites of other companies as well.