Senior Engineer Interview Questions | Glassdoor.co.uk

Senior Engineer Interview Questions

976

Senior engineer interview questions shared by candidates

Top Interview Questions

Sort: RelevancePopular Date

Write an algorithm to rotate a node of a binary tree.

2 Answers

void rotateLeft( Node p) { Node r = p.right; p.right = r.left; if (r.left != null) r.left.parent = p; r.parent = p.parent; if (p.parent == null) root = r; else if (p.parent.left == p) p.parent.left = r; else p.parent.right = r; r.left = p; p.parent = r; } void rotateRight(Node p) { Node l = p.left; p.left = l.right; if (l.right != null) l.right.parent = p; l.parent = p.parent; if (p.parent == null) root = l; else if (p.parent.right == p) p.parent.right = l; else p.parent.left = l; l.right = p; p.parent = l; }

To help visualise, right rotation is shown below. Consider a given tree: R /\ / \ P C /\ / \ A B Imagine nodes as metal coins suspended by strings (branches). For right rotation: 1. Pick up node P and pull it up so that node R falls down to the right of P. 2. Take B (right child of P) and make it left child of node R. The tree has been right rotated now and looks like this: P /\ / \ A R /\ / \ B C Similar process can be applied to this tree to rotate it left. This time start by pulling up R above P. Hope it helps.

How will you prevent the code in finally block from executing? The question isn't a very fair one as a good programmer would not write the code in finally block that he/she doesn't want to execute

3 Answers

I completely froze on following question which could be useful in a function that reverses order of words. How would you move a chunk of memory in C++/C?

2 Answers

How pumps work, how a pipe system is to be inspected, how you would perform maintenance on a pipework system, how a valve works. Give me an example of when you accomplished a significant achievement and how you did it.

1 Answer

Architecture design exercise: online ticket sales system

1 Answer

Explain a time you solved a mechanical problem?

1 Answer

Depending of the team, we ask techncal question that are specific to the project (web, desktop com/interop, services, processes, language: c++, C#, angular, react) I did interview a couple of candidate for our team and tend to see that people do not necessarly know what they put on their CV.

1 Answer

For a customer, take all the transactions in a given week and round them up to the nearest pound. For example with spending of £4.35, £5.20 and £0.87, the round-up would be £1.58. This amount should then be transferred into a savings goal, helping the customer save for future adventures.

1 Answer

The most difficult part was the accent. I had some problems with understanding the basic words like "synchronised".

1 Answer

1. How do you trace a mac address on a switch ?

1 Answer
110 of 976 Interview Questions