Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
103 changes: 103 additions & 0 deletions answers.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
## About You.

1. Introduce yourself.

I'm Jithin, from Kozhikode. I'm a Frontend Developer with 2 years of experience in TypeScript, React, and Next.js. I worked at a travel company where I helped build a booking engine for services like flights, hotels, and packages. I was also involved in building the CMS and CRM, which were used to manage website content and customer leads.

2. Do you own a personal computer?
Yes, I own a laptop.

3. Describe your development environment. (Your OS, IDE, Editor and Config manager if any)
- OS: Windows 11 Pro
- IDE: VS Code

## Social Profile

1. Your StackOverflow Profile url.
- Sorry, I don't have a stackoverflow profile

2. Personal website, blog or something you want us to see.

Websites that I have worked on:
- [Club Travalet](https://www.clubtravalet.com/) (Contributed to modules such as Flights, Visa, Holiday Packages, and more.)
- [Eivo](https://eivolife.com/) (Eivo is a product that is soon to be launched by Zerito Technologies, the company I previously worked for. This website is a promotional page for the product.)

## The real stuff.

1. Which all programming languages are installed on your system.
- Typescript
- Javascript
- Dart
- Python

**Python and Dart were installed for experimenting with a few projects. I had a basic understanding of both and explored them for project-related work at my previous company**

2. Write a function that takes a number and returns a list of its digits in an array.

```typescript
const numberToArray = (num: number): number[] => {
return String(num)
.split("")
.map((item) => Number(item));
};
numberToArray(452345);
```

_the example above will return array [4, 5, 2, 3, 4, 5]_

3. Remove duplicates of an array and returning an array of only unique elements

```typescript
const uniqueElements = (num: number[]): number[] => {
return [...new Set(num)];
};
uniqueElements([2, 3, 5, 4, 2, 3, 4]);
```

_the example above will return array [2,3,5,4]_

4. Write function that translates a text to Pig Latin and back. English is translated to Pig Latin by taking the first letter of every word, moving it to the end of the word and adding ‘ay’. “The quick brown fox” becomes “Hetay uickqay rownbay oxfay”.

```typescript
const toPigLatinAndBack = (phrase: string): string => {
if (phrase.length < 1) {
throw new Error("No Words Detected");
}
const splitPhrase = phrase.toLocaleLowerCase().split(" ");
const areWordsEndingWithAY = splitPhrase.every((item) =>
item.endsWith("ay"),
);
if (areWordsEndingWithAY) {
const ayRemovedList = splitPhrase.map((item) => {
const removeAY = item.slice(0, item.length - 2);
const lastChar = removeAY[removeAY.length - 1];
const originalWord = `${lastChar}${removeAY.slice(0, removeAY.length - 1)}`;
return originalWord;
});
return ayRemovedList.join(" ");
}
const pigLatinList = splitPhrase.map((item) => {
const firstChar = item[0];
const wordWithNoFirstChar = item.slice(1, item.length);
const pigLatin = `${wordWithNoFirstChar}${firstChar}ay`;
return pigLatin;
});
return pigLatinList.join(" ");
};
```

_example output: toPigLatinAndBack("ymay amenay siay ithinjay") will return 'My name is Jithin'_

_example output: toPigLatinAndBack("My name is Jithin") will return 'ymay amenay siay ithinjay'_

5. Write a function that rotates a list by `k` elements. For example [1,2,3,4,5,6] rotated by `2` becomes [3,4,5,6,1,2]. Try solving this without creating a copy of the list. How many swap or move operations do you need?

- **I wasn't able to solve this problem.**

Note: It is not mandatory that you answer all the questions. You may leave some behind and create a PR. However maximum questions will earn you maximum points. It is advised that you answer all the puzzles in a language that you are applying for.

### Notes

- [Pig Latin](https://en.wikipedia.org/wiki/Pig_Latin)
- [Fun](http://www.snowcrest.net/donnelly/piglatin.html)
- [Nice Read](https://medium.com/javascript-scene/10-interview-questions-every-javascript-developer-should-know-6fa6bdf5ad95)