Workshop for EECS 281. 27 June 2017.

  • The interview process (and recruiting in general) can be quite stressful. The goal of this workshop is to help you prepare for job interviews, so that you know what to expect, how to practice and what to do during an interview.

  • These notes are a collection from what I have heard from other people and have read online. What is described here is not representative of all companies or of any single company. Companies may have their own distinct recruiting processes and interview styles which may or may not be reflected here.

Choosing companies

  • The interview process can be quite time-consuming and you cannot apply to all the companies in the world. So even before you start interviewing, you will have to consider which companies you would like to work at.

  • What are you looking for from an internship?

    What you’re looking for out of internships might be different from what others are looking for!

    It’s important to ask yourself this question, as it will probably come up during the interview itself!

    • Make an impact

    • Ship a product

    • Learn something new

    • Live in a specific location

    • Make money

  • Would you be excited to work on the product?

    • You will have to wake up every morning to go to work on the product.

    • This will probably come up during the interview.

      • “What do you think about the product?”

      • “How can it be improved?”

      • “Where do you see the product going in 3-5 years?”

    • Use the product!

  • Would you be excited to work with the people?

    • Good thing to ask at the end (e.g., "Do you have any questions?")

      • Bad to ask: “How many people work at the company?” (It’s probably on the company’s website.)

      • Better to ask: “Tell me about the culture.” (Shows that you are genuinely interested in the company.)

    • Ask to talk to people at the company once you receive an offer.

  • Do the things you value align with what the company values?

    • Learn about the company’s vision.

    • Company’s mission is most likely available on the website.

    • How have the company’s believes affected its product decisions?

    • You might not be excited to work at a company if its believes don’t align with yours.

  • How big is the company?

    • You will probably get out different things depending on the size of the company.

    • Consider interning at a small company one summer and at a larger company the next summer.

  • Does the company have programs targeted to you?

    • Some companies have specific programs for freshmen and sophomores. Others only hire juniors. And others specifically look for full-time candidates.

    • Don’t let that discourage you from talking to recruiters and applying, however!

  • Join the company you think will fit you best—​irrespectively of what others tell you.

Recruiting

  • There are several ways to start talking to companies:

    • Apply online.

    • Attend recruiting events, including career fairs, company-specific events and hackathons.

    • Reach out and meet recruiters via LinkedIn and/or email. Keep your messages short and to the point.

    • If you have a friend who is working at a company where you’d also like to work, chat with them about their experience and ask them if they can submit a referral.

  • Some companies start with an online coding challenge.

  • Some will have an on-campus interview.

  • You will most definitely have phone interviews.

  • Some companies will have an on-site portion.

    • Company pays for flights, hotel, etc.

    • Several interviews.

    • Meet with engineers and others on the team (design, PM, etc.). Be prepared to meet with people who are not engineers.

  • Offer stage.

  • Have a spreadsheet to keep track of recruiting process at different companies, along with stages, positions and emails of recruiters and hiring managers.

Résumé

  • Not very important important relative to other things, but an opportunity for you to make a first impression.

  • Recruiters spend very little time looking at each résumé.

  • The first chance to sell yourself.

  • Recommendations

    • One page

    • Make easy to read and to skim

      • Where have you worked?

      • What have you built?

      • Make your graduation date clear. Many recruiters look for this first.

    • Make contact information easy to find (and correct!).

    • Highlight specific accomplishments.

      • Bad: worked on Project X.

      • Better: worked on Project X and increased Y (or optimized Z).

    • Include interesting projects.

      • Better to include personal projects than course projects.

      • Emphasize what it does and why it’s important.

    • Don’t put charts, ratings or starts (e.g,. “4/5 stars on teamwork”).

    • Everyone knows that references are available upon request.

    • Include link to website, professional-looking email address, LinkedIn, GitHub, etc. Make them links in the PDF!

    • Use reverse-chronological ordering.

    • Put only relevant information.

  • Critique examples found on Google and on Facebook.

  • Have multiple versions of your résumé, one for each company and category of role that you are applying for.

    • Highlight specific projects and skills.

    • In applicable, state what you would like to work on specifically in your objective.

  • Don’t forget to proofread your résumé!

