York Code Dojo - Interview Questions
Part 1 – In your group work read through the following questions making sure that you all have good answers for as many of the questions as possible.
Part 2 – After an hour, we will pair up the groups. The groups then take it in turns being the interviewer and interviewee. I suggest swapping after every couple of questions.
The questions can be answered, verbally, in code or on paper. Arrays
- What is an array?
- How do you find the missing number in a given integer array of 1 to 100?
- How do you find the duplicate number in a given integer array?
- How do you find the largest and smallest number in an unsorted integer array?
- How do you find all pairs of an integer array whose sum is equal to a given number?
- How do you find duplicate numbers in an array if it contains multiple duplicates?
Linked Lists
- Describe a linked list
- How do you find the length of a singly linked list?
- How do you check if a given linked list contains a cycle?
- How do you reverse a linked list?
- How do you find the third node from the end in a singly linked list?
Strings
- How do you check if two strings are anagrams of each other?
- How do you count the number of vowels and consonants in a given string?
- How do you check if a given string is a palindrome?
Binary Trees
- What is a binary tree?
- What is the difference between breadth-first search and depth-first search?
Dictionary / Hash Tables / Maps
- What is a hash table?
- What is it’s advantage?
What is recursion?
- What is stack overflow?
- What is tail-call optimisation?
Misc.
- How do you swap two numbers without using the third variable?
- What is the difference between a heap and stack?
- What are the differences between 32bit and 64bit systems?
- What is meant by CI/CD?
Performance
- Users are reporting that our application is running slow? What steps should we take?
Control You join a company as their development manager, but you find things are a bit of a mess. The only copy of source code is on the developer’s laptops. New versions of the software are deployed by files being manually copied from these development machines onto the production servers. Developers troubleshoot issues by either connecting directly to the databases on the live servers, or by taking copies on the databases onto their own laptops. What changes would you introduce?
Shopping Web Site You work as a developer in the IT department for a growing on-line shopping site. The company takes most of the orders over the internet via its web site. The process is • The user adds the items they wish to order to their shopping cart
• The user clicks the checkout button which: o Checks the stock levels to ensure the items are in stock o Takes payment from the user’s bank o Sends a notification to the warehouse to despatch the goods o Sends an email confirmation to the user. The company is growing rapidly in size but unfortunately users are reporting that the checkout process is often slow and sometimes times out. Your CEO tells you that this needs to be sorted before you expand out into Europe next month. Do you have any suggestions to how the process can be sped up?
Library You have been asked to create a new computer system for York library. As the company’s DBA you are excited as you get to model the database from scratch. Assuming the library must support the typical library functions (reserve book, return book etc), what might the database structure look like?
New User Interface A member of your marketing team tells you that the reason that recent sales figures are low is because the company logo is on the left-hand side of the screen rather than on the right. You are not totally convinced but are happy to move it to avoid any arguments. How would you prove that moving the logo does/does not make a difference?
Company Phone Book Your boss comes to you and says “Great news”, we want you to develop and deliver a new company phone book application across our entire company. She doesn’t give you any form of specification just the project title. How would you approach the project?