BCS Technical Interview Workshop #1
Thursday, February 13th, 2020
-
Intro
-
General tips
-
Demo
-
Exercises
Jordan Chiu
- Pronouns: he/him
- Public Services & Procurement Canada (Apr - Aug 2019)
- CA Technologies (Sep - Nov 2018)
Kelly Ng
- Pronouns: he/him
- Google (May - Aug 2019)
- Microsoft (Jan - Apr 2019)
- Evernote (May - Aug 2018)
- Routific (Sep - Dec 2017)
Facilitators


DISCLAIMERS
- The introductory portion of this session (up to the demo) will be recorded and posted online on an unlisted video
- Don't be discouraged!
- You will encounter terms and/or data structures that are unfamiliar to you
- You may not be able to solve most, or perhaps any, of these questions
- (We'll give a brief intro to Stacks and Queues, though)
- Eventually, these problems will be easy!
- If you've already done technical interviews before, or have internship or co-op experience, you may not get a lot out of this session
- But you're welcome to join us regardless!
What's a Technical Interview?
- A chance for employers to learn how you communicate and solve problems
- May be in-person, over video conference, and/or a pre-screen test to complete on your own
- Types of questions:
- Coding
- Language-specific
- System design / integration
- Personal / academic projects
- General (technical) knowledge
- For this workshop, we're focusing on coding questions
General Tips
-
Talk! The worst thing you can do is solve a problem in silence
-
Ask questions for clarification
-
DO NOT start coding right away; solve the problem first
-
Talk through your solution out loud
-
Make sure you solve the problem that you're given
-
-
Know that you won't solve everything
-
Interviewers will try to push you to the edge of what you're capable of, and that's okay!
-
You'll come up with a better solution afterwards on the (bus) ride home
-
-
Don't worry too much about syntax, unless you're told to
-
Choose your favourite language if you can
-
-
Once you're done, state complexity in big-O notation
Preparing at home
-
Practice out loud
-
Tape a piece of paper on the wall and talk through a solution
-
Don't cheat!
-
-
Resources:
-
Cracking the Coding Interview (book)
-
Leetcode, HackerRank, ...
-
-
Things to know (at this point):
-
Strings, arrays, linked lists, stacks, queues, trees, graphs
-
Big-O, runtime and space complexity
-
Anything job-specific
-
-
Form a study group with your friends!
Stacks and Queues
-
Useful and simple data structures
-
Some language-agnostic methods:
-
-
Stack: first in, last out
-
.push(Obj o) - add an object to the stack
-
.pop() - remove an object from the stack, or return null if the stack is empty
-
-
Queue: first in, first out
-
.enqueue(Obj o) - enqueue the given object
-
.dequeue() - dequeue the top object, or return null if queue is empty
-
Questions?
Live Demo
[EASY] Write a program that prints the numbers from 1 to 70. For multiples of three print “Foo” instead of the number, and for the multiples of seven print “Bar”. For numbers which are multiples of both three and seven print “FooBar”.
Source: adapted from an interview at Gravit-E Technologies
Note: this question was made language-agnostic for this workshop. Originally, this question needed to be done in JavaScript, C#, or PHP.
Your turn!
- Split into groups of 3-4
- Get some paper and pens
- In your groups, take turns working through at least one problem in front of everyone else out loud
- Raise your hand if you want clarification; we'll walk around to each group
- If you're not the one solving the problem, wait until the solver is done (or gets stuck) before offering ideas
- You'll get 10-15 minutes for each problem
- There's more than one way to solve each of these
- If you're had interview experience before or have seen these questions, let others try problems first
Q1 [EASY]
Write a function to reverse a string. For example, given the string "abcde", the function should return "edcba".
Q2 [EASY]
Write a function that, given a number n, returns the n-th Fibonacci number.
Recall: the Fibonacci sequence is 1, 1, 2, 3, 5, 8, 13, ...
Source: interview for Later
Q3 [EASY]
You are given an unsorted array of (n-1) distinct integers in the range 1 to n. Write an algorithm to find the missing integer.
Source: CPSC 445
Q4 [EASY-MED]
Given a 2D array composed only of the characters “R”, “G”, and “B”, return the index of the row that has the largest number of “R”s in it.
Assumptions: If the array is empty, or if no rows contain “R”s, return -1. You may assume that each row has the same length. If two rows are tied, return the first row (the lowest-indexed row).
Source: adapted from an interview at CA Technologies
Q5 [MEDIUM]
You and your friend are Pokémon trainers. You two are teaming up to enter a tournament in which you must select only ONE Pokémon to fight for the both of you.
You are given two arrays of strings, where each string is a different type of Pokémon. The arrays are ordered in order of decreasing preference (1st = highest preference, last = lowest). Write an algorithm to return the name of the one Pokémon between you two that has the highest combined preference. If neither of you have a common Pokémon, you will use “Ditto”.
Source: adapted from a Yelp pre-screen
Link to solution descriptions
Technical Interview Workshop 1
By Jordan Chiu
Technical Interview Workshop 1
Introduction to technical interviews for BCS Tutoring.
- 204