Saturday, 23 Oct 2021

I was recently selected for the prestigious D E Shaw Ascend Educare Program, as one among the 40 girls from all over India. I am sharing my interview experience here so that people appearing for internships or mentorships at D E Shaw can get an insight into the process.Round 1: Essay and ResumeHey geek! It’s […]

Data Engineering is one of the most coveted careers options today and a highly lucrative one at that. And if you are wondering what data engineering entails, what will be the growth trajectory, or how to become a data engineer, you have stumbled upon the right article. We will try to answer all these in […]

#include using namespace std;  class Node {public:    int val;    Node *left, *right;    Node(int val)    {        this->val = val;        left = right = NULL;    }};  Node* buidSymmetericTree(Node* root1,                         Node* root2){        if (root1 == NULL and root2 == NULL) {        return NULL;    }          if (root1 == NULL) {                          Node* node = new Node(root2->val);        root1 = node;    }          if (root2 == NULL) {                          Node* node = new Node(root1->val);        root2 = node;    }                  if (root1->val != root2->val) {        int temp = root1->val […]

#include using namespace std;  #define M 100000  vector tree(4 * M + 1);  void update_tree(int start, int end,                 int update_idx, int length_t,                 int count_c, int idx){            if (start == end        && start == update_idx) {        tree[idx].first            = max(tree[idx].first, length_t);        tree[idx].second = count_c;        return;    }          if (update_idx < start        || end < update_idx) {        return;    }          int mid = (start + end) / 2;      update_tree(start, mid, update_idx,                length_t, count_c,                2 * idx);    update_tree(mid + 1, end, update_idx,                length_t, […]

Given two arrays A[] and B[] both consisting of N integers, the task is to find the maximum length of subarray [i, j] such that the sum of A[i… j] is equal to B[i… j].Examples:Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at […]

#include using namespace std;  void traverse(int M, int N,              vector& matrix,              int row, int col){          if (row >= 0 && row < M        && col >= 0 && col < N) {        if (matrix[row][col] == 0) {            return;        }                          matrix[row][col] = 0;                  traverse(M, N, matrix, row, col - 1);                  traverse(M, N, matrix, row, col + 1);                  traverse(M, N, matrix, row - 1, col);                  traverse(M, N, matrix, row + […]

#include using namespace std;  int maxLength(string str, int n,              char c, int k){        int ans = -1;          int cnt = 0;          int left = 0;      for (int right = 0; right < n; right++) {          if (str[right] == c) {            cnt++;        }                  while (cnt > k) {            if (str[left] == c) {                cnt–;            }                                      left++;        }                          ans = max(ans, right – left + 1);    }      return ans;}  int maxConsecutiveSegment(string S, int K){    int N = […]

#include using namespace std;  string findSum(string str1, string str2){            if (str1.length() > str2.length())        swap(str1, str2);          string str = “”;          int n1 = str1.length();    int n2 = str2.length();          reverse(str1.begin(), str1.end());    reverse(str2.begin(), str2.end());      int carry = 0;    for (int i = 0; i < n1; i++) {                          int sum            = ((str1[i] - '0')               + (str2[i] - '0')               + carry);        str.push_back(sum % 10 + '0');                  carry = sum / 10;    }          for (int i = n1; […]

Given an array arr[] of N integers, the task is to find the lexicographically largest permutation by sequentially inserting the array elements to the front or the back of another array.Examples:Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and […]

Given an array arr[] of N integers, the task is to find the maximum count of K, i.e, consecutive integers from 0 to K, that is present in the set S, where S contains all the possible subset-sum values of the array arr[].Examples:Attention reader! Don’t stop learning now. Get hold of all the important DSA […]