{"id":21730022,"url":"https://github.com/zororaka00/solidity-engineer-interview-test-code","last_synced_at":"2025-03-20T23:22:03.275Z","repository":{"id":264655085,"uuid":"893982552","full_name":"zororaka00/solidity-engineer-interview-test-code","owner":"zororaka00","description":"Tutorial Solidity Engineer Interview Test Code","archived":false,"fork":false,"pushed_at":"2024-11-25T15:02:09.000Z","size":3,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-25T20:08:25.987Z","etag":null,"topics":["code","human-resources","interview","solidity","test-code","tutorial"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zororaka00.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"zororaka00","patreon":"zororaka"}},"created_at":"2024-11-25T14:46:34.000Z","updated_at":"2024-11-25T15:02:39.000Z","dependencies_parsed_at":"2024-11-25T16:22:55.045Z","dependency_job_id":"9ffc03b1-c220-4399-93ae-d5235d1991a4","html_url":"https://github.com/zororaka00/solidity-engineer-interview-test-code","commit_stats":null,"previous_names":["zororaka00/solidity-engineer-interview-test-code"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zororaka00%2Fsolidity-engineer-interview-test-code","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zororaka00%2Fsolidity-engineer-interview-test-code/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zororaka00%2Fsolidity-engineer-interview-test-code/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zororaka00%2Fsolidity-engineer-interview-test-code/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zororaka00","download_url":"https://codeload.github.com/zororaka00/solidity-engineer-interview-test-code/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244706669,"owners_count":20496606,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["code","human-resources","interview","solidity","test-code","tutorial"],"created_at":"2024-11-26T04:11:17.580Z","updated_at":"2025-03-20T23:22:03.255Z","avatar_url":"https://github.com/zororaka00.png","language":null,"readme":"# Solidity Engineer Interview Tutorial\n\nWelcome to the interview tutorial for the **Solidity Engineer** position. This interview is divided into three sessions based on the candidate's experience level: **Junior**, **Middle**, and **Senior**. Each session contains both theory questions and practical coding tasks to be completed or optionally attempted by the candidate.\n\n## Reason for Creating This Repository\n\nI created this repository because I noticed that many HR professionals are often confused about the technical requirements and standards needed for the Solidity Engineer position. Therefore, I wanted to create a comprehensive and accessible resource to help both HR professionals and candidates understand what is expected during an interview.\n\n---\n\n## Interview Sessions\n\n### 1. **Junior Solidity Engineer**\n\n**Goal:** To test the candidate’s basic understanding of Solidity, smart contract structure, and ability to complete simple tasks.\n\n#### Theory Questions:\n- What is a smart contract in the context of blockchain? Explain how it works and its functions.\n- What are the differences between `public`, `internal`, and `private` modifiers in Solidity?\n- Explain what Gas is and how Gas works during transaction execution in Ethereum.\n- What are `require()` and `assert()` in Solidity? Explain the differences and their usage.\n\n#### Practical Tasks (Mandatory):\n1. Create a simple smart contract that allows users to store and retrieve an integer (`uint256`).\n   - Functions: `storeNumber(uint256 _number)` to store a number, and `getNumber()` to retrieve the stored number.\n   - **Unit Testing:** Write unit tests to verify that numbers can be stored and retrieved correctly.\n   - **Documentation:** Provide comments in your code explaining each function's purpose.\n\n2. Implement a function that allows users to reset the stored number to zero.\n   - Function: `resetNumber()`.\n   - **Unit Testing:** Write tests to ensure that the reset functionality works as expected.\n   - **Documentation:** Include explanations of how this function interacts with other functions.\n\n3. Add an event that logs when a number is stored.\n   - Event: `NumberStored(uint256 indexed _number)`.\n   - **Unit Testing:** Test that the event is emitted correctly when a number is stored.\n   - **Documentation:** Explain the significance of events in smart contracts.\n\n---\n\n### 2. **Middle Solidity Engineer**\n\n**Goal:** To assess the candidate’s deeper understanding of smart contracts, gas optimization, access control, and library usage.\n\n#### Theory Questions:\n- Explain the concept of **Inheritance** in Solidity and provide an example of its usage.\n- What is a **Reentrancy Attack** and how can it be prevented in smart contracts?\n- How is **Gas optimization** achieved in Solidity contracts? Provide tips and tricks to reduce gas consumption.\n- What is a **fallback function** and how is it used in a smart contract?\n\n#### Practical Tasks (Mandatory):\n1. Create a smart contract that stores balances in the form of **ERC20 tokens** using OpenZeppelin's ERC20 implementation. Allow users to transfer tokens and track their balances.\n   - Functions: `transfer(address _to, uint256 _amount)` and `balanceOf(address _account)`.\n   - **Unit Testing:** Write tests to verify correct token transfers and balance tracking.\n   - **Documentation:** Document each function's purpose and how it interacts with OpenZeppelin's ERC20 library.\n\n2. Implement a function that allows users to approve another address to spend tokens on their behalf using OpenZeppelin’s `approve` method.\n   - Function: `approve(address _spender, uint256 _amount)`.\n   - **Unit Testing:** Ensure that approval works correctly by testing various scenarios.\n   - **Documentation:** Explain how approvals work within ERC20 standards.\n\n3. Create a simple voting mechanism that allows token holders to vote on proposals where each vote is weighted by the amount of tokens held.\n   - Features: `vote(uint256 proposalId)` where each vote counts based on token balance.\n   - **Unit Testing:** Write tests to validate that votes are counted correctly based on token holdings.\n   - **Documentation:** Provide an overview of how voting rights are determined by token ownership.\n\n---\n\n### 3. **Senior Solidity Engineer**\n\n**Goal:** To evaluate the candidate’s ability to design complex smart contract systems, manage high-level security, and implement efficient patterns.\n\n#### Theory Questions:\n- What is **Delegatecall** and how does it work in smart contracts?\n- Explain how **Oracles** work in the Ethereum ecosystem and provide examples of their usage in smart contracts.\n- How can you implement **Upgradable Contracts** using the proxy pattern in Solidity?\n- What are the potential risks and challenges in creating smart contracts that interact with multiple other contracts in the blockchain ecosystem?\n\n#### Practical Tasks (Mandatory):\n1. Implement a **Crowdfunding** contract that allows users to fund a project with ERC20 tokens using OpenZeppelin's ERC20 library. Ensure that the contract validates whether the project has reached its funding target before funds can be withdrawn.\n   - Features: `contribute(uint256 _amount)`, `withdraw()`, and `getFundingStatus()`.\n   - **Unit Testing:** Write comprehensive tests for all functionalities, including contribution limits and withdrawal conditions.\n   - **Documentation:** Include detailed comments explaining each feature's logic and security considerations.\n\n2. Design a **Decentralized Autonomous Organization (DAO)** system that allows token holders to submit proposals and vote on them using OpenZeppelin's governance libraries.\n   - Features: Proposals can include changes to rules or token distribution. Each vote is weighted by token ownership, requiring quorum for approval.\n   - **Unit Testing:** Ensure all DAO functionalities work as intended through rigorous testing.\n   - **Documentation:** Provide insights into how governance works within your DAO design.\n\n3. Create an upgradable contract system using OpenZeppelin's proxy pattern that allows for future upgrades without losing state or data.\n   - Implement functions for upgrading logic while maintaining user data integrity.\n   - **Unit Testing:** Write tests to confirm that upgrades do not affect existing data or functionality.\n   - **Documentation:** Explain the proxy pattern's advantages for upgradability in your documentation.\n\n---\n\n## Submission Instructions\n\n- **Junior:** Submit your smart contract in `.sol` file format via email or GitHub repository along with unit tests and documentation.\n- **Middle:** Include a brief description of your approach for both mandatory tasks, unit tests, and documentation explaining your design choices.\n- **Senior:** Provide comprehensive documentation on your contract design, including security considerations, gas optimization strategies, unit test coverage, and explanations for each feature implemented.\n\nWe expect practical tasks to be completed within 2 to 4 hours. Please also provide explanations for your design choices during implementation.\n\n---\n\nGood luck! We look forward to reviewing your work and discussing your solutions further.","funding_links":["https://github.com/sponsors/zororaka00","https://patreon.com/zororaka"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzororaka00%2Fsolidity-engineer-interview-test-code","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzororaka00%2Fsolidity-engineer-interview-test-code","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzororaka00%2Fsolidity-engineer-interview-test-code/lists"}