This is the presentation presented by Richard Park and myself at the University of Waterloo on January 30, 2013. These slides contain insights into interviews that we have discovered in our experience both interviewing and being interviewed.
3. Tech Industry is in Demand
Job title Software Engineer on LinkedIn this week
– 86,239 in the USA
Being in Tech you are in High Demand
Very few candidates get hired (industry average ~1%)
– Don’t take it personally, there are still 86,238 other positions
3
4. What to Expect – Interns
LinkedIn does two interviews for intern candidates
2 coding questions
– Conducted over the phone
– Hiring committee reviews the interview feedback after each
interview
– We include technical communication and soft skills assessments
during these modules
4
5. What to Expect – New College Grads
Screen by recruiter
One technical phone screen
Four types of on-site interviews
– Coding and Algorithms
– Technical Communication
– Design
– Culture fit
Expect 6-10 onsite interviews
5
6. Getting the Interview – Resume Do’s
Contact Info
No spelling or grammar errors (Especially in your name)
Pleasing to eye using bold, italics, etc
– Don’t go overboard it should still be professional
– It’s all about balance
Write your resume to the job description
– If you don’t have software experience explain how
past experience qualifies you
Put your graduation year
Be descriptive enough for previous work experience
Be relevant
6
7. Getting the Interview – Resume Do’s
Highlight projects you have done
Show that you are well rounded
Focus on experience relevant to the position
Participate in Hackathons
7
8. Getting the Interview – Resume Don’t’s
Write Paragraphs
Have more than three lines per bullet
More than 1-2 pages
Be vague
Include outdated or irrelevant information
if you have more relevant/recent
experience
8
ReSUMe
9. Resume Evaluations
How do we pick our interns?
– Work Experience
Previous employers
Relevant job experience or skills used
– Education
Marks received
Relevant courses taken
Improvement over time?
– X-factor
Totally subjective indicators
Participated in hackdays?
Side projects?
Leadership roles
– Potential
9
10. First Impressions
Actively use LinkedIn
– Tons of companies recruit actively on LinkedIn
Be respectful
Don’t be confrontational
Don’t act like it’s a waste of your time
Don’t take failure personally
– You may not be a fit today, learn and try again
– Interview processes are designed to have more false negatives
than false positives
– Most companies let you re-interview after 12 months, some 6
10
11. First Impressions
Be presentable
– Suits good, not always necessary
– Check with interviewer first.
What not to wear
– ‘engineer’ clothes (we’re slobs)
– Definitely do not bring a sword
11
12. The Interview
Know what you are interviewing for
– Will often test on specifics of the role you are applying for
Use LinkedIn
– Research companies and interviewers
– For figuring out questions interviewer may ask
Be calm
Be friendly
– Often one of the criteria being observed, if not happy interviewers
generally grade easier
Be enthusiastic about what you do
– Have a good idea about what you want to do
12
13. The Interview
Ask your interview for:
– Clarifications
– How functions work (consider them Google)
– Hints if you’re really stuck
Start with the brute force answer, and see how you can
improve it from there
Think before you start coding – have a game plan
13
14. Question Types
Interview questions generally fit in several categories:
Soft Skill Questions
– Questions not based on any concrete skills. i.e. “greatest
weakness”
Puzzle Questions
– Puzzles, tricks, riddles, etc
Design Questions
– Re-design product X or architect system
Coding and Algorithm Questions
– Coding style, algorithms, etc.
14
15. Soft Skill Questions
Common questions:
– “What is your greatest weakness?”
– “Tell me about a time that you overcame adversity?”
Good answer is a personal and honest answer that
seems like you’ve given thought to the question.
– If it’s a weakness, say how you’re correcting it
Don’t be cliché
– I’m a perfectionist
You should be prepared for these types of questions
15
16. Puzzle Questions
‘Aha’ Questions
– Worst type of questions. You either get it or you don’t.
– Don’t give up, plug away until your interviewer gives a hint or
steers you away
Open-ended No-answer Questions
– Figuring out if it’s an open-ended question can be difficult
– Keep talking, don’t fixate.
– Sometimes you need to think ridiculously
Work-through Questions
– Logically estimate
– If you’re making estimates use nice round numbers (ex. 100
instead of 77)
16
17. Puzzle Questions Examples
‘Aha’ Questions
– You have two non-uniform ropes (half the rope burnt doesn’t
mean half the time) and a bunch of matches. Each rope takes an
hour to burn, but the two ropes are not identical. How can you
measure exactly 45 minutes?
Open-ended No-Answer Questions
– You are in a maze and at the center of the maze is a trophy.
There is a tree with a rope that you can see nearby. However,
there are two angry apes that if they spot you in the maze will
throw you out, how do you get the trophy?
Work through Questions
– Estimate # of dogs in purses in North America
– Can a tower of loonies high as empire state building fit in this
room?
17
18. Re-Design Questions
“Re-design something that exists” Question
– Eg. Design an elevator, Design a coffee machine
Think about how you would use what you are designing
Design to fix issues you have with current solutions
Think about the users
Be open-minded. Think outside the box, even if a bit
ridiculous.
Think about costs and practicality
18
My failed designs for
future transportation
system
19. Architectural Design Questions
Build a system
Use box diagrams
– Services
– Components
– Interactions
Remember everything can and will fail
– Disks, machines, power, network, etc
Talk out your solution
– Interviewer is there to assess your thinking abilities, not your
ability to be quiet
Understand constraints (money, scale, practicality)
You will likely feel like you’re doing a bad job – you
probably aren’t
19
20. Coding and Algorithm Questions
The bulk of questions we ask are Coding and Algorithm
Questions
What we’re looking for
– Understanding of the problem
– Asking the right questions
– Completeness of solution
– Analytical abilities
– Communication
– Coding abilities
– Can we work with you??
Several bag of tricks can be used for different types of
questions.
20
21. Coding Languages
Language is important to some, not for others
– Should know at least one well used language
– Read the job posting, and brush up on that language
– Be honest about the programming languages you know.
– Ask the recruiter about language interview is in
C++
– Read C++ Faq Lite!
– Remember not to make a leak, leave things dangling or form diamonds
Java
– Knowing how Garbage Collection really useful
– Java 1.5+ has for-each, generics, concurrency package. Knowing them
can speed up time during interview
Everyone should know SQL
– Just know the basic syntax. Oracle, MySQL, SQLServer all have
differences.
21
22. What should I do for Coding Questions?
Think before you write
– Diagrams, pseudo-code, talk-it-out, etc
– You should know your code well when written
We expect you to find your errors quickly
Do not make uneducated guesses
Ask what functions will be given to you by the interviewer
Unsure about an API, just ask!
Write your own test cases without prompting
Know when your interviewer is trying to steer you in a
different direction
22
23. Coding Style
Use short, but descriptive names for variables
Add comments, especially on computer
Think completeness in code
– C/C++ Malloc or new? Release or delete.
– In OO, constructors (destructors?)
– Opening input stream? Close it when done
– Public/Private/Protected member accessors
Exceptions often better than return codes
Wrapping often better than inheriting
23
24. Our Bag of Tricks
Most problems are just modifications of other problems
Having a bag of common tactics and knowledge can put
you ahead.
– Many seem obvious, but surprising how many people don’t know.
Split into several categories:
– data structures
– common algorithms
– number theory
– networks
– concurrency
24
25. Data Structures You Should Know
Hashtable
– The most important data structure (besides Vectors)
– amortized O(1) insert, removal, search
– Hash the key, map key to array index
– Know different implementations of it
Double Hash
Linked
Linear Probing
– Know the limitations
Uses more memory (usually 0.75 the # entries extra)
Bad hashing function causes lots of collisions = bad
– Want lookup table? dictionary? Of course you do.
25
26. Data Structures You Should Know
26
Trees
– Remember they can be unbalanced, not always binary
LinkedList (doubly-singly)
– Useful in interviews, not so much in real life
Heap
– If you need a priority list, or top-n elements
Graph (Nodes, Edges)
– Can store as adjacency list, sets of nodes and edges, matrix
Others:
– Stacks, Queues, Circular Buffer
Know each one’s strengths and weaknesses
27. Algorithms You Should Know
Sorting Algorithms
– Heap Sort, Merge Sort, Insertion Sort, Quick Sort, Bubble Sort,
Bucket Sort
O(nlog(n)) for most sort.
Quick sort runtime actually varies
Consider bucket (radix) sort (O(n)) if sorting dense integer ranges
Searching
– Have a sorted array?
– Items not sorted? Consider sorting them.
O(nlogn) one time, O(logn) search
– hashtable and lookup
O(n) one time, O(1) search
27
28. Algorithms You Should Know
Tree Traversals
– BFS
Use a Queue
– DFS
Stack or Recursion
Dykstra’s Shortest Path
Intersection of lists
– Sorted lists, it’s O(n) with O(1) additional memory.
– With unsorted list and no additional memory, sort O(nlogn)
– With unsorted list and additional memory, lookup table with
smallest list (O(n))
28
29. Algorithms Extras
Often trade off between memory and processing
– Store if you think you will repeat calculations
Consider pre-calculating results and quickly looking up
Recursion has cost
– Convert to iterative with stack, often not worth it
KNOW RUN TIME COMPLEXITY
– Obviously n3 > n2 > n log n > n > 1
– Knowing the complexity of your solution can indicate whether you
can do better. If you have to sort, can’t do better than n logn
– Rarely is a n! or xn the correct solution, look for a trick!
Practice.
– Questions are often different mutations of other questions.
– The more you see, the more tactics you will have
29
30. Number Theory
Floating points
– Single: sign - 1, exponent - 8, mantissa - 23
– Double: sign - 1, exponent - 11, mantissa - 52
– Precision Errors
Two’s Complement
– How to convert (invert, add 1)
Endianness (big and little)
Bit Shift tricks
– >>: Divide by 2
– <<: Multiply by 2
– Consider the sign when >> a negative number
30
31. Networks/Distributed
TCP, UDP, HTTP
Fallacies of distributed computing and networks
– Networks are unreliable
– Latency is not zero
– Bandwidth is finite
– Networks are not secure
– Topologies change
How to achieve consistency and reliability
– Master/slave
– Leader elections (quorum)
– Replication
RPC Protocols
– SOAP, REST, Thrift, Protobuffs, Avro, etc.
31
32. Concurrency
Know the basics
– Spin Lock, Mutex, Monitor, Semaphore, Signals, Synchronization
– These questions are good because they require more thinking
and less pattern matching
– Know which variables need to be shared, and protect them
Know producer/consumer problem
– Need common queue or buffer
– Java has it easy (BlockingQueue)
Know the reader/writer problem
– Reads blocks writes, but not reads
– Writes blocks writes and reads
32
33. Misc Coding Stuff
Know when to use disk
– Remember that disk is an option, not just RAM
– Sequential reads/writes good, Random seeks bad
Buffer Reads/Writes
– Good practice, makes things more efficient
Check for off by one errors
Use java (or high level language) when given the option
33
34. Other Hints
Be calm
Know what you are interviewing for
– You will often be tested on specifics of the role you are applying for
Use LinkedIn
– For getting jobs
– Research companies and interviewers
– For figuring out questions interviewer may ask
Be friendly
– Often one of the criteria being observed, if not happy interviewers
generally grade easier
Be enthusiastic about what you do
– Have a good idea about what you want to do
When in doubt, ask for clarifications
34
35. Conclusion
Remember your data structures (hashtable!)
Brush up on languages
Be friendly and calm
– Don’t be nervous, you are in demand
Prepare
– Do as many problems as you can
Keep talking, but not too much
If you’re an intern, ask if you can sit in on a few
interviews.
Ask when you can reapply if you don’t get an offer and do
so!
35
37. Questions
Given a binary search tree, write a function to find the kth
smallest element in the tree.
Note: You may assume 1 <= k <= total nodes in tree
37
2
31
If k = 2, result = 2 (2 is second smallest)
If k = 1, result = 1 (1 is smallest)
1) Brute force (extra memory
2) No extra memory
3) O(1) get
38. Questions
Remove duplicates from an unsorted linked list
Implement a queue using stacks; write enqueue and
dequeue functions
38
While reviewing resumes, interviews are mostly based on your thought process, as well as whether we could work with you or not
For this open ended question circumstances will change as you try to solve the maze
Never implement an algorithm that has a worse runtime complexity than the brute force solution
I personally recommend PIE as it goes through how to do everything from resume writing, to HR questions to finally negotiating your offer. It also goes deep into how to solve problems and use each type of main “solution” (hashtables, LinkedLists, etc)