Infrastructure Software Engineer Interview Questions | Glassdoor

Infrastructure Software Engineer Interview Questions


Infrastructure software engineer interview questions shared by candidates

Top Interview Questions

Sort: Relevance Popular Date

Write a function that takes 2 arguments: a binary tree and an integer n, it should return the n-th element in the inorder traversal of the binary tree.

7 Answers

Correct answer should be something like this: int FindNthElement(Node *node, int &n) { if (node->Left && n > 0) { k = FindNthElement(node->left, n); if (n == 0) return k; } if (n == 0) return node->value; else if (n > 0 && node->right) { k = FindNthElement(node->right, n); if (n == 0) return k; else return -1; } }

int findNthElementByInorder(Node *node, int &n) { if (node == null) return -1; findNthElementByInorder(node->left, n); if (n == 0) return node-> value; else n--; findNthElementByInorder(node->right, n); }

Seems it should be something like this, get the to bottom and start counting up from there. int start(Node *node, int &n) { int element = 0; if (node == null) return -1; return findElementIndex(node, element, n); } int findElementIndex(Node *node, int &currentNumber, int findNumber) { if(node->left != null ) { int result = findElementIndex(node->left, currentNumber, findNumber); if(result != -1) return result; } if(node->right != null ) { int result = findElementIndex(node->right, currentNumber, findNumber); if(result != -1) return result; } currentNumber++; if(currentNumber == findNumber) return node->value; else return -1; }

If a large sequence of commits are in the main (master) branch of a git repository and only a subset are desired for a new branch, how would you create that new branch?

2 Answers

How would you check if a binary tree is balanced?

1 Answer

Given a set of strings, find the k-most frequent occuring strings One more question on Arrays which I do not remember

Given a input string and a dictionary, find the longest substring that also appear in the dictionary. each subset need to retain the original order of the characters. what's the efficiency of the solution ?

1 Answer

Given a set of points in cartesian plane, find the line that passes through the maximum number of points

Implement a variety of specific recursive and iterative functions.

Most problems happened to be about some kind of string parsing/manipulation. (palindrome problems, word detection etc) but the one that I had the hardest time with was an array-based find all subsets problem.

2 Answers

Find the most expensive path to traverse in a matrix.

110 of 22 Interview Questions