Find Interview Questions for Top Companies
ConveGenius Interview Questions and Answers
Ques:- What is the process to set up database in django?
Right Answer:
To set up a database in Django, follow these steps:

1. **Install Database Driver**: Install the appropriate database driver for your database (e.g., `psycopg2` for PostgreSQL, `mysqlclient` for MySQL).

2. **Configure Database Settings**: In your Django project's `settings.py` file, update the `DATABASES` setting with your database configuration. For example:

```python
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql', # or 'mysql', 'sqlite3', etc.
'NAME': 'your_database_name',
'USER': 'your_username',
'PASSWORD': 'your_password',
'HOST': 'localhost', # or your database host
'PORT': '5432', # or your database port
}
}
```

3. **Run Migrations**: Execute the following command to create the necessary database tables
Ques:- How can the ternary operators be used in python?
Comments
Admin May 17, 2020

The ternary operator is the operator that is used to show the conditional statements. This consists of the true or false values with a statement that has to be evaluated for it. The operator will be given as:
[on_true] if [expression] else [on_false]
x, y = 25, 50
big = x if x < y else y
This is the lowest priority operator that is used in making a decision that is based on the values of true or false. The expression gets evaluated like if x<y else y, in this case if x<y is true then the value is returned as big=x and if it is incorrect then big=y will be sent as a result.

Ques:- How you can setup static files in django?
Right Answer:
To set up static files in Django, follow these steps:

1. In your Django project settings (`settings.py`), add the following:
```python
STATIC_URL = '/static/'
STATICFILES_DIRS = [os.path.join(BASE_DIR, 'static')]
```

2. Create a directory named `static` in your project or app directory.

3. Place your static files (CSS, JavaScript, images) inside the `static` directory.

4. In your templates, load static files using:
```html
{% load static %}
<link rel="stylesheet" type="text/css" href="{% static 'yourfile.css' %}">
```

5. For production, run `collectstatic` to gather all static files:
```
python manage.py collectstatic
```
Ques:- Why django ? What is advantages of Django ?
Right Answer:
Django is a high-level Python web framework that encourages rapid development and clean, pragmatic design. Its advantages include:

1. **Fast Development**: Built-in features allow for quick development of web applications.
2. **Scalability**: Can handle high traffic and large amounts of data.
3. **Security**: Provides protection against common security threats like SQL injection and cross-site scripting.
4. **Versatile**: Suitable for various applications, from simple websites to complex web services.
5. **Rich Ecosystem**: Offers a wide range of libraries and tools for various functionalities.
6. **Community Support**: Strong community and extensive documentation for troubleshooting and learning.
Ques:- How to use file based sessions?
Right Answer:
To use file-based sessions in Django, set the session engine in your `settings.py` file like this:

```python
SESSION_ENGINE = 'django.contrib.sessions.backends.file'
```

Make sure to specify the directory where session files will be stored by adding:

```python
SESSION_FILE_PATH = '/path/to/your/session/directory'
```

Ensure that the directory is writable by the web server. After this, Django will store session data in files in the specified directory.
Ques:- Is it a good practice to use item index as ‘key’ of list elements?
Right Answer:
No, it is not a good practice to use the item index as the 'key' of list elements in React.
Comments
Admin Feb 3, 2020

It is not a good practice to use the index of an item as the ‘key’ of the list elements. For example, if the order of the items changes, it will impact negatively and may cause issues with the react component state.

Ques:- Can we create one list without using ‘key’ in react?
Right Answer:
No, you cannot create a list in React without using a unique 'key' for each list item.
Comments
Admin Feb 3, 2020

We can create one list without ‘key’ for each element but it will cause issues with the react component rendering the list. Even on the browser console, it will throw one error.

Ques:- Is it required the keys to be unique globally in a react application?
Right Answer:
No, keys in a React application only need to be unique among siblings in the same list, not globally.
Comments
Admin Feb 3, 2020

The keys should be unique among the sibling lists. But we can use the same keys if we have two different arrays.

Ques:- When to use a class component in React?
Right Answer:
Use a class component in React when you need to manage local state or lifecycle methods, especially in older codebases or when you require features that are not easily handled by functional components.
Comments
Admin Feb 3, 2020

A class component is used if we have to deal with state or lifecycle methods. Function components are preferred otherwise.

Ques:- What is React DOM Server?
Right Answer:
React DOM Server is a package in React that allows you to render React components on the server side, generating HTML content that can be sent to the client. This helps improve performance and SEO by delivering fully rendered pages to the browser.
Comments
Admin Feb 3, 2020

The React DOM Server object enables us to render components to static markup . This object is mostly used for server-side rendering (SSR). The below methods can be used in both the server and browser environments:
renderToString()
renderToStaticMarkup()

Ques:- What is SCALE in html meta tag?
Right Answer:
The SCALE in the HTML meta tag typically refers to the viewport settings for responsive design, specifically controlling the scaling of the webpage on mobile devices. It is often set using the `<meta name="viewport" content="width=device-width, initial-scale=1.0">` tag, where `initial-scale` defines the initial zoom level when the page is first loaded.
Ques:- how to run java script program
Right Answer:
To run a JavaScript program, you can:

1. Open a web browser (like Chrome or Firefox).
2. Press `F12` to open the Developer Tools.
3. Go to the "Console" tab.
4. Type or paste your JavaScript code and press `Enter` to execute it.

Alternatively, you can create an HTML file with a `<script>` tag containing your JavaScript code and open that file in a web browser.
Comments
Admin May 17, 2020

Java script programs can not be run directly.
Java script codes are embedded with HTML,PHP OR ASP where
these code run with program.

ConveGenius is a pioneering educational technology company committed to transforming learning experiences through innovative digital solutions. Founded in 2013 by Jairaj Bhattacharya and Shashank Pandey, ConveGenius aims to bridge educational gaps and enhance access to quality education for all. The company's flagship product, CG Slate, is a comprehensive educational tablet designed specifically for children, integrating curriculum-based learning with interactive features and engaging content. CG Slate provides personalized learning experiences tailored to individual student needs, fostering self-paced and enjoyable learning journeys. ConveGenius leverages cutting-edge technologies such as artificial intelligence, machine learning, and gamification to create immersive and effective learning environments. Their solutions are designed to complement traditional classroom instruction, empower educators, and inspire students to become lifelong learners. With a mission to democratize education, ConveGenius partners with governments, schools, and NGOs to reach underserved communities and address educational inequities. Through strategic collaborations and innovative initiatives, the company endeavors to make quality education accessible to every child, regardless of geographical location or socioeconomic background. Driven by a passion for innovation and social impact, ConveGenius continues to pioneer new approaches to education, empowering learners worldwide to unlock their full potential and build a brighter future.
AmbitionBox Logo

What makes Takluu valuable for interview preparation?

1 Lakh+
Companies
6 Lakh+
Interview Questions
50K+
Job Profiles
20K+
Users