Questions d'entretiens - Senior Software Engineer | Glassdoor.ca

Questions d'entretiens - Senior Software Engineer

281

Questions d'entretien de Senior software engineer partagées par les candidats

Le top des questions d'entretien

Trier: PertinencePopulaires Date

Write a function that divides one number by another, without using the division operator, and make it better than O(n).

7 réponses

This can be done in a recursive function, the following code is in Python. # get result of a/b without using a "divide" operator def div(a,b): if a < b: return 0 else: return div(a-b, b)+1 This is how human being do the division naturally, however, the running time of this is O(n/m), where n is the size of a, and m is the size of b, which means, O(n/m) is guaranteed to be less than O(n), when m is larger than 1. -Maxim

The answer above is still O(n). We can use binary search and find the answer in the interval [1,a] and use multiplication operator.

Totally agree with Vasil. Other option: Long Division Algorithm. O(log n) anyway.

After asking the details of my current role, he only gave me a simple coding question. Write a function using C++ or Java that is passed an integer and it returns the number of bits set to 1. Is there a way to improve your solution and make it faster and more efficient?

3 réponses

find LCA for two nodes of a binary tree.

4 réponses

how to merge two sorted linklist?

2 réponses

So, you have almost talked to everyone in the building?

1 réponse

Write Fizz-Buzz in C++. Now make all the stupid constant-time optimizations you can think of to it. Formally: given an int, return “fizz” if it’s a multiple of 3, “buzz” if it’s a multiple of 5, or “fizz buzz” if it’s a multiple of both. It it isn’t a multiple of 3 or 5, return “”. Then find stupid ways to over-optimize it, such as using no if-statements.

1 réponse

Given an int, return it as a string without using any library methods to do so. It should work for all values of an integer.

1 réponse

Find the height of a binary tree.

1 réponse

Reverse a linked list. Return the k’th last node of a linked list, or NULL if it doesn’t exist.

1 réponse

Come up with a design for a distributing jobs to different machines. No coding, just explain how you would do it.

1 réponse
110 de 281 Questions d'entretien d'embauche