Senior Engineer Interview Questions | Glassdoor.co.uk

Senior Engineer Interview Questions

882

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

Architecture design exercise: online ticket sales system

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

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

Design a gui application for a particular purpose

1 Answer

Generally all the questions were from any "what to interview" good book should include

1 Answer

Implement an algorithm that gives points according to the relation between addresses in transactions. That is, if you have a transaction between A and B then the tuple A, B would have 1 point and so on. Three sub-parts: 1) Code it. 2) What DB would you use? 3) How would this work if the address is a smart contract?

2 Answers
110 of 882 Interview Questions