You are on page 1of 3

Tips:

● Keep talking with the interviewer. While doing live coding, try to keep the conversation
up, explain each step, and explain beforehand your solution.
● While answering the questions, try to provide additional information, explain pros, cons
and best practices when appropriate

Subjects:

● Talk about your experience in the past two years, some highlights about best projects,
learnings, and experience
● Algorithms:
○ https://www.interviewbit.com/practice/ and https://leetcode.com/ are good places
for training. I recommend have a look at the Big O Notation, Data structures,
Sorting, Strings, Arrays
○ Recap java collections framework (they are really concerned about performance)
○ How HashMap works internally
● Design / Troubleshooting:
○ How to detect memory leak
○ How to detect deadlocks
○ How to throttle API Requests
○ Threads
○ Singleton
○ API/REST best practices
○ Best practices for code quality
○ Tests

Some exercises:

1) Remove adjacent duplicate

Input: String str


Output: String str (without adjacent duplicate)

Note: we have to repeatedly remove adjacent duplicate letters. Finally, when no adjacent
duplicate letters are present in the string, return the string

Example:

1)
Input : pqqprq
Output : rq
2)
Input : abcde
Output : abcde
3)
Input : pqqqprq
Output : rq

2) Design a solution to handle module dependencies. This solution should detect circular
dependencies.

Page -> Module-1


Module-2
Module-3
------
Module-N

Module-2 depends on Module 8->dependency on Module 5->9


Module-7 depends on Module-1
Module-5 depends on Module-1
Module-6 depends on Module-8

3) Given a Linked List, separate even and odd nodes.


e.g.: Input: 6->14->10->7->2->3->8->NULL
Output: 6->14->10->2->8->7->3->NULL

4) Implement an LRU Cache data structure

5) Implement a method that receives an array of integers and returns true if the number of
occurrences of each integer is different.
E.g..: Input: [1,2,2,3,3,3], output: true (1 repeat once, 2 repeats twice and 3 repeats 3 times)
Input:[1,2,3], output: false (1, 2 and 3 repeat once)

6) Implement a method to reverse the words in a sentence.


Note 1: He/she may or may not ask you to consider whitespaces.
Note 2: You may be allowed to use Stream API (it can be solved with a single line).
E.g.: Input: "The sentence should be reversed"
Output: "reversed be should sentence The"

7) Print/return the boundary traversal of binary tree


(https://www.geeksforgeeks.org/boundary-traversal-of-binary-tree/)

8) Implement a stack, and write unit tests for it.

9) Return longest substring without repeating characters.

10) Given an array of integers, find the three elements which product will result in the biggest
possible value.
E.g.:
[1, 6, 3, 9, 2] -> 6 * 3 * 9 = 162
[1, 7, 5, 8, 2, -1, -2] -> 7 * 5 * 8 = 280
[1, 7, 3, 8, 2, -1, -2, -4, -13] -> 8 * -4 * -13 = 416

11) A robot is located at the top-left corner of a m x n grid. It can only move either down or right at
any point in time. The robot is trying to reach the bottom-right corner of the grid.

How many possible unique paths are there?

[
[0,0,0],
[0,1,0],
[0,0,0]
]
Try to solve the problem using dynamic programming!

11) A positive integer is magical if it is divisible by either A or B.


Return the N-th magical number.

https://leetcode.com/problems/nth-magical-number/

12) Write a linked list with add and sort methods, make sort to be generic, implement asc and
desc order as well

13) Given a list of products:


[“mouse”, “mousepad”, “mousecleaner”, “keyboard”, “motherboard”]
And a search string: “mou”

Return a list of products for each typed letter: i.e m, mo and mou
[[“motherboard”,”mouse”,”mousepad”],
[“motherboard”,”mouse”,”mousepad”],
[“mouse”,”mousecleaner”,“mousepad”]]

The lists must have a max of 3 products and must be alphabetically sorted

You might also like