Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Providing Appropriate Answers #17

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
15 changes: 15 additions & 0 deletions answers/q1.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,18 @@ Duolingo is a platform for language learning. When a student is learning a new l
- Given a story, how would you edit it to make it easier or more difficult?

**Answer**

There are several techniques used for analyzing the difficulty for text, such as :

1. **Readability scores:** Readability scores measure the complexity of text based on factors such as sentence length, word frequency, and vocabulary. The higher the score, the more difficult the text is to read.
2. **Syntactic complexity:** This technique looks at the complexity of the sentence structures in the text. More complex sentence structures tend to make the text more difficult to read.
3. **Readability scores:** Various readability scores exist that can be used to measure the difficulty level of a story. For example, the Flesch-Kincaid grade level score calculates the average number of words per sentence and syllables per word to determine the grade level at which the text can be understood.

To edit a story to make it easier or more difficult, here are some ways:

* One approach is to simplify or replace complex words with simpler synonyms. This is done by analyzing the frequency of words in the story and identifying uncommon or difficult words. The program can then suggest synonyms to make the text easier to understand.

* Another technique is to shorten or simplify sentences. The program can use syntactic complexity analysis to identify complex sentence structures and suggest simpler ways to convey the same information. This can help to improve the overall readability of the text.



7 changes: 7 additions & 0 deletions answers/q10.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,10 @@
Autocompletion: how would you build an algorithm to finish your sentence when you text?

**Answer**

One approach is to use statistical language models, such as n-gram models, to predict the next word in a sentence based on the previous words. The model can be trained on a large corpus of text data to learn the likelihood of word sequences and use that knowledge to suggest the most probable word to complete a sentence.

Another approach is to use neural language models, such as the Transformer architecture, which can capture the context of a sentence more effectively by considering the entire sentence as a whole rather than just the preceding words.



13 changes: 13 additions & 0 deletions answers/q11.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,16 @@
When you type a question on StackOverflow, you're shown a list of similar questions to make sure that your question hasn't been asked before. How do you build such a system?

**Answer**

Building a system used in Stackoverflow is a complex task that involves several steps. Here's a brief overview of how such a system can be built:

* **Data Collection:** The first step in building a system like this is to collect data. StackOverflow already has a vast database of questions, so this data can be used to train the system. Additionally, web scraping can be used to collect data from other sources, such as GitHub or Reddit.

* **Data Cleaning:** Once the data is collected, it needs to be cleaned and preprocessed. This involves removing any irrelevant information and converting the text into a format that the system can understand. For example, this might involve converting text to lowercase, removing stop words, and stemming or lemmatizing the words.

* **Feature Extraction:** The next step is to extract features from the cleaned data. These features are used to represent the questions in a way that the system can understand. Some common features include bag-of-words, TF-IDF, and word embeddings.

* **Similarity Calculation:** Once the features are extracted, the system needs to calculate the similarity between the user's question and the questions in the database. This is typically done using a similarity metric such as cosine similarity.

* **Ranking:** Once the system has calculated the similarity between the user's question and the questions in the database, it needs to rank the results and display the most relevant questions to the user. This ranking can be based on a variety of factors, such as the similarity score, the popularity of the question, or the age of the question.

9 changes: 9 additions & 0 deletions answers/q12.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,12 @@
How would you design an algorithm to match pool riders for Lyft or Uber?

**Answer**

There are several factors that need to be considered in order to create an efficient algorithm.

One important factor is the pickup location of each rider. The algorithm needs to take into account the proximity of each rider to one another and to the driver, as well as any traffic or road conditions that may impact travel time. It's also important to consider the timing of each rider's pickup, as some may be more time-sensitive than others.

Another important factor is the number of riders in each pool. The algorithm needs to balance the desire for maximum cost savings for riders with the practicality of fitting multiple people in a single vehicle. It's also important to consider the preferences of each rider, such as their willingness to share a ride with strangers or their desire for a more private ride.

Additionally, the algorithm needs to account for any special needs or requests from riders, such as wheelchair accessibility or the need for a car seat. These factors can impact the type of vehicle needed and the routing of the ride.