0% found this document useful (0 votes)
10 views2 pages

Python Developer Assignment Guide

Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views2 pages

Python Developer Assignment Guide

Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Python Developer Assignment

Thank you for applying! We are testing your ability to handle requirements ambiguity,
make independent decisions, and communicate proactively. Please complete at least
2-3 tasks from the list below, and create a Pull Request (PR) with your work. If you can
do additional tasks or attempt them, that’s even better. If you get stuck, push your
incomplete code to the PR. There is no time limit, but try to complete the tasks as soon
as possible. (4 days).

Have meaningful comments in commits and Pull requests,. Please reach out once you
complete fully with PR link in the mail.

Github link :: [Link]

Submission Guideline:: Please create a pull request against the above codebase, don’t
create a new repo or another fork in your account. Add you email id in you PR
comments. Your pull request should reflect here
[Link]

Task 1: Basic Setup and Simple Feature

1.​ Setup the development environment and run the application.


2.​ Add a new field to the Conversation model.
3.​ Implement functionality to automatically generate and store conversation
summaries.
4.​ Update the Django admin page to display the new field.

Task 2: Database Migration and Data Management

6.​ Migrate the database from SQLite to PostgreSQL.


7.​ Implement a management command to clean up old conversations.
8.​ Schedule the cleanup command to run periodically using Django’s crontab or
Celery.

Backend Intern Assignment​ ​ ​ ​ ​ ​ Soulpage IT Solutions Pvt. Ltd.


Task 3: API Development and Integration

8. Develop a new API endpoint to retrieve conversation summaries, ensuring it supports


pagination and filtering.

9.​ Develop a file upload endpoint.


●​ Implement a file duplication check to prevent multiple uploads of the
same file.
10.​Create an endpoint to list uploaded files with metadata.
11.​Implement file deletion functionality.

Task 4: Advanced Features

12. Add a new subpage for Retrieval-Augmented Generation (RAG) (Backend


implementation).

13.​Add a subpage for file uploads and processing (Backend implementation).


14.​Implement role-based access control for file upload and management endpoints.
15.​Develop a robust logging mechanism to track file uploads, deletions, and
accesses.
16.​Implement a caching mechanism to improve the performance of frequently
accessed conversation summaries.
17.​Create a comprehensive set of unit and integration tests for the new endpoints
and features.

Please ensure your code is well-documented and includes tests where applicable. If you
encounter any ambiguities or need clarifications, communicate proactively. We look
forward to seeing your solutions and how you approach these tasks. Good luck!

Backend Intern Assignment​ ​ ​ ​ ​ ​ Soulpage IT Solutions Pvt. Ltd.

Common questions

Powered by AI

Automatically generating and storing conversation summaries can significantly enhance data analysis efficiency by providing quick insights into conversation trends and topics. It reduces the time users spend on manually reviewing data and aids in identifying patterns, aiding strategic decision-making. Additionally, it improves the user experience by providing condensed information upfront, which can be crucial in time-constrained environments .

The assignment emphasizes handling ambiguity by allowing developers to manage their task selection process, deciding on the number of tasks (2-3 minimum) from a list, and dealing with the specifics of their implementation without detailed instructions . Independent decision-making is encouraged through the freedom to push incomplete code if they get stuck, and through proactive communication if ambiguities arise, reflecting scenarios where developers must navigate requirements without direct guidance .

Implementing a caching mechanism is important to improve performance and reduce load times by avoiding repetitive data processing and database queries. Methods could include using in-memory caches like Redis or Memcached, which provide quick access by storing data in RAM. Caching strategies like time-based expiry (TTL), lazy caching, and cache invalidation methods also help maintain data consistency and prevent stale data from being served .

To ensure efficiency, considerations should be made towards database query optimization, such as indexing fields used in filtering to speed up search queries, and efficiently handling pagination to prevent loading excessive data at once. For usability, ensuring the endpoint's parameters are intuitive and well-documented is crucial, as is providing clear error messages and possibly rate limiting to prevent abuse. Additionally, ensuring backward compatibility and comprehensive testing for edge cases would be necessary .

RBAC enhances security by ensuring that only authorized users can access certain endpoints, reducing the risk of unauthorized access. It also simplifies management by assigning roles rather than individual permissions. However, its implementation can be complex as it requires maintaining configuration over time, especially in dynamic environments with changing roles and responsibilities. Misconfigurations can lead to accidental permission oversights, either too much or too little access for some users .

A robust logging mechanism should include detailed log entries that capture timestamps, user actions, error details, and system statuses. Employing structured logging formats like JSON for machine-readability can enhance log analysis. Strategically using log levels (info, warning, error) can help in filtering relevant data. Integrating with centralized log management systems or cloud services like ELK Stack or Splunk helps in scalability and visualization. Ensuring logs are securely stored and comply with privacy regulations is also critical .

Developers can ensure file upload non-duplication by implementing checksum mechanisms (e.g., MD5, SHA-256) to generate unique hash values for files and comparing them before storing. Using file metadata and timestamps to identify potential duplicates through a pre-check process before file saving can further maintain efficiency. Integrating such checks through middleware or processing layers ensures that only unique files are stored .

When scheduling the cleanup of old conversations, consider load times to minimize disruption, scheduling during off-peak hours. Use Celery to handle asynchronous task execution, potentially distributing load across workers. Test cleanups in a staging environment to prevent data loss. Consider defining task failure handling mechanisms and retries for reliability. Using celery beat for periodic task scheduling can maintain system uptime and performance .

A developer might face challenges such as data type differences between SQLite and PostgreSQL, and the necessity to rewrite queries that are not compatible due to SQL dialect differences. Addressing these challenges requires careful planning of data types, understanding both database systems, and testing data integrity post-migration. Additionally, migrating third-party Django apps that might not support PostgreSQL natively could also pose problems, which can be addressed by checking compatibility or updating the apps where necessary .

Unit tests can be used to validate individual functions and methods for predictable outputs, ensuring code correctness at a granular level. Integration tests offer reliability by validating that different modules or systems work together as intended, simulating real-world user interactions. Implementing both types of tests provides broad coverage against code regressions and functional errors, ultimately making the system robustness .

You might also like