Projects

  • Everyone goes through the same courses and does the projects. Personal projects make you stand out from others!

  • Create a personal website and buy a memorable, easy-to-type and easy-to-remember domain name.

Interviews

  • Start interviewing as early as you can. Common to start late summer or early fall.

  • Plan interviewing into your semester schedule. It takes a lot of time!

  • Every interview is a conversation, not a test!

  • Take control of the interview

  • Don’t let the room be silent for longer than a few seconds!

Types of Interviews

  • Common types of interviews:

    • Technical

      • Algorithms

      • Coding

      • System design

      • Knowledge-based

    • Non-technical

      • Behavioral

      • Culture

  • An interview can be purely technical or non-technical. Or a combination thereof.

Technical Interviews

  • Know algorithms and data structures.

  • Know programming languages, UNIX and terminal, best practices (e.g,. debugging and git) and tools (e.g., Xcode).

  • Know things specific to role for which you are applying.

Algorithms

  • Most common.

  • Getting an algorithm right is much more important.

  • Optimize for time and space complexity.

  • OK strategy to start with a simple, naïve solution and then optimize. Much better to have something written than nothing at all!

  • If the solution seems too complicated, it probably is.

  • Common types of problems:

    • Strings

    • Recursion

    • Sorting

    • Searching

    • Dynamic Programming

    • Graphs, Trees

    • Math

  • Tools for solving problems:

    • Arrays and linked lists.

    • Hash tables and dictionaries.

    • Built-in string manipulation functions.

    • Memoization for dynamic programming.

    • Algorithms from EECS 281.

Coding

  • Implementation can be complex.

  • Remember to decompose the problem.

  • Create helper functions.

  • Make the code simple.

  • Be familiar with the language.

Knowledge-Based

  • Could be random or could come from your résumé and from your answers to questions earlier in the interview.

  • Sample questions:

    • What is AJAX?

    • What is polymorphism?

    • How to find a file using Terminal?

    • How to count the number of common lines in two files using Terminal?

Systems Design

  • Technical design

    • How would you architect Canvas?

  • Product design

    • What feature is missing from Canvas?

  • Very open-ended!

  • Understand constraints of the system.

  • State assumption (e.g., “I assume you mean the mobile app”).

  • Think about the consequences of each decision you make.

  • Challenge your own ideas—​when do they break?

  • Think about future and scalability.

Non-Technical Interviews

  • Just as important as technical ones!

  • Could include questions about your experience.

    • How comfortable are you with Linux?

    • Describe the most significant project you have worked on.

  • Could also be about how well you fit the company.

    • What do you want to do?

    • What is your work style?

    • What are your career goals?

  • Some of the more difficult questions:

    • Why should we hire you?

    • Why do you want to work for this company?

  • Unlikely, but also be prepared to answer questions that might put you under pressure:

    • Why are you looking to change jobs?

    • What salary are you expecting?

    • What is your salary history?

