Tableau Interview quesiton for software engineer
1. the guy ask why I want to work for Tableau
2. Coding question: Given a binary tree, and print the tree in level order.
3. Following up: if the parent can have arbitrary number of children
4. Following up: how you optimized the code?
5. What the guy want you to do is to use multiple threads or concurrency to speed up your code.
This is first time someone ask me to write multiple thread or concurrency code on interview.
class Stack{
    public:
        int maxLen;
        int count;
        char* array;
    public:
        Stack(int max){
            count = 0;
            maxLen = max;
            array = new char[maxLen];
        }
        void push(char ch){
            if(count < maxLen){
                array[count] = ch;
                count++;
            }
        }
        char pop(){
            char ch;
            if(count > 0){
                ch = array[count-1];
                count--;
            }
            return ch;
        }
        bool isEmpty(){
            return count == 0;
        }
        int size(){
            return count;
        }
        ~Stack(){
            if(array)
                delete[] array;
        }
};