teleren/devto huggingface dataset:
Agoda Backend Engineer Interview
Tags: interview, career, agoda, backend
Published: 2022-01-23 12:28:02

## Overview
Agoda is one of the world’s largest online travel accommodation platforms. Back in 2019, I gave an interview with them and got an offer for backend software engineer. I will be sharing the complete details of my interview experience in this article.

**A more detailed version of my interview can be found in my medium article [here](https://medium.com/interviewnoodle/agoda-interview-experience-de6abc2c7347).**

## Agoda Hiring Process
* Resume shortlisting
* Hackerrank screening test
* 2 Skype technical rounds
* 4 F2F onsite technical rounds
* Final offer stage

## Screening Test
This was on hackerrank and had 25 MCQs with 2 additional coding questions.

## Skype Round 1 
The interviewer gave 2 coding problems:
* [Convert array into a linked list](https://www.geeksforgeeks.org/create-linked-list-from-a-given-array/)
* Second was a greedy algorithm based question which can solved by sorting.

After this, he also touched upon some general technical questions.

## Skype Round 2
The interviewer gave 1 coding problem:
* [Implement queue using arrays](https://www.geeksforgeeks.org/circular-queue-set-1-introduction-array-implementation/)

After this, he started asking about basics of Distributed Systems like CAP Theorem and some general technical questions.


*Since I cleared the Skype screening rounds they flew me to their Bangkok office and conducted the onsite rounds.*

## Onsite Round 1
Interviewer started off with a simple system design question:
* How to replicate data across multiple data centers (DCs)?

After this, he asked me describe my current project on a white board.

## Onsite Round 2
Interviewer asked 2 coding questions:
* [Find distance between 2 nodes in a binary tree](https://www.geeksforgeeks.org/find-distance-between-two-nodes-of-a-binary-tree/)
* [Find the largest square sub-matrix which contains only 1's.](https://leetcode.com/problems/maximal-square/)

## Onsite Round 3
Interviewer started off with the famous [egg dropping problem](https://www.geeksforgeeks.org/puzzle-set-35-2-eggs-and-100-floors/).

After this, he asked some general technical questions.

## Onsite Round 4
Interviewer gave a system design problem:
```
Design a sim card store system that gives you 3 sim cards on demand and each of them has a 10 digit long phone number.
- The generated numbers should be very hard to predict.
- We need to keep track of the phone numbers that are sold out and also the total unused numbers the system has at any point of time.
- Phone numbers should be stored very efficiently and retrieval of available phone numbers should be fast.
```

*After a few days of the interview, I got a call from recruiter saying they are making me an offer!!*

For more interview experiences, checkout my blogs [here](https://freezefrancis.medium.com/)
Engineering leadership; the series
Tags: leadership, career, devjournal, learning
Published: 2022-01-23 12:27:12

Welcome to the brand new series on the blog; Engineering leadership. In this series, we will take a look at topics that can help you with your work in an Engineering leadership position.

The topics in this series will vary in different aspects of running an engineering team or department. I expect to write about building the best teams, how to manage stakeholders, how to achieve technical excellence, how to be a good leader, and many more!

To not make this series a dry bin of theoretical texts, I came up with the following format for the blog posts. Each blog post will start with a theoretical/technical explanation of the topic. In addition, I will write on how you can use this in practice. From my personal experience or from others. As a result, you can put into practice what you learned right away!

If you are excited as me for the next post in this series, sign up for the [newsletter](https://blog.jellesmeets.nl/newsletter-signup/)! In that case, you will not miss the new posts. If you are unable to wait for the next post, you can take a look at the [4 lessons I learned as a starting scrum master](https://blog.jellesmeets.nl/lists/4-lessons-i-learned-as-a-starting-scrum-master/) blog post.

I am open to suggestions on topics to add to this series. Are there any topics you would like to see in this series? Let me know in the comments or [contact](https://blog.jellesmeets.nl/contact/) me!
Classification of Higgs boson decays using machine learning with Python
Tags: python, machinelearning, datascience, computerscience
Published: 2022-01-23 12:15:25

Hi everybody, I want to present you a project I developed some months ago using Python and machine learning within particle physics topics.

Topic: study of the Higgs boson Yukawa coupling to tau leptons using the 2012 ATLAS Run-2 dataset. Particular focus is dedicated to the usage of machine learning classification algorithms to classify the Higgs decay channel H to tautau as signal with respect to the other background processes.

For the classification have been considered the cases in which there are 0,1 or 2 jets in the final state.
Data was taken from the Higgs challenge kaggle dataset.

Let me know what do you think and don't forget to leave a star if you like it!

Github: repository: https://github.com/JustWhit3/higgs-decay-classification
Detect crashes in your Kubernetes cluster using kwatch and PagerDuty
Tags: kubernetes, devops, monitoring, pagerduty
Published: 2022-01-23 12:02:17

---
slug: detect-crashes-in-your-cluster-using-kwatch-and-pagerduty
title: Detect crashes in your Kubernetes cluster using kwatch and PagerDuty
authors: [amgadramses]
tags: [kubernetes, devops, monitoring, pagerduty]
keywords: [kwatch, kubernetes, devops, monitoring, pagerduty, cluster, crash]
description: monitor all changes in your Kubernetes cluster & detects crashes in your running apps in real time with PagerDuty
pagination_prev: null
---

In this article you will learn how to setup and deploy [kwatch](https://github.com/abahmed/kwatch) in your Kubernetes (K8s) cluster to monitor and receive real time crash alerts through PagerDuty
<!--truncate-->
### Configure PagerDuty
#### Step 1: Create a new service
![1](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ymk6uhptod91yjawtaz9.png)
#### Step 2: Give your service a Name and a Description
![2](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/70lmahvi4stprcxmysua.png)
#### Step 3: Add an [Escalation Policy](https://support.pagerduty.com/docs/escalation-policies)
![3](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u2x99eydson9bb793xf7.png)
#### Step 4: Make sure to add the [Events API V2](https://developer.pagerduty.com/api-reference/b3A6Mjc0ODI2Nw-send-an-event-to-pager-duty) Integration
![4](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/58gchbqxbjh0wr2961o7.png)
#### Step 5: Navigate to your service and copy the Integration Key
![5](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ev8u5szwr80d4qbhyd25.png)
### Configure kwatch
#### Step 1: Get the configuration template
```shell
curl  -L https://raw.githubusercontent.com/abahmed/kwatch/v0.3.0/deploy/config.yaml -o config.yaml
```
#### Step 2: Edit `config.yaml` file and add the Integration Key
```yml
apiVersion: v1
kind: Namespace
metadata:
  name: kwatch
---
apiVersion: v1
kind: ConfigMap
metadata:
  name: kwatch
  namespace: kwatch
data:
  config.yaml: |
    alert:
      pagerduty:
        integrationKey: <integration_key>
```
#### Step 3: Apply the configuration
```shell
kubectl apply -f config.yaml
```
### Deploy kwatch
```shell
kubectl apply -f https://raw.githubusercontent.com/abahmed/kwatch/v0.3.0/deploy/deploy.yaml
```

**You will now start receiving PagerDuty alerts whenever there is a pod crash in your Kubernetes (K8s) cluster!**
![6](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fec0qertafgoazh76n2b.png)

_You can find more documentation about kwatch [Here](https://kwatch.dev/docs).
If you like kwatch, give it a star on [GitHub](https://github.com/abahmed/kwatch)!_

_We are happy to hear feedback from you and if you have any request, or suggestion don’t hesitate to ping us on our channels ([Discord](https://discord.com/invite/kzJszdKmJ7), [GitHub](https://github.com/abahmed/kwatch))_
Using @property decorator in Django
Tags: django, python, beginners
Published: 2022-01-23 11:55:24

This post cross-published with [OnePublish](https://www.onepubli.sh)

I will show you how to use `@property` decorator in Django models to make code clean and optimized. Instead of adding extra fields to our model, we can define a custom property that will use already existing fields to return the required data.

## Example Scenario

We have a model named `Post` with the following fields:

```python
class Post(models.Model):
    name = models.CharField(max_length=255)
    description = models.TextField()
```

Assume that we also need a field to let us know which post names include specific prefixes such as `example_` and another one for getting `comments` of a particular post.

It will be a bad approach if we continuously use `if statements` and call `Comment.objects.filter(post_id=post.id)` queryset multiple times in different parts of the codebase.

## Creating property for Django model

Instead, we can create a property that will behave like a field of our Django model but in a more flexible way.

```python
class Post(models.Model):
    name = models.CharField(max_length=255)
    description = models.TextField()

    @property
    def has_prefix(self):
        return "_example" in self.name

    @property
    def comments(self):
        if self.id:
            return Comment.objects.filter(post_id=self.id)
        return Comment.objects.none()
```

Consider the naming of properties, it should be meaningful and straightforward without using prefixes like get_comments or similar.

So you can call these properties like below:

```python
post = Post.objects.first()

if post.has_prefix:
  # do something
  return post.comments
```

Support 🌏
If you feel like you unlocked new skills, please share them with your friends and subscribe to the youtube channel to not miss any valuable information.

{% youtube FxfzN9txtgE %}
E2E testing: challenges & lessons learned
Tags: testing, beginners, programming
Published: 2022-01-23 11:42:53

End-to-end testing. The holy grail of all testing types. 


![Holy Grail gif](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cxieqmmhs3nnuooppoxo.gif)

Here's everything we learned regarding the ins and outs of end-to-end testing - lessons, takeaways, mistakes, you name it. 

## So, let's start out with why
Swimm started growing, we added new features, and we found that we simply couldn't keep up with changes. 

We realized that our goal for a testing solution had two parts: 

1. Find a solution that allowed us to catch regressions bugs DURING development
2. Save manual regression QA time 

E2E testing seemed to be the right answer to our testing paradigm. 

We ended up choosing Cypress

## Pros 

- Awesome community 

- Great documentation

- Great features: automatic waiting, automatic sreenshots & videos, time travel

- Cypress is intuitive & easy to set up 

- Writing tests is fun  

- Using Cypress' API applies for user behavior  

## Cons

- Lack of multi-tab support

- Difficulty with iFrames

- Limited browser support (just Chrome-based browsers & firefox) 

## Challenges of E2E testing 
**Wins:**
- Identified & fixed a lot of bugs 

- Saved so much time by not having to repeat manual flows weekly

- Dramatically increased stability & coverage 
**Challenges**

- Human vs machine testing 

- We had zero experience with e2e tests

- Monitoring tests that are less reliable 

- It takes more time than you think 

## Key takeaways

1. Appoint an owner for E2E testing
2. Patience, patience, patience
3. Write stable tests 
4. Trust. Your. Tests. 
5. Stable tests = stable product

[Here's a detailed blog on how we implemented E2E testing. ](https://swimm.io/blog/end-to-end-testing-challenges-and-lessons-learned/)
Tech Communities
Tags: discuss, learn, leadership
Published: 2022-01-23 11:40:29

                          _Tech Communities_
I became a member of the developer student club at the end of my second semester, and I learned a lot in this club. My role was as an event manager. I learned a lot of things through events. Again at the end of my 2nd year, I became a member of the Hult Prize organization, joined the developer student club team as a technical lead, became a hack club lead, AngelHack ambassador, and ambassador at ORIC. I do love open-source communities. After my involvement in all these communities, I learned how to deliver technical content. I can talk publicly. I learned to collaborate with other teammates, and I love to share knowledge with others. These communities have had a good impact on me. I think one can change their confidence collaboration level, By working with team members' experience and much more in these communities. Many people say that working in these organizations is a waste of time. But I think one can get more benefits if they want one. This is my experience what's yours!
Top ES6 Features - Every Javascript Developer Must know...!
Tags: javascript, javascriptdeveloper, react, javascriptdevelopers
Published: 2022-01-23 11:27:55

---
title: Top ES6 Features - Every Javascript Developer Must know...!
published: true
tags: #javascript #javascriptdeveloper #react #javascriptdevelopers
canonical_url: https://thisisraj.hashnode.dev/top-es6-features-every-javascript-developer-must-know
---

**New Blog Post 📜 : ** https://thisisraj.hashnode.dev/top-es6-features-every-javascript-developer-must-know 🔗
Hello Folks...! This is my first blog in HashNode. I have mentioned about Top 10 ES6 features. 🔍 #hashnode #javascript #firstblog #javascriptdeveloper #react #reactjsdevelopment #hashnodeblog #javascriptdevelopers #es6 #thisisraj
(web-app)Open-Source URL-Shortener built using Python.
Tags: python, javascript, ux, webdev
Published: 2022-01-23 11:20:29

## 🧨How it started.

<br>

Hey there🤚.

**Long story short** , I recently joined here and I came over a post by @liyasthomas where he created a URL-SHORTNER which is open-source. As a person learning web development I was fascinated by it. But the thing that I noticed while going through the GitHub repo was that he have clearly mentioned not to put any sensitive links as all the links are publicly visible. 

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gkv2gmceg2bfxavyj6lb.png)

<br>
<br>

So I decided to make my own version of it but with some personal touches. 

With my previous experiences in **Python** I already knew to write a script which can shorten a URL using some Python modules. So I sat down to make it into a web-app using Flask. Hence Small-Heart💖 was born.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/r91k1s97jfr2x55y6g61.png)


<br>
<br>

## 🎀Demo 

<br>

Check out a live demo of it here 👇.
[Small-Heart💖](https://small-heart-demo.herokuapp.com)

<br>
<br>

### Note -- The site is hosted using Heroku's free version so increased traffic can make the site lag a bit.


<br>
<br>

## ✨Features :

<br>

- 🔭 Yes it is Open-Source. You can check it out here on [GitHub](https://github.com/aswinofficial/Small-heart).
- 📺 Simple UI(not the best😅).
- 🤖 No account creation or login required.


<br>
<br>

## ⭕Cons :

<br>

- 🤍 Currently in its 1st version(as of 1/23/2022).
- 🔆 Not a fully responsive web-design.


<br>
<br>

## 🖤Behind the scenes

Small-Heart is created using Flask as mentioned already.
A python module named [pyshorteners](https://pypi.org/project/pyshorteners/) is used to shorten the URL.

Last but not least a bit of JavaScript is used in the web page to make it much more user friendly(at least to an extent).

---

### I clearly want to mention that the inspiration of this project entirely came from @liyasthomas 🎉. I surely recommend everyone to check out his post as well.

---

With that said I would love💘 to know all of your suggestions and opinions on this. If you are interested in making any changes or improvements to it , feel free to check out the GitHub repo -- [Small-Heart](https://github.com/aswinofficial/Small-heart). Simply star it if you like the idea, it will encourage me to do a lot more projects. And always **Stay Safe and Keep Coding🎊**.
Do it!
Tags: discuss, book, improvement, start
Published: 2022-01-23 11:03:19

---
title: Do it!
published: true
description: Do something big or do something small. But stop wondering and go on an adventure.
tags: discuss, book, improvement, start
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pvvhxbidvbjwlfvlhnhf.jpg
---

_Originally published on [my blog](https://www.nikola-breznjak.com/blog/daily-thoughts/do-it/)._

Today's thought is not originally mine, but a quote from an amazing (short, beautifully illustrated - I mean, just check the featured image, and thought-provoking) book by, a constantly great performer, Simon Sinek called [Together is better](https://amzn.to/3FTbxsQ):

> A vision is like a dream - it will disappear unless we do something with it. Do something big or do something small. But stop wondering and go on an adventure.

Whatever it is, you've (I've, we've) probably done enough of the research already. So, instead of reading just 'one more' post, or going through 'one more' tutorial, just go and do it. START! Who cares if you fail. Get up, learn!, and try again - just do it!

---

This is [why I write](https://www.nikola-breznjak.com/blog/daily-thoughts/why-do-i-write-these-daily-thoughts-posts/) these 'daily thoughts' posts.
Day 15 of 100 - Java: Graph data structure
Published: 2022-01-23 10:51:52

Graph data structure with Java

```java

class Graph {

  class Edge {
    int src, dest;
  }

  // Number of vertices and edges
  int vertices, edges;

  Edge[] edge;

  Graph(int vertices, int edges) {
    this.vertices = vertices;
    this.edges = edges;

    edge = new Edge[edges];
    for (int i = 0; i < edges; i++) {
      edge[i] = new Edge();
    }
  }

  public static void main(String[] args) {
    int numVertices = 5;
    int numEdges = 7;
    Graph g = new Graph(numVertices, numEdges);

    g.edge[0].src = 1;
    g.edge[0].dest = 2;

    g.edge[1].src = 1;
    g.edge[1].dest = 3;
    
    g.edge[2].src = 1;
    g.edge[2].dest = 4;

    g.edge[3].src = 2;
    g.edge[3].dest = 3;
    
    g.edge[4].src = 2;
    g.edge[4].dest = 4;

    g.edge[5].src = 3;
    g.edge[5].dest = 5;

    g.edge[6].src = 4;
    g.edge[6].dest = 5;

    for (int i = 0; i < numEdges; i++) {
      System.out.println(g.edge[i].src + " - " + g.edge[i].dest);
    }
  }
}
```

https://github.com/j143/java-graph-datastructure-example

Java `Collection`s conversions

Java `List` or `ArrayList` to `Array`

```java
ArrayList homekeys = new ArrayList<> ();

homekeys.add("A");
homekeys.add("S");
homekeys.add("D");
homekeys.add("F");

// Create new Array

String[] homekeysArray = new String[homekeys.size()];

homekeys.toArray(homekeysArray);

```

But, the other way around is simple

```java
// import java.util.Arrays;

String[] array = {"A", "S", "D", "F"};

List languages = new ArrayList<> (Arrays.asList(array))
```

Based on the above learning I have solved https://leetcode.com/problems/rearrange-array-elements-by-sign/ but got Time Limit Exceeded.
Help needed: DevOps related assessment test 
Tags: devops
Published: 2022-01-23 10:24:27

Can anyone give me the solutions? 

Create a Terraform stack to deploy a sample three-tier web application to a single Docker node
in AWS. The application consists of frontend, backend, and database tiers. The frontend is
static, the backend is stateless and the database is relational.
Requirements
● The application should be horizontally scalable
● Development and Production environments should be configured
● The code should be provided in GitHub repo with deployment instructions
AWS S3
Tags: aws, s3, cloud
Published: 2022-01-23 10:14:46

**What is S3?**

An Amazon S3 bucket is a public cloud storage service provided by Amazon Web Services' (AWS). S3 stands for Simple Storage Service. S3 buckets are just like file folders, store objects, which contains data and its descriptive metadata.

**Benefits of S3**

Some of the benefits of AWS S3 are: 

- Durable
- cost efficient
- Scalable
- High Available
- Secure 
- Flexible

**How it works?**

A user creates a bucket. After bucket is created, specify the region in which the bucket should be deployed. During upload of files to bucket user should determine storage class for the specific object. Users can also define features to the bucket, such as bucket policy, lifecycle policies, versioning control, etc.

**Amazon S3 Storage Classes**

**Amazon S3 Standard for frequent data access**: In case of low latency.
**Amazon S3 Standard for infrequent data access**: Low access frequency. 
**Amazon Glacier**: When the data has to be archived, and high performance is not required.
**One Zone-IA Storage Class**: When data is infrequently accessed and stored in a single region.
**Amazon S3 Standard Reduced Redundancy storage**: Used when the data is non-critical and reproduced quickly.
XML Sitemap is rendering as plain text
Tags: indexing
Published: 2022-04-02 04:01:10

---
title: XML Sitemap is rendering as plain text
published: true
date: 2022-01-23 10:02:10 UTC
tags: indexing
canonical_url: https://adithya.dev/xml-sitemap-is-rendering-as-plain-text/
---

After adding `<xhtml:link>` to my sitemap file where I included `<xhtml:link rel="alternate" hreflang="supported_language-code">` my XML sitemap file started rendering as a plain text file.

In the console window of Chrome, I saw an error as well which indicated the structure was off.

```
Caught TypeError: Cannot read properties of null (reading 'childNodes')at XMLDocument.ready (content.js:218)ready @ content.js:218
```

I had to adjust my `<urlset>` from this

```
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml">

```

to this, thanks to this Stackoverflow answer

```
<urlset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd http://www.w3.org/TR/xhtml11/xhtml11_schema.html http://www.w3.org/2002/08/xhtml/xhtml1-strict.xsd"
        xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
        xmlns:xhtml="http://www.w3.org/TR/xhtml11/xhtml11_schema.html">
```

Strangely enough that while the XML was rendering properly, Google Search Console was displaying an issue for the sitemap

```
Your Sitemap or Sitemap index file does not properly declare the namespace!

```

The schema below fixed the Google issue (that's all we care about in 2021, right?) while the rendering issue still persists.

```
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:xhtml="http://www.w3.org/1999/xhtml"
        xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
```