Zeotap Internship Interview Experience | High Expectations | Bad Experience | Ghosted
Round 1
Questions:
Application 1: Rule Engine with AST
Objective:
Develop a simple 3-tier rule engine application (Simple UI, API and Backend, Data) to determine user eligibility based on attributes like age, department, income, spend, etc. The system can use an Abstract Syntax Tree (AST) to represent conditional rules and allow for dynamic creation, combination, and modification of these rules.
Data Structure:
- Define a data structure to represent the AST.
- The data structure should allow rule changes.
Example data structure could be a Node with the following fields:
type: String indicating the node type ("operator" for AND/OR, "operand" for conditions) left: Reference to another Node (left child) right: Reference to another Node (right child for operators) value: Optional value for operand nodes (e.g., number for comparisons)
Data Storage:
- Define the choice of database for storing the rules and application metadata.
- Define the schema with samples.
Sample Rules:
- rule1 = "((age > 30 AND department = 'Sales') OR (age < 25 AND department = 'Marketing')) AND (salary > 50000 OR experience > 5)"
- rule2 = "((age > 30 AND department = 'Marketing')) AND (salary > 20000 OR experience > 5)"
API Design:
- createrule(rulestring): Takes a string representing a rule and returns a Node object representing the AST.
- combine_rules(rules): Takes a list of rule strings, combines them into a single AST, and returns the root node of the combined AST.
- evaluate_rule(JSON data): Takes a JSON representing the combined rule's AST and a dictionary of attributes, evaluates the rule against the provided data, and returns True if the rule applies, False otherwise.
Test Cases:
- Create individual rules using create_rule and verify their AST.
- Combine rules using combine_rules and ensure the combined logic is accurate.
- Test evaluate_rule with sample JSON data for different scenarios.
- Combine additional rules and test functionality.
Bonus:
- Error handling for invalid rule strings or data formats.
- Validations for attributes as part of a catalog.
- Modification of existing rules within create_rule or separate functions.
- Extend the system for user-defined functions within the rule language.
Application 2: Real-Time Data Processing System for Weather Monitoring with Rollups and Aggregates
Objective:
Develop a real-time data processing system to monitor weather conditions and provide summarized insights using rollups and aggregates, using data from the OpenWeatherMap API.
Data Source: Continuously retrieve weather data from OpenWeatherMap API, focusing on:
- main: Main weather condition (e.g., Rain, Snow, Clear)
- temp: Current temperature in Centigrade
- feels_like: Perceived temperature in Centigrade
- dt: Time of data update (Unix timestamp)
Processing and Analysis:
The system should call the API at a configurable interval (e.g., every 5 minutes) to retrieve real-time weather data for Indian metro cities.
Convert temperature values from Kelvin to Celsius based on user preference.
Rollups and Aggregates:
- Daily Weather Summary: Calculate daily aggregates for average temperature, maximum temperature, minimum temperature, and dominant weather condition.
- Store daily summaries in a database for further analysis.
- Alerting Thresholds: Define user-configurable thresholds for temperature or specific weather conditions. Trigger alerts if thresholds are breached.
- Implement Visualizations: Display daily summaries, historical trends, and alerts.
Test Cases:
- Verify system startup and API connection.
- Simulate API calls and parse responses.
- Test temperature conversions based on user preferences.
- Simulate daily weather updates and verify summary calculations.
- Define thresholds, simulate weather breaches, and verify alert triggers.
Bonus:
- Extend the system to support additional weather parameters.
- Explore functionalities like weather forecasts retrieval and summaries based on predictions.
Evaluation: Criteria include functionality, correctness, efficiency, completeness of test cases, code clarity, and bonus feature implementation.
Artifacts to Submit:
- Codebase (GitHub preferred)
- Comprehensive README (with build instructions, dependencies, etc.)
Candidate's Approach
No approach provided.
Interviewer's Feedback
No feedback provided.