0% found this document useful (0 votes)
16 views

L11. Solving Technical Interview Problems.

Uploaded by

ulyana9963
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views

L11. Solving Technical Interview Problems.

Uploaded by

ulyana9963
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 32

ENGLISH

Solving Technical
Interview Problems
1 Revision
1) Can you name top 6 programming languages at the
moment?

2) Read these words:


procedure, launch, algorithm

3) Which mathematical operations can you remember?


Hint: -, +, :, *, %
2 Technical Interview
How is it different from an HR interview?
DISCUSS IN PAIRS/GROUPS

Have you ever taken part in a


technical interview?

What makes you feel more


nervous: an HR interview or a
technical interview?

What is the best way to prepare


for a technical interview?
Technical Interview
Technical Interview

Hard Skills: questions Questions about


Solving Problems
about programming your experience
Technical Interview

Hard Skills: questions Questions about


Solving Problems
about programming your experience

1. Read the task carefully.


2. Ask questions to clarify any confusion
or uncertainty.
3. Identify any assumptions you may be
making and confirm them with the
interviewer.
4. Identify any edge cases or special
scenarios that may need to be considered.
Clarifying questions
Different companies have different hiring interview styles.

Some companies could give you a problem and ask you to create some clarifying questions
as if you are the developer who got this task at their job. Look at the example question:

Our mobile app creates custom workout plans for fitness


enthusiasts based on their fitness level, goals, and
preferences. We would like to add a new feature to our
program - a pedometer (a step-counter).
Clarifying questions
Our mobile app creates custom workout plans for fitness enthusiasts based on their
fitness level, goals, and preferences. We would like to add a new feature to our
program - a pedometer (a step-counter).

1) How will the app count the steps? Will it use data from the user’s
mobile phone or get the information from another device (e.g. fitness
bracelet, smartwatch, etc.)?

2) If we work with a different device, how will it connect to our app?

Think of more questions to ask


WORK IN PAIRS/GROUPS

Our product is called NameGame. It’s a website


where people can upload their pets’ pictures and
get computer-generated pet names suggestions
based on the images.

We think that we should take into account the pets’


personalities when we generate names. So we
want to add a field where the users could write what
their pets are like: smart, cuddly, aggressive, etc.

In your group, think of several clarifying


questions you could ask.
Live Coding
Live Coding

During live coding, the


process of writing source
code is made visible to
everyone by projecting
the computer screen in
the audience space. At a
technical interview, your
interviewers are your
audience.
What is it called?
HOW TO SOLVE PROBLEMS

PROCEDURE SOLVE (problem)


Sometimes you will be coding
BEGIN
in a language that you are later
IF problem is easy THEN
Solve problem directly going to use at work. However,
ELSE
BEGIN sometimes you will be writing
Break problem into smaller problems P1, P2, ... , Pn
SOLVE(P1), SOLVE(P2), ... , SOLVE(Pn) something like this.
Assemble the solutions
END
What is it called?
END
What is it called?
HOW TO SOLVE PROBLEMS

PROCEDURE SOLVE (problem)


Sometimes you will be coding
BEGIN
in a language that you are later
IF problem is easy THEN
Solve problem directly going to use at work. However,
ELSE
BEGIN sometimes you will be writing
Break problem into smaller problems P1, P2, ... , Pn
SOLVE(P1), SOLVE(P2), ... , SOLVE(Pn) something like this.
Assemble the solutions
END
What is it called?
END pseudocode
Pseudocode

• Pseudocode is a simplified form of programming


language that allows you to describe algorithms and
logical steps in a way that is easier to understand
and write than actual code.
• It can help you plan and organize your code before
you start writing it, making it easier to catch errors
and design more efficient solutions.
• It is not a formal language and there are no strict
rules for its syntax, so it's important to focus on
clarity and readability.
What is this program? How does
it work?
Most common terminology
переменная

объявить

присвоить
значение

ввод и вывод

вывести на экран
Most common terminology
переменная variable

объявить
declare
присвоить
значение assign a value

ввод и вывод input and output

вывести на экран display/write


Most common terminology
переменная variable рассчитать

объявить инициализировать
declare
присвоить вернуть
значение assign a value
вызвать
ввод и вывод input and output
цикл, зациклить
вывести на экран display/write
итерировать
Most common terminology
переменная variable рассчитать calculate/compute

объявить инициализировать initialise


declare
присвоить вернуть return
значение assign a value
вызвать call
ввод и вывод input and output
цикл, зациклить loop
вывести на экран display/write
итерировать traverse/iterate
Time to practice

Write a function that finds


the maximum element in
an array of integers
Time to practice
Write a function that finds the maximum element in
an array of integers. Use pseudocode.
Solution

Steps to Solve the Problem:


• Initialise a variable max with the first element of the
array.
• Traverse the array from the second element onwards
and compare each element with the max variable.
• If an element is greater than the current max value,
update the max variable with that element.
• Once the entire array has been traversed, the max
variable will hold the maximum element of the array.
Solution

Code
example:
Code explanation:

• The function findMax takes


an integer array as input
and returns the maximum
element of the array.
• The variable max is initialised with the first element of the array, as it
is the only element available at the beginning.
• The for loop iterates over the array from the second element
onwards and compares each element with the max variable.
• If an element is greater than the current max value, the max variable
is updated with that element.
• After the entire array has been traversed, the max variable holds the
maximum element of the array.
• The max variable is returned as the output of the function.
Do you know a game called FizzBuzz? Watch the
video to learn the rules.

https://www.youtube.com/watch
?v=-1v3D6a_1Dc
WORK IN PAIRS/GROUPS

1. Write a function that prints the numbers


from 1 to 100. But for multiples of three
print "Fizz" instead of the number and for
the multiples of five print "Buzz". For
numbers which are multiples of both three
and five print “FizzBuzz". Use pseudocode.

2. Practice explaining how your


code works and what it does.
Solution by Chat GPT
In this pseudocode, we loop
through numbers 1 to 100 and
check if each number is divisible
by both 3 and 5, 3, 5, or none of
them. For each case, we output the
corresponding string or number.
The program will output
"FizzBuzz" for numbers that are
multiples of both 3 and 5, "Fizz"
for numbers that are multiples of
3, "Buzz" for numbers that are
multiples of 5, and the number
itself for other numbers.
Bonus
10 common technical interview problems

1. Palindrome checker: Write a function that takes a string as input and returns true if
the string is a palindrome (reads the same forwards and backwards), and false
otherwise.
2. Factorial calculator: Write a function that takes an integer as input and returns the
factorial of that number.
3. String reversal: Write a function that takes a string as input and returns the reverse
of the string without using the reverse() method
4. Fibonacci sequence: Write a function that takes an integer n as input and returns
the nth number in the Fibonacci sequence.
5. Anagram checker: Write a function that takes two strings as input and returns true
if the strings are anagrams (contain the same characters in a different order), and false
otherwise.
Bonus
10 common technical interview problems

6. Binary search: Write a function that takes an array of integers and a target value as
input, and returns the index of the target value in the array using a binary search
algorithm.
7. Bubble sort: Write a function that takes an array of integers as input and sorts the
array using the bubble sort algorithm.
8. Linked list: Implement a linked list data structure with methods for adding and
removing nodes, and for finding a specific node in the list.
9. Prime number checker: Write a function that takes an integer as input and returns
true if the number is prime, and false otherwise.
10. Two sum problem: Write a function that takes an array of integers and a target
sum as input, and returns the indices of two numbers in the array that add up to the
target sum.
Thank you!

You might also like