Print all strings corresponding to elements in a subarray with maximum absolute sum

   #include using namespace std;    void maximumAbsSum(pair* arr,                    int N) {     int start = 0, end = 0, res = 0,         negIndex = 0, posIndex = 0,         negPrefix = 0, posPrefix = 0;             for (int i = 0; i < N; i++) {            if (arr[i].second < 0) {                              […]

Continue Reading

System Design – Horizontal and Vertical Scaling

If you’re a developer then building a website and serving it to the users can be the most pleasurable things for you. After all, you worked hard and you tried to create something valuable for the users. When you see a huge number of users have started using your services and day after day the […]

Continue Reading

Check for transitive property in a given Undirected Graph

#include using namespace std;    class Graph {             int V;                  list* adj;             void DFSUtil(int v, bool visited[], int id[],                  int id_number, int& c);    public:     Graph(int V);     ~Graph();             void addEdge(int v, int w);                  bool connectedComponents(); };    Graph::Graph(int V) {     this->V = V; […]

Continue Reading

Minimize count of connections required to be rearranged to make all the computers connected

   #include using namespace std;    void DFS(unordered_map& adj,          int node, vector& visited) {          if (visited[node])         return;             visited[node] = true;             for (auto x : adj[node]) {                     if (visited[x] == false)             DFS(adj, x, visited);     } }    int makeConnectedUtil(int N,                       int connections[][2],                       int M) {               vector visited(N, […]

Continue Reading

Platform9 Systems Interview Experience

Part A: Pre-interview assessment (3-4 days virtual) 1. After filling the registration form, each of us was given a problem statement through mail to implement a type-ahead feature similar to Google search for a given set of inputs and a regex for the pattern to be searched.   2. We were given a time period […]

Continue Reading

GGK Tech Interview Experience (On-Campus)

GGK Tech Interview Experience (On-Campus) GGK Technologies came to our college for placements and they had four rounds of interviews. Written Test: The written test consisted of Aptitude, Reasoning, English, Java coding questions for which output has to be answered. The difficulty level was Easy-medium and I’ve cracked it. On-Paper coding round: They started us […]

Continue Reading

Remove all subtrees consisting only of even valued nodes from a Binary Tree

#include using namespace std;    struct node {     int data;     struct node *left, *right; };    node* newNode(int key) {     node* temp = new node;     temp->data = key;     temp->left = temp->right = NULL;     return (temp); }    void printLevelOrder(node* root) {          if (!root)         return;                  queue q;             q.push(root);        while […]

Continue Reading