Culture

  • How do your values align with the company’s values?

  • How well do you understand the company’s values?

  • Company’s history and division-making process:

    • Why do you think the company did X and Y, but not Z?

  • Your own experiences:

    • What challenges did you face?

    • What drove your decision-making?

    • What would you have done differently?

  • Looking forward:

    • Why this company?

      • Bad response: “This is cool.”

      • Bad response: “I have a friend here.`”

    • What do you want to work on?

    • What are your short-term and long-term goals?

    • How does this internship fit your plans?

    • What parts of culture are important to you?

  • Tips:

    • Take some time to reflect.

    • Avoid being negative about your past experiences.

    • Don’t break the non-disclosure agreements from your past internships, but be very clear about this to your past interviewer.

Preparing for Interviews

  • Just like preparing for an exam, there are long-term and short-term strategy you can use to prepare for interviews. Read these recommendations and adapt them to your own lifestyle and schedule!

Long-term

  • Have a plan!

  • Spend time coding and preparing for interviews. Solve at least one problem per day.

  • Do more interviews.

    • Interview with as many company’s as you can to get more practice.

    • Don’t let your top-choice company be your first interview.

  • Do practice interviews with friends.

    • Ask friends for feedback!

    • Record yourself, so you can watch and critique yourself later.

  • Practice a wide variety of problems.

    • Find practice questions online and in books.

    • Know a variety of algorithms.

    • Know a variety of data structures.

      • Which ones to use?

      • When to use?

      • Why to use?

    • It’s great when you can say to yourself: “I can think of three ways to do this. Now I just have to choose the best one.”

    • Think about which approaches are similar.

Short-term

  • As the interview is getting closer, be sure to review the basics (including EECS 281 topics). Remember how to do things like…​

    • Define a class.

    • Insert into and removing from a linked list.

    • Traverse a tree.

    • Sort an array.

    • Use a hash table.

  • Also be sure to review the language that you decide to use (or language that you know you’ll have to use), including its standard library.

  • Right before the interview, you might want to relax and not think of any of the above topics, which is great! Avoid being stressed. But do set aside at least 30 minutes on the day of the interview to do some last-minute review, to go through a practice problem and to get in the zone.

  • Talking out loud as you are coding might also feel unnatural, so be sure to practice that as well!

Going into an Interview

  • You can never overdress.

  • Don’t be on time. Arrive early!

  • Be prepared to write code on a computer or on a whiteboard.

    • Practice typing.

    • Practice handwriting!

    • Know how to use well whiteboard space.

  • Don’t be afraid to lead the conversation.

  • Use good English. Avoid slang, words such as “like”, “uhmmm”, etc.

  • Maintain eye contact.

  • Answer the questions. Do so concisely, but don’t make your responses too brief.

  • Make yourself memorable (in a good way).

  • During the introduction, try to get to know the interviewer and ask what do they care about, what kind of person are they looking for. But keep the introduction short.

  • Why are there interviews on algorithms and coding?

    • This is a shared toolbox that everyone has after college, so it’s easier to ask than asking someone who has ten years of iOS development experience about iOS development.

    • You are not expected to be an algorithms guru on the job.

    • Knowing this will hopefully help you approach the interview the right way.

  • Expect at least one coding problem focused on data structures and algorithms. You will need to:

    • Explain your approach and its correctness.

    • Analyze time and space complexity of your solution.

    • Write clean code in an editor or on a whiteboard (usually in the language of your choice).

    • Test your code and improve it.

  • When given a problem statement, make sure you understand the problem.

    • Don’t make any assumptions.

    • When in doubt, ask if you are allowed to assume something, but do state your assumptions.

    • Ask clarifying questions. It’s better to ask than to work on something for 15 minutes and then realizing that you were solving the wrong problem.

    • Verify that you and the interviewer agree on how the solution should work on some input.

  • Always tell your interviewer if you’ve seen the problem before!

  • Start by brainstorming approaches to the solution.

    • Your thought process is often more important than your output

    • Talking through multiple approaches will help you make you that you don’t dive into the first thing that comes to your mind.

    • Draw diagrams or run through test cases.

    • At a high level, explain your chosen approach and reasoning.

    • Convince your interviewer this will work (efficiently). You can…​

      • Test verbally.

      • Test on computer.

      • Prove using induction.

  • Explain your solution before writing code.

  • Communicate your progress clearly and out loud.

  • Code quality matters.

    • Code should be understandable, not just correct.

    • Break up your logic into helper functions where appropriate.

    • Don’t name your variables foo, bar and baz or x, y and z.

    • If using a whiteboard, tell your interviewer explicitly the reason why you are using shorter variable names (such as ans instead of answer): longer variable names will make writing code slower.

    • Over-communicating is better than under-communicating.

  • Imagine that you and the interviewer are on the same team. The interviewer is there to help you, not to mess up your solution.

  • Break your code into helper functions and test them

  • Debugging techniques for coding on a computer and on paper.

  • Pay attention to as many hints as you can!

  • If you get stuck, start thinking out loud. Avoid long silences!

After the Interview

  • Always have questions prepared at the end of the interview.

    • Use this as a way to make sure the company and the role are right for you.

    • Ask about the culture, the people, what you would be working on, etc.

  • Follow-up with an email and thank the interviewer and recruiter for the opportunity!

  • Remember that a single interview does not tell much about who you are or about your ability as an interviewer or even as a software engineer.

  • If an interview does not go well, don’t be hard on yourself and don’t be discouraged. Think of this as interview practice for next time!

Resources

Sample Questions

Data Structures

Reverse a Linked List

Given a pointer to the first node of a singly linked list, write a function to reverse the linked list. Do this recursively and iteratively. What is the space and time complexity of each implementation? Which way is better, and why?

Cycle in a Linked List

Given a pointer to the first node of a single linked list, detect if there exists a cycle in the linked list. What is the time complexity of your implementation?

Binary Search Tree

Given a binary tree, determine if the binary tree is a binary search tree.

Queue Using Stacks

Implement a queue using stacks.

Stack Using Queues

Implement a stack using queues.

Shuffle Array

Implement a function that shuffles elements in an array of n integers, such that n! permutations of the n integers are equally likely. You may assume that you have rand() function available to you.

Most Frequent

Find the most frequent integer in an array.

Rotated Search

Implement a function that finds an integer k in an array of size n that has been sorted and then rotated, such as [5, 6, 7, 8, 1, 2, 3].

Merging

Given k sorted lists, each of length n, provide an algorithm to merge the k sorted lists into a single list of length k * n. What data structure might you want to use? What is the time complexity of your solution?

Strings

Reverse

Implement a function that reverses the characters in a string.

Palindrome

Implement a function that checks if a string is a palindrome

Anagrams

Implement a function that checks if two strings are anagrams of each other.

Substring

Implement a function that checks if s1 is a substring of s2.

Unique Characters

Implement a function that checks if all characters in a string are unique.

stoi

Implement a function that when given a string, returns the numeric value of this string. For example, stoi("183") == 283, stoi("-281") == -281. You may assume that the string contains only numeric characters and possibly a leading negative sign.

Bitwise Operators

Powers of 2

Write a function that determines if a positive integer n is a power of 2.

Counting Bits

Given a 32-bit unsigned integer n, write a function to return the number of one-bits in the binary representation of n.

Division

Implement integer division without using multiplication or repeated subtraction (i.e. to divide n by d, you may not repeatedly subtract d from n).

Absolute Value

Without using subtraction, write a function that computes the absolute value of two integers x and y.

Greedy, Divide-and-Conquer and Dynamic Programming

Fibonacci in Binary

Given an integer n, what is the nth Fibonacci number in binary?

Powers

Write a function that when given non-negative integers n and m, returns n^m.

U.S. Change

Given an amount n in cents, determine the minimum number of coins needed to make change for n in U.S. currency (1,5,10,25 cents).

Arbitrary Change

Given an amount n in cents, and a currency system with m different coins valued at c_1, c_2, c_3, …​, c_m cents, determine the minimum number of coins needed to make change for n in this currency system.

Maximal Subarray

Given an array of n integeres (positive and negative), find the maximum sum of contiguous elements in a contiguous subarray of the input array. For example:

1, 2, 3, 4 → 1 + 2 + 3 + 4 = 10

2, 3, -1, 3 → 2 + 3 = 5

-1, -2, -3, -4 → 0

empty → 0

1, 7, -5, 10 → 1 + 7 - 5 + 10 = 13

Stocks

Given an array of n integers representing the price of a stock over the course of n days, determine the maximum profit you can make if you can buy and sell exactly 1 stock over these n days.

Miscellaneous

Count Numbers

Implement a function that takes two integers, n and k, and counts how many times the digit k appears in n. Assume that 0 ≤ k ≤ 9.

Dutch Flag Problem

Given an array of n integers and two numbers low and high, partition the array in place such that all entries < low appear in the array first (in any order), followed by low (if in the array), followed by all entries x such that low < x < high, followed by high (if in the array), followed by all entries > high.

Two-Sum

Given an array arr of n integers and a target integer t, return true if there exists 0 ≤ i < j < n such that arr[i] + arr[j] = t, otherwise return false.

Three-Sum

Given an array arr of n integers and a target integer t, return true if there exists 0 ≤ i < j < k < n such that arr[i] + arr[j] + arr[l] = t, otherwise return false.

Debugging

Describe a good strategy to find a bug in a program.

32 vs. 64

What’s the difference between a 32-bit application and a 64-bit application? Which one is faster?