<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Nandini Kapoor on Medium]]></title>
        <description><![CDATA[Stories by Nandini Kapoor on Medium]]></description>
        <link>https://medium.com/@nandinikapoor24601?source=rss-277047783f37------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*dyaGsJ3_G8lMhabvJBD4hg.jpeg</url>
            <title>Stories by Nandini Kapoor on Medium</title>
            <link>https://medium.com/@nandinikapoor24601?source=rss-277047783f37------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 15:06:28 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@nandinikapoor24601/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Google Software Engineer Interview Preparation — part 2]]></title>
            <link>https://medium.com/@nandinikapoor24601/google-software-engineer-interview-preparation-part-2-aa185fe787fd?source=rss-277047783f37------2</link>
            <guid isPermaLink="false">https://medium.com/p/aa185fe787fd</guid>
            <category><![CDATA[google]]></category>
            <category><![CDATA[computer-science]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[interview-preparation]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Nandini Kapoor]]></dc:creator>
            <pubDate>Thu, 01 Feb 2024 15:21:46 GMT</pubDate>
            <atom:updated>2024-02-01T15:21:46.732Z</atom:updated>
            <content:encoded><![CDATA[<h3>Google Software Engineer Interview Preparation — part 2</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*L8oDBUyFL0joLy-gpg3exA.jpeg" /></figure><p>This article is a continuation of <a href="https://medium.com/@nandinikapoor24601/google-software-engineer-interview-preparation-part-1-9c18ada9617d">https://medium.com/@nandinikapoor24601/google-software-engineer-interview-preparation-part-1-9c18ada9617d</a> that talks about preparation for SWE role interviews through the course of your B.tech.</p><p><strong>Third year</strong></p><ol><li><em>Projects</em> — Considering that your 5th semester roughly start around July, you need to have some projects to add in your resume by the coming month of October, as summer internship application portals of many companies start to accept applications around this time. Yet again this is not something Google focuses on but lots of other companies will pick a project from your resume or ask you to pick your favorite one and explain it. <br>What are the kind of questions the interviewers usually ask about your project?</li></ol><ul><li>Brief explanation of what the project does, for example,<br>– My first project is a bot created on discord which takes messages as prompts to call <a href="https://codeforces.com/apiHelp">Codeforces APIs</a> to start competitions between 2 users, fetch latest questions of queried user, etc. (This was my project during summer internship interviews, it does not have a lot of application of expected concepts)<br>– My second project is a decision tree implementation in python from scratch which I made to understand how classification problems in ML work, you can feed it an n dimensional categorical dataset to train it and then proceed to feed it a testing data point. It will tell you which category of the dataset this point belongs to. <br>– My third project is an e-commerce website to sell my dad’s paintings, implemented in flask. It used a PostgreSql database and relational database concepts for data storage. <br>Its features include — <br>- — Account Creation/ Sign Up — The user can enter their address, name, login password and other personal information here. <br>- — Login — The user can use their credentials entered during account creation to log into their existing accounts. <br>- — Seller Portal — It has a seller portal for the users to uploads products that they want to sell. A seller can upload the picture of a product, enter its name and description, specify the quantity they have in stock and product price. The quantity decreases itself with every purchase from a buyer and the seller can edit such information on receiving a restock.<br>- — Buyer Portal — wherein the users can add items to their cart, wishlist, filter products using search bar or a price range selector and finally proceed to checkout. <br>- — Checkout — The checkout gateway was createdc by integrating Google Pay API into the service.<br>– Remember to add features to your projects steadily (FTE interviewers expect more complex projects as opposed to the ones you were able to swim with in your summer internship interview- more application of concepts like data base management, computer networks)- Towards the end of my third year I was working on integrating the Decision tree into the E-commerce website to enable recommendations to users based on their purchase history.</li><li>Questions specific to technologies used, for example<br>– If you say used SpringBoot they may ask you to explain ‘Inversion of Control’, ‘Beans’, ‘Dependency Injection’, etc and then of course follow up questions based on your answer like ‘Where did you apply this concept in your project and how did this improve the previous flow of information?’.<br>– If you are using a database they may ask you to explain what attributes each of your tables store, the relationship between these tables and the reasoning behind these decisions (they expect answers like — separating x and y into different tables enabled me to have a 2NF DB).</li></ul><p>2. Database Management Systems — DBMS is an important subject from interview perspective. You will be asked to write SQL queries for extracting data from tables as well as theoretical questions about concepts of DBMS (like normalization, concurrency control, ACID properties, etc).</p><p>3. Computer Networks — CN is another such subject which is asked in a most interviews. No implementation questions or numerical will be asked but you are expected to know what algorithms are used for various purposes in networking. For example, you may be asked to explain all ‘Page Replacement Algorithms’ or you may be given specific requirements and asked ‘Which Page Replacement Algo will suit this use case best and why?’. Famous questions like ‘what happens when you search for something on Google’ also fall under this category.<br>You are also expected to know the concepts apart from algorithms, for example you may be asked about <a href="https://www.geeksforgeeks.org/piggybacking-in-computer-networks/">Piggybacking</a>’</p><p>NOTE — For subjects like DBMS, CN and OS, don’t try to create your own notes, there are abundant notes available on various websites topic wise like Geeks for Geeks or medium articles. I would usually bookmark the ones I found important so that I can easily go over them for revision.</p><p><strong>Fourth Year</strong></p><p>In the fourth year of your preparation you are expected to move to tag specific problems in competitive programming for practice and focus on improving the time and space complexities of your codes. This is the primary reason why most people move to platforms like Leetcode that give you an analysis of your memory and time consumption on every submission, however just CP works as well if you are confident about the efficiency of your code.</p><p>Below are some topics whose problems you should be easily able to identify and solve in interviews, so these are the tags to be practiced a lot.</p><p><strong>Sortings</strong></p><p>When you practice problems with the tag of any sorting algorithms, some problems are going to require you to actually implement it, but in some of them just applying any language’s function of sorting might work (there are always work around solutions for problems intended to be solved with a decent amount of application of a base algo). Do not use the existing functions and submit just for the sake of a submission, you need practice in writing the algorithm not just calling a function.</p><p>Below are the basic sorting algorithms whose application questions are asked in interviews (Each of them has a link to the standard Leetcode submissions I used to make for practice a day before the interviews to brush up basic implementations)—</p><p><a href="https://leetcode.com/submissions/detail/746378481/"><em>Mergesort</em></a></p><pre>Void merge(int left, int right, int mid, int a[]) {<br> int leftSize = mid-left+1, rightSize = right-mid;<br> int arrayLeft[leftSize], arrayRight[rightSize];<br>  for(int i=0; i&lt;leftSize; i++) {<br>     arrayLeft[i] = a[i+left];<br>  }<br>  for(int i=0; i&lt;rightSize; i++) {<br>     arrayRight[i] = a[mid+i+1];<br>  }<br>  int leftInd = 0, rightInd = 0, ind = 0;<br>  while(leftInd&lt;leftSize &amp;&amp; rightInd&lt;rightSize) {<br>   if(arrayLeft[leftInd]&lt;arrayRight[rightInd]) {<br>    a[ind] = arrayLeft[leftInd];<br>    leftInd++;<br>   }<br>   else {<br>     a[ind] = arrayRight[rightInd];<br>     rightInd++;<br>    }<br>    ind++;<br>   }<br>   while(rightInd&lt;rightSize) {<br>     a[ind] = arrayRight[rightInd];<br>     rightInd++;<br>     ind++;<br>   }<br>   while(leftInd&lt;leftSize) {<br>     a[ind] = arrayLeft[leftInd];<br>     leftInd++;<br>     ind++;<br>    }<br> }<br><br>Void mergeSort(int left, int right, int a[]) {<br> if(left &lt; right) {<br>  int mid = (left+right)/2;<br>  mergeSort(left, mid, a);<br>  mergeSort(mid+1, right, a);<br>  merge(left, right, mid, a);<br>  }<br>}</pre><p><a href="https://leetcode.com/submissions/detail/746399176/"><em>Heapsort</em></a></p><pre>Void heapify(int a[], int node, int length) {<br> Int leftChild = 2*node+1, rightChild = 2*node+2;<br> Int indMax=node;<br> if(leftChild&lt;n &amp;&amp; a[leftChild]&gt;a[indMax]) {<br>  indMax = leftChild;<br> }<br> if(rightChild&lt;length &amp;&amp; a[rightChild]&gt;a[indMax]) {<br>  indMax = rightChild;<br> }<br> if(node!=indMax) {<br>  swap(a[indMax], a[node]);<br>  heapify(a, indMax, length);<br> }<br>}<br> <br>Void heapSort(int a[], int n) {<br> for(int i=(n-1)/2; i&gt;=0; i--) {<br>  heapify(a, i, n);<br> }  <br> for(int i=n-1; i&gt;0; i--) {<br>  swap(a[0], a[i]);<br>  heapify(a, 0, i);<br> }<br>}</pre><p><a href="https://leetcode.com/submissions/detail/746362264/"><em>Quicksort</em></a></p><pre>int partition(int a, int low, int high) {<br> int i=low-1;<br> for(int j=low; j&lt;high; j++) {<br>  if(a[j]&lt;a[high]) {<br>   i++;<br>   swap(a[i], a[j]);<br>  }<br> }<br> swap(a[i+1], a[high]);<br> return i+1;<br>}<br><br>void quicksort(int a[], int low, int high) {<br> if(low&lt;high) {<br>  int pi=partition(a, low, high);<br>  quicksort(a, low, pi-1);<br>  quicksort(a, pi+1, high);<br> }<br>}</pre><p><a href="https://leetcode.com/submissions/detail/746405589/"><em>Counting sort</em></a></p><pre>Void csort(int a[], int n) {<br> Int range=*max_element(a, a+n), count[range+1]={0}, ans[n];<br> for(int i=0; i&lt;n; i++) <br> count[a[i]]++;<br> for(int i=1; i&lt;=range; i++)<br>  count[i]+=count[i-1];<br> for(int i=n-1; i&gt;=0; i--)<br>  ans[--count[a[i]]]=a[i];<br>}</pre><p><a href="https://leetcode.com/submissions/detail/746107445/"><em>Insertion sort</em></a></p><pre>insertionsort(int a[], int n) {<br> for(int i=1; i&lt;n; i++) {<br>  int key=a[i];<br>  int j=i-1;<br>  for(j=i-1; j&gt;=0 &amp;&amp; a[j]&gt;key; j--) {<br>    a[j+1]=a[j];<br>  }<br>  a[j+1]=key;<br> }<br>}</pre><p><a href="https://leetcode.com/submissions/detail/746077782/"><em>Bubble sort</em></a></p><pre>bubble(inr a[], int n) {<br> for(int i=0; i&lt;n; i++) {<br>   for(int j=0; j&lt;n-i-1; j++) {<br>     if(a[j+1]&lt;a[j]) {<br>       swap(a[j], a[j+1]);<br>      }<br>    }<br>  }<br>}</pre><p><strong>Graphs</strong></p><p><a href="https://leetcode.com/submissions/detail/746488183/"><em>Bfs</em></a></p><pre>void bfs(vector&lt;int&gt;graph[], int n) {<br> vis[n]={0};<br> for(int i=0; i&lt;n; i++) {<br>  if(vis[i]) continue;<br>  queue&lt;int&gt;level, levelNext;<br>  level.push(i);<br>  vis[i] = 1;<br>  while(!level.empty()) {<br>    Int node = level.front();<br>    level.pop()<br>    for(auto child: graph[node]) {  <br>      if(vis[child]) continue;<br>      levelNext.push(child);<br>      vis[child] = 1;<br>    }<br>    if(level.empty()) {<br>      level = levelNext;<br>      levelNext.clear();<br>    }<br>  }<br> }<br>}</pre><p><a href="https://leetcode.com/submissions/detail/746818783/"><em>Dfs</em></a></p><pre>void dfs(vector&lt;int&gt;graph[], int cur, int vis[]) {<br> vis[cur]=1;<br>  cout&lt;&lt;cur&lt;&lt; “ ”;<br>  for (auto it:graph[cur]) {<br>    if(!vis[it]) dfs(graph, it, vis);<br>  }<br>}<br><br>Void begin(vector&lt;int&gt;graph[], int n) {<br> int vis[n]={0};<br> dfs(graph, 0, vis);<br>}<br><br></pre><p><em>Undirected graph tree or not</em></p><pre>bool isCycle(vector&lt;int&gt;graph[], int parent, int node, int vis[]) {<br> vis[node]=1;<br> for(auto it:graph[node]) {<br>  if(vis[it] &amp;&amp; it!=parent) return true;<br>  if(!vis[it]) <br>    if(isCycle(graph, node, it, vis))<br>      Return true;<br>  }<br>  return false;<br>}<br><br>bool isTree(vector&lt;int&gt;graph[], int n) {<br> int vis[n]={0};<br> if(isCycle(graph, -1, 0, vis)) return false;<br> for(int i=0; i&lt;n; i++) <br>   if(!vis[i]) <br>     return false;<br>  return true;<br>}</pre><p><em>Directed graph tree or not</em></p><pre>void isCycle(vector&lt;int&gt; graph[], int node, int vis[], int comp[]) {<br> if(vis[node]) <br>   return false;<br> comp[node]=1;<br> vis[node]=1;<br> for(auto it:graph[node]) {<br>  if(comp[it]) <br>    return true;<br>  if(!vis[it] &amp;&amp; isCycle(graph, it, vis, comp))<br>    return true;<br>  }<br>  comp[node]=0;<br>  return false;<br>}<br><br>void isTree(vector&lt;int&gt;graph[], int n) {<br> int vis[n]={0}, component[n]={0};<br> for(int i=0; i&lt;n; i++) <br>  if(!vis[i] &amp;&amp; isCycle(graph, i, vis, component))<br>    return false;<br>  return true;<br>}</pre><p><a href="https://leetcode.com/submissions/detail/757626168/"><em>Detect cycle disjoint set</em></a></p><pre>int find(int parent[], int node) {<br> if(parent[node]!=node) <br>   parent[node]=find(parent, parent[node]);<br>  return parent[node];<br>}<br><br>void union(int parent[], int parent1, int parent2, int ranks[]) {<br> if(ranks[parent1]&lt;ranks[parent2]) <br>   parent[parent1]=parent2;<br> else if(ranks[parent1]&gt;ranks[parent2])<br>   parent[parent2]=parent1;<br> else {<br>  parent[parent1]=parent2;<br>  Ranks[parent2]++;<br> }<br>}<br><br>bool isCycle(vector&lt;pair&lt;int, int&gt;&gt;graph, int n) {<br> int parent[n], ranks[n]={0};<br> for(int i=0; i&lt;n; i++)<br>   parent[i]=i;<br> for(auto it:graph) {<br>   int i=it.first, i2=it.second; <br>   int parent1=find(parent, i), parent2=find(parent, i2);<br>   if(parent1==parent2) <br>     return true;<br>    union(parent, parent1, parent2, ranks);<br>  }<br>  return false<br>}</pre><p><em>Lca binary tree</em></p><pre>struct node {<br> int key;<br> struct node* left, *right;<br>}<br><br>struct node* lca(struct node* root, int n1, int n2, int &amp;f1, int &amp;f2) {<br>  if(root-&gt;key == n1) {<br>    f1 = true;<br>    return root;<br>  }<br>  if(root-&gt;key == n2) {<br>    f2 = true;<br>    return root;<br>  }<br> <br>  node *left_lca  = lca(root-&gt;left, n1, n2, f1, f2);<br>  node *right_lca = lca(root-&gt;right, n1, n2, f1, f2);<br> <br>  if(left_lca &amp;&amp; right_lca)  return root;<br>  if(left_lca) {<br>    return left_lca;<br>   }<br>   else return right_lca;<br>}<br><br>void getLca(int n1, int n2, struct node* root) {<br> int foundRight=0, foundLeft=0;<br> struct node* lcaNode=lca(root, n1, n2, foundLeft, foundRight);<br> if(!foundLeft || !foundRight) <br>   return NULL;<br>  return lcaNode;<br>}</pre><p><em>Kruskal’s MST</em></p><pre>int find(int parents[], int node) {<br> if(parents[node]!=node)<br>  parents[node]=find(parents, parents[node]); //reducing bamboos<br> return parents[node];<br>}<br><br>void union(int parents[], int node1, int node2, int rank[]) {<br> int parent1=find(parents, node1), parent2=find(parents, node2);<br> if(rank[parent1]&lt;rank[parent2])<br>  parent[parent1]=parent2;<br> else if(rank[parent1]&gt;rank[parent2])<br>  parent[parent2]=parent1;<br> else {<br>  parent[parent2]=parent1;<br>  rank[parent1]++;<br> }<br>}<br><br>void mst(vector&lt;pair&lt;int, pair&lt;int, int&gt;&gt;&gt;graph, int vertices, int edges) {<br> // {weight, {node1, node2}}<br><br> sort(graph.begin(), graph.end());<br> int edgesInserted=0, parents[vertices], rank[vertices];<br> for(int i=0; i&lt;vertices; i++) {<br>  parents[i]=i;<br>  rank[i]=0;<br> }  <br> auto cur=graph.begin(), insertPtr=graph.begin();<br> while(edgesInserted&lt;vertices-1) {<br>  int weight=cur-&gt;first, node1=cur-&gt;second.first, node2=cur-&gt;second.second;<br>  int parent1=find(parents, node1), parent2=find(parents, node2);<br>  if(parent1!=parent2) {<br>    union(parents, parent1, parent2, rank);<br>    edgesInserted++;<br>    *insertPtr={weight, {node1, node2}};<br>    insertPtr++;<br>   }<br>   cur++;<br> }<br><br>//first vertices-1 values in graph vector denote the mst<br>}</pre><p><em>Prim’s MST</em></p><pre>void prim(vector&lt;pair&lt;int, int&gt;&gt;graph[], int v) {<br> set&lt;pair&lt;int, int&gt;&gt;pq;<br> pq.insert({0, 0});<br> int parent[v], dist[v], included[v];<br>  for(int i=0; i&lt;v; i++) {<br>    parent[i]=-1; <br>    dist[i]=INT_MAX;<br>    included[i]=0;<br>  }<br>  dist[0]=0;<br>  int vertices=0;<br>  while(vertices!=v) {<br>    int node=pq-&gt;begin().second;<br>    included[node]=1;<br>    vertices++;<br>    pq.erase(pq.begin());<br>    for(auto it:graph[node]) {<br>      if(!included[it.first] &amp;&amp; dist[it.first]&gt;it.second) {<br>        dist[it.first]=it.second;<br>        pq.insert({dist[it.first], it.first});<br>        parent[it.first]=node;<br>      }<br>    }<br>  }<br>}</pre><p><em>Dijkstra</em></p><pre>void dij(vector&lt;pair&lt;int, int&gt;&gt;graph[], int dist[], int v, int src) {<br> priority_queue&lt;pair&lt;int, int&gt;&gt;pq;<br> pq.push({0, src});<br> for(int i=0; i&lt;v; i++) <br>  dist[i]=INT_MAX;<br> dist[src]=0;<br> while(!pq.empty()) {<br>   int node=pq.top().second;<br>   pq.pop();<br>   for(auto it:graph[node]) {<br>     if(it.second+dist[node]&lt;dist[it.first]) {<br>       dist[it.first]=it.second+dist[node];<br>       pq.push({dist[it.first], it.first});<br>      }<br>    }<br>  }<br>}</pre><p><em>Bellman Ford</em></p><pre>bool isNegCycle(vector&lt;pair&lt;int, pair&lt;int, int&gt;&gt;&gt;graph, int vertices, int src) {<br> int dist[vertices];<br> for(int i=0; i&lt;vertices; i++)<br>   dist[i]=INT_MAX;<br> dist[src]=0;<br> for(int i=0; i&lt;vertices-1; i++) {<br>  for(auto it:graph) {<br>    int src=it.second.first, dest=it.second.second;<br>    if(dist[src]!=INT_MAX &amp;&amp; dist[src]+it.first&lt;dist[dest])<br>       dist[dest]=dist[src]+it.first;<br>   }<br>  }<br>  for(auto it:graph) {<br>    int src=it.second.first, dest=it.second.second;<br>    if(dist[src]!=INT_MAX &amp;&amp; dist[src]+it.first&lt;dist[dest])<br>      return true;<br>  }<br>  return false;<br>}</pre><p><em>Floyd Warshal</em></p><pre>bool isNegCycle(vector&lt;int&gt; graph[]; int v) {<br> for(int intermed=0; intermed&lt;v; intermed++) {<br>  for(int src=0; src&lt;v; src++) {<br>   for(int des=0; des&lt;v; des++) {<br>    if(graph[src][dest]&gt;graph[src][intermed]+graph[intermed][des])<br>     graph[src][dest]=graph[src][intermed]+graph[intermed][des];<br>    }<br>   }<br>  }<br>  for(int i=0; i&lt;v; i++) <br>   if(graph[i][i]&lt;0)<br>     return true;<br>  return false;<br>}</pre><p><em>Topological sort</em></p><pre>void tsutil(vector&lt;int&gt;graph[], int vis[], int node, stack&lt;int&gt;st) {<br> vis[node]=1;<br> for(auto it:graph[node]) {<br>  if(!vis[it])<br>   tsutil(graph, vis, it, st);<br> }<br> st.push(node);<br>}<br><br>void ts(vector&lt;int&gt;graph[], int v) {<br> int vis[v]={0};<br> stack&lt;int&gt;st;<br> for(int i=0; i&lt;v; i++) <br>  if(!vis[i]) <br>    tsutil(graph, vis, i, st)<br><br>  //topological sorted order of nodes in stack<br>}</pre><p><a href="https://leetcode.com/submissions/detail/759461531/"><em>Bipartite</em></a></p><pre>bool bip(vector&lt;int&gt;graph, int v) {<br> int col[v]={0};<br> for(int i=0; i&lt;v; i++) {<br>  if(col[i])<br>    continue;<br>  queue&lt;int&gt;q;<br>  q.push(i);<br>  while(!q.empty()) {<br>    int node=q.top(), colCur;<br>    if(!col[node])<br>      col[node]=1;<br>     colCur=col[node];<br>     q.pop();<br>     for(auto it:graph[node]) {<br>        if(col[it]==colCur)<br>          return false;<br>        if(col[it]!=-1)<br>          continue;<br>         if(colCur==1) <br>           col[it]=2;<br>         else <br>           col[it]=1;<br>         q.push(it);<br>      }<br>   }<br> }<br> return true;<br>}</pre><p><strong>Greedy/DP</strong></p><p><em>Job scheduling</em></p><pre>void schedule(int n, int jobs[], int deadlines[]) {<br> for(int i=0; i&lt;n; i++) <br>  jobs[i]=-1;<br> for(int i=0; i&lt;n; i++) {<br>  for(int j=min(n, deadlines[i])-1; j&gt;=0; j--) {<br>   if(jobs[j]==-1) {<br>    jobs[j]=i;<br>    break;<br>   }<br>  }<br> }<br>}</pre><p><em>Knapsack</em></p><pre>int knap(int w, int wts[], int n, int profs[]) {<br> int dp[w+1]={0};<br> for(int i=0; i&lt;n; i++) {<br>  for(int j=w; j&gt;=0; j--) {<br>   if(wts[i]&lt;=j) {<br>    dp[j]=max(dp[j], dp[j-wts[i]]+profs[i]);<br>   }<br>  }<br> }<br> return dp[w];<br>}</pre><p><em>Sieve</em></p><pre>void sieve(int n) {<br> int primes[n+1]={0}; // i prime if primes[i]=0<br> for(int i=2; i*i&lt;=n; i++) {<br>  if(primes[i]) <br>    continue;<br>  for(int j=i*i; j&lt;=n; j+=i) {<br>    primes[i]=1;<br>  }<br> }<br>}</pre><p><em>Kmp</em></p><pre>void lpscal(string pat, int lps[]) {<br> int i=1, len=0, n=pat.size();<br> while(i&lt;n) {<br>   if(pat[i]==pat[len]) {<br>     len++;<br>     lps[i]=len;<br>     i++;<br>     continue;<br>   }<br>   if(len!=0) <br>    len=lps[len-1];<br>   else<br>    lps[i++]=0;<br>  }<br>}<br><br>void kmp(string pat, string word) {<br> int n=pat.size(), m=word.size();<br> int lps[n]={0}, i=0, j=0;<br> vector&lt;int&gt;patfound;<br> lpscal(pat, lps);<br> while(i&lt;m) {<br>  if(pat[j]==word[i]) {<br>    i++;<br>    j++;<br>  }<br>  else if {<br>    if(j!=0)<br>      j=lps[j-1];<br>    else <br>      i++;<br>    continue;<br>  }<br>  if(j==n) {<br>    patfound.push_back(i-n);<br>    j=lps[j-1];<br>  }<br> }<br>}</pre><p><em>Longest common subsequence</em></p><pre>void lengthLcs(string a, string b, int n, int m) {<br> int lcs[n+1][m+1];<br> for(int i=0; i&lt;=n; i++) {<br>  for(int j=0; j&lt;=m; j++) {<br>   if(i==0 || j==0)<br>    lcs[i][j]=0;<br>   if(a[i-1]==b[j-1])<br>    lcs[i][j]=lcs[i-1][j-1]+1;<br>   else <br>    lcs[i][j]=max(lcs[i-1][j], lcs[i][j-1]);<br>  }<br> }<br> return lcs[n][m];<br>}</pre><p><em>Longest increasing subsequence</em></p><pre>int lengthLis(int a[], int n) {<br> int lis[n]={1};<br> for(int i=1; i&lt;n; i++) {<br>  lis[i]=1;<br>  for(int j=i-1; j&gt;=0; j--) {<br>   if(a[i]&gt;a[j] &amp;&amp; lis[i]&lt;lis[j]+1)<br>    lis[i]=lis[j]+1;<br>  }<br> }<br> return *max_element(lis, lis+n);<br>}</pre><p><em>Range Minimum Query</em></p><pre>void makeSparse(int n, int a[], int mat[MAX][MAX]) {<br>  for(int i=0; i&lt;n; i++) {<br>    for(int j=0; i+(1&lt;&lt;j)-1&lt;n; j++) {<br>      if(j==0) mat[i][j]=a[i];<br>      else {<br>        mat[i][j]=min(mat[i][j-1], mat[i+1&lt;&lt;(j-1)][j-1]);<br>      }<br>    }<br>  }<br>}<br><br>int query(int l, int r, int n, int mat[MAX][MAX]) {<br> int j=log2(r-l+1);<br> return min(mat[l][j], mat[r-(1&lt;&lt;j)+1][j]);<br>}</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aa185fe787fd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Google Software Engineer Interview Preparation — part 1]]></title>
            <link>https://medium.com/@nandinikapoor24601/google-software-engineer-interview-preparation-part-1-9c18ada9617d?source=rss-277047783f37------2</link>
            <guid isPermaLink="false">https://medium.com/p/9c18ada9617d</guid>
            <category><![CDATA[engineering]]></category>
            <category><![CDATA[interview-preparation]]></category>
            <category><![CDATA[google]]></category>
            <category><![CDATA[computer-science]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Nandini Kapoor]]></dc:creator>
            <pubDate>Fri, 12 Jan 2024 21:49:11 GMT</pubDate>
            <atom:updated>2024-01-12T22:07:35.377Z</atom:updated>
            <content:encoded><![CDATA[<h3>Google Software Engineer Interview Preparation — part 1</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HKFK2JTi2zLJq48api6Zkw.png" /></figure><p><strong>Background</strong></p><p>I joined <a href="https://medium.com/u/be36e94a7e47">Google</a> as a Software Engineer after graduating from the Indian Institute of Information Technology Nagpur in 2023 with a B.Tech in Computer Science and Engineering. I received offers from <a href="https://medium.com/u/897bb054a8fb">Intuit</a> and Goldman Sachs for SWE roles as well (both places I did my winter and summer internships at respectively). I want to share how I prepared throughout my B.Tech for cracking such SWE interviews.</p><p>With the idea in mind that preparation doesn’t just start a few months before an interview, here is what I focused on from a preparation stand point right from the start of my college -</p><p><strong>First year</strong></p><ol><li><em>Computer Programming</em> — It is meant to make you familiar with basic data structures, designing algorithms and writing programs in at least one language. I found C Programming Language to be an excellent choice for this introduction to programming because it does not have a lot of stuff ready made for you to use into your code, so you actually get to learn how basic functions like sorting or structures like vectors deal with data by implementing it yourself. It is sort of the ‘Hello World’ of Engineering.</li><li><em>Competitive Programming</em> — Start participating in contests on CP platforms like <a href="https://codeforces.com/">Codeforces</a>, <a href="https://medium.com/u/da3bbea6d8af">CodeChef</a> and <a href="https://atcoder.jp/">Atcoder</a>. Remember that you are just starting out, your submissions for problem statements are not going to be optimal yet so once you submit a solution, also look at editorials if possible to see the intended approach. I noticed during this time that lots of students would only participate in lower division contests or unrated contests and I don’t think that’s helpful… You will have to learn to embrace low ratings throughout your journey in CP. A low rating does not mean you’re a bad programmer, it means you’re one that is consistent and accepts challenges.</li><li><em>Calculus (optional)</em> — You aren’t going to be using it directly if you’re a developer but it is a great warm up for all the logic building you’re going to get into when you start programming solution codes for problem statements.</li></ol><p><strong>Second year</strong></p><ol><li><em>Data Structures and Algorithms</em> — At this point you should start moving from creating all functions and data structures in your code from scratch to using the ones made available by the languages you prefer programming in. I moved from C to C++ and a reference to my submission before moving that used linked list implementation in C instead of using vectors is <a href="https://www.codechef.com/viewsolution/28568734">here</a>.</li><li><em>More Competitive Programming</em> — Start to upsolve if you weren’t already doing so. This means after every contest is over, try solving the problem that comes after the last problem you submitted code for. This helps you increase the level of problems you are able to solve on time steadily. <em>How</em>? Well every new problem comes with a new concept or catch, so solving the ones you haven’t been able to during a contest means you are familiarizing yourself with new concepts that will help you build a solution faster the next time you encounter similar problems.</li><li><em>Communication </em>— You should start trying to explain your code or thought process towards a solution to others. This helps with being able to explain your approaches to interviewers later on. I personally found post contest discussions helpful at this point — I would explain to friends who also participated in the contest how I solved a particular problem, the concepts this problem used and we would go through my code justifying all decisions taken (like choosing a set vs using a vector followed by sort).</li><li><em>Operating Systems</em> — While Google itself does not focus on other subjects in their interviews, lots of other companies do. Mostly just going in depth of the topics mentioned in college lectures is enough (example OS Types, Threads, RTS, Computer Memory, CPU Scheduling are some prominent topics for interview questions). You can use youtube channels, articles, books whatever you prefer to educate yourself on them.</li></ol><p>Let me know in the comments if you want me to go into the details of all topics that need to be focussed on in the subjects mentioned above and resources for them.</p><p>I will post the second half of this post soon, as it will include more details about the problems and resources as opposed to subjects I did not want to dump all that information here itself.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9c18ada9617d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SWE Internship Hiring Process and Experience — Google]]></title>
            <link>https://medium.com/@nandinikapoor24601/swe-internship-hiring-process-and-experience-google-475efe49f75?source=rss-277047783f37------2</link>
            <guid isPermaLink="false">https://medium.com/p/475efe49f75</guid>
            <category><![CDATA[google]]></category>
            <category><![CDATA[internships]]></category>
            <category><![CDATA[interview]]></category>
            <category><![CDATA[engineering]]></category>
            <category><![CDATA[students]]></category>
            <dc:creator><![CDATA[Nandini Kapoor]]></dc:creator>
            <pubDate>Sun, 20 Mar 2022 14:03:51 GMT</pubDate>
            <atom:updated>2023-11-18T15:37:27.208Z</atom:updated>
            <content:encoded><![CDATA[<h3>SWE Hiring Process Experience — Google</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/160/1*1R8dwxm2N9M7vodFZwwD_w.gif" /></figure><p>I’ve had a lot of students ask me about the hiring processes that accompany SDE(Software Development Engineer)/SWE(Software Engineer) roles and the kind of flow that companies/organizations follow for hiring freshers. So I figured I’d share the hiring processes I have encountered so far and my experience around them starting with Google!</p><h3>My background:</h3><p>For a background on where I speak from, I’m a Computer Science and Engineering graduate from the Indian Institute of Information Technology Nagpur. I did my summer internship at Goldman Sachs, winter internship at Intuit and am now a Software Engineer at Google. I have gone through the hiring processes of Goldman Sachs, Google, Intuit, Adobe, BNY Mellon and Fractal Analytics, and have been offered full time positions at Google, Intuit and GS as well as internships at BNY Mellon and Fractal Analytics.</p><p>I have during my second year at IIITN worked at <a href="https://www.codechef.com/">Codechef</a> as an editorialist — I published explanations to their contest problems in written and video format as well as took live classes on competitive programming for coders in different levels of their journey. I have also worked as a problem setter and tester with <a href="https://www.prepbytes.com/">Prepbytes</a>.</p><p>With the context of this post well established, I’ll get right into the processes.</p><h3>Google Interview Experience:</h3><p>I’ve been through Google’s hiring process twice by now, they do not hire from our campus and so both the times I went through this was off campus. They may or may not need you to give an online assessment(OA) like a lot of other companies, in my case I didn’t have to. You’re shortlisted primary on the basis of DSA knowledge. As they already have your competitive programming profile through their own contests like Kickstart, Hashcode and Codejam, in some cases you may not need to give an OA separately.</p><h4><strong>How to Apply:</strong></h4><ol><li>Start by visiting <a href="https://careers.google.com/students/">Google Careers</a> page for students.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0W7UhOojPujgREnnDk8nnQ.png" /></figure><p>2. From the above shown page you may pick your field of interest which in this case is jobs in <a href="https://careers.google.com/students/engineering-and-technical-jobs/">Engineering and Technology,</a> click on the box that specifies the same and you will reach the page shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IMoAjzlkHwEEd3AhNHZB6g.png" /></figure><p>3. Now you can browse through all available openings in Google if you navigate through the “SEE ALL JOBS” button, to their <a href="https://careers.google.com/jobs/results/?category=DATA_CENTER_OPERATIONS&amp;category=DEVELOPER_RELATIONS&amp;category=HARDWARE_ENGINEERING&amp;category=INFORMATION_TECHNOLOGY&amp;category=MANUFACTURING_SUPPLY_CHAIN&amp;category=NETWORK_ENGINEERING&amp;category=PRODUCT_MANAGEMENT&amp;category=PROGRAM_MANAGEMENT&amp;category=SOFTWARE_ENGINEERING&amp;category=TECHNICAL_INFRASTRUCTURE_ENGINEERING&amp;category=TECHNICAL_SOLUTIONS&amp;category=TECHNICAL_WRITING&amp;category=USER_EXPERIENCE&amp;employment_type=FULL_TIME&amp;employment_type=PART_TIME&amp;employment_type=TEMPORARY&amp;jex=ENTRY_LEVEL">Careers</a> page which this time is field specific, aligning with the field of interest you had picked on the student section of their careers page in the last step.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aKZ4KJxf4OM26QJWMUH_Rg.png" /></figure><p>4. On the left panel you can specify the type and duration of work you are seeking, location which you prefer to work out of and the skills and qualifications to which you want the job to match.</p><p>1. Alternatively you can choose to get hired by contests instead, to do this visit your <a href="https://codingcompetitions.withgoogle.com/profile">coding profile</a> with Google.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OqvGlOsC-bfKnOW2QjXmdA.png" /></figure><p>2. When you are at the page shown above expand the “You and Google” drop-down and choose to be contacted about job opportunities at Google.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/614/1*RDUJYRzUNFHHrRS9YVf1eg.png" /></figure><p>In this same section you may upload your resume’s <a href="http://drive.google.com/">drive</a> link and <a href="https://www.linkedin.com/">linkedin</a> profile’s link as well.</p><h4>On Being Shortlisted:</h4><p>You receive an email asking you for your updated resume and to confirm whether you are free in the following week or not (your tentative interview date).</p><p>Once you send your resume over, you’re emailed again to confirm the final dates of your interview this time, you will have to acknowledge to your availability on these dates. Google is awesome when it comes to this, they’re very accommodating of the needs of the interviewee. For example if one needs a translator or can’t make it on the given date you can simply reply to them and they provide you with whatever you need even if it is a reschedule. I made a point to mention this because during my second time going through the process of hiring with Google, I had my college’s end semester evaluations going on during the date given for the interview schedule and on informing them about this they were very kind and offered to reschedule.</p><p>You’re also emailed resources that you can use to get yourself familiar with their process. Essentially it tells you to get familiar with coding on <a href="http://docs.google.com/">Google Docs</a> because a shared doc is what is used to communicate your code with the interviewer and the interview happens over <a href="https://meet.google.com/">Google Meet</a>. Now my interviews all happened online because they happened amidst the pandemic, but if you were to give your interviews offline they suggest you get familiar with writing code on a whiteboard for the on-site interviews.</p><p>Now in the interview itself they do not expect you to give a working code, meaning you don’t have to run your code and test it on inputs, your logic is what matters. You can pick whichever programming language you prefer to write the code and you are not expected to remember the syntax associated with data structure declarations in the language you pick either. For example, if you do not remember <strong><em>multimap&lt;char, int&gt;map_name</em></strong> is the way to declare a hashing data structure in C++, with characters as keys and integral numbers as values then you may just tell the interviewer that you are using hashing to keep track of the key value pairs without actually using the right syntax for it. The interviewers do however want you to take care of edge cases, give an optimized approach/logic and its complexity analysis. You may also need to dry run the code to find these corner cases so be prepared to do that.</p><p>My first time with Google, I was interviewed by someone working out of Bangalore. I was asked a 2 dimensional dynamic programming problem (their questions are confidential and they request you to keep things under the wraps — very googly, love it!).</p><p>Do not panic on getting stuck, the interviewers give you hints whenever you are not able to proceed with the logic or see some obvious bugs in the code. Despite this however, I could not optimize the approach I had explained to the interviewer and coded out on the doc, so obviously I was out right after this round.</p><p>My second time with Google was better however, the interviewers worked out of Warsaw and Bangalore, there were 3 rounds I went through.</p><p>1st round was quite simple, the question/problem statement asked to me revolved around fitting a string into a crossword.</p><p>2nd round was more complex as it consisted of graph traversals, recursion and a little bit of DP all in a single question.</p><p>3rd round was different, it required Object Oriented Programming as I had to develop a word document functionality. This round was focused on edge cases and how I take care of them within my code. There were also a couple of HR questions asked to see if I am fit to work in Google’s work environment. I was able to clear all 3 rounds and received my dream offer around October!</p><p>As for my experience, I loved how thorough and convenient the process was both the times and I admired all interviewers I came across throughout the process of hiring with Google. They ensure that you’re comfortable before you start with the actual interview and are very understanding, kind and helpful.</p><p>I hope this helped some people and gave an extent of clarity about interviews you have to go through for being hired as a software engineer. Thank you for reading, I wish you all the best in your efforts of job hunting and I will see you soon with the next article!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=475efe49f75" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>