{"id":25853830,"url":"https://github.com/shobhakartiwari/ios_coding_interview","last_synced_at":"2026-02-15T10:36:25.423Z","repository":{"id":265003686,"uuid":"894838370","full_name":"shobhakartiwari/iOS_Coding_Interview","owner":"shobhakartiwari","description":"A comprehensive collection of real-world technical interview questions and scenarios from leading technology companies. This repository helps developers prepare for coding rounds, system design interviews, and technical assessments.","archived":false,"fork":false,"pushed_at":"2024-11-27T05:49:38.000Z","size":9,"stargazers_count":10,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-20T09:46:22.290Z","etag":null,"topics":["app","coding-challenges","codingchallenges","interview","ios","mobile-app","tecnicaltest"],"latest_commit_sha":null,"homepage":"https://www.linkedin.com/in/shobhakar-tiwari/","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shobhakartiwari.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-11-27T04:54:38.000Z","updated_at":"2025-05-28T12:08:25.000Z","dependencies_parsed_at":"2024-12-01T20:01:38.977Z","dependency_job_id":null,"html_url":"https://github.com/shobhakartiwari/iOS_Coding_Interview","commit_stats":null,"previous_names":["shobhakartiwari/ios_coding_interview"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/shobhakartiwari/iOS_Coding_Interview","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shobhakartiwari%2FiOS_Coding_Interview","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shobhakartiwari%2FiOS_Coding_Interview/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shobhakartiwari%2FiOS_Coding_Interview/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shobhakartiwari%2FiOS_Coding_Interview/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shobhakartiwari","download_url":"https://codeload.github.com/shobhakartiwari/iOS_Coding_Interview/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shobhakartiwari%2FiOS_Coding_Interview/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29475757,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-15T10:25:47.032Z","status":"ssl_error","status_checked_at":"2026-02-15T10:25:01.815Z","response_time":118,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["app","coding-challenges","codingchallenges","interview","ios","mobile-app","tecnicaltest"],"created_at":"2025-03-01T15:20:00.099Z","updated_at":"2026-02-15T10:36:25.419Z","avatar_url":"https://github.com/shobhakartiwari.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🚀 Company-Wise iOS Technical Interview Questions  \n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://www.linkedin.com/in/shobhakar-tiwari/\"\u003ePrepared By: Shobhakar Tiwari\u003c/a\u003e\n\u003c/p\u003e\n\n- 🎓 Welcome, I’m Shobhakar Tiwari working in the USA 🇺🇸 and currently in the Central Standard Time Zone (CST).  I enjoy writing blogs on Medium, contributing to the iOS dev community, and sharing iOS interview questions to support junior and senior iOS developers alike.\n  \n- [If you preparing for iOS Interview feel free to connect for mentorship.](https://www.linkedin.com/in/shobhakar-tiwari/)\n\n- A comprehensive collection of real-world technical interview questions and scenarios from leading technology companies. This repository helps developers prepare for coding rounds, system design interviews, and technical assessments.\n\n## **Walmart Mock Interview Question**\n- [Walmart Interview Question](#walmart-interview-question)\n  - [Problem Statement](#problem-statement)\n  - [Technical Requirements](#technical-requirements)\n  - [Implementation Guide](#implementation-guide)\n  - [Code Solution](#code-solution)\n  - [Technical Deep Dive](#technical-deep-dive)\n\n### Problem Statement\n**Real-time ETA Tracking in Ride-Sharing Application**\n\nDesign and implement a feature for a ride-sharing application that displays real-time ETA (Estimated Time of Arrival) updates for drivers. The system must efficiently handle periodic network requests while maintaining optimal resource usage and user experience.\n\n### Technical Requirements\n1. Implement periodic ETA fetching (10-second intervals)\n2. Handle view lifecycle management\n3. Implement proper network request management\n4. Ensure thread-safe UI updates\n5. Implement memory leak prevention\n6. Handle error cases and network failures\n\n### Implementation Guide\n\n#### Architecture Components\n- **Timer System**: Manages periodic network requests\n- **Network Layer**: Handles API communication\n- **UI Layer**: Updates and manages view state\n- **Error Handling**: Implements retry mechanism with exponential backoff\n\n#### Key Considerations\n- Resource optimization during screen transitions\n- Thread safety in UI updates\n- Memory management\n- Network failure resilience\n\n### Code Solution\n\n```swift\nimport UIKit\n\nclass ETAViewController: UIViewController {\n    // MARK: - Properties\n    private var timer: Timer?\n    private let etaURL = URL(string: \"https://api.example.com/driver/eta\")!\n    \n    // MARK: - Lifecycle Methods\n    override func viewWillAppear(_ animated: Bool) {\n        super.viewWillAppear(animated)\n        startFetchingETA()\n    }\n    \n    override func viewWillDisappear(_ animated: Bool) {\n        super.viewWillDisappear(animated)\n        stopFetchingETA()\n    }\n    \n    // MARK: - Private Methods\n    private func startFetchingETA() {\n        timer = Timer.scheduledTimer(\n            timeInterval: 10.0,\n            target: self,\n            selector: #selector(fetchETA),\n            userInfo: nil,\n            repeats: true\n        )\n        timer?.fire()\n    }\n    \n    private func stopFetchingETA() {\n        timer?.invalidate()\n        timer = nil\n    }\n    \n    @objc private func fetchETA() {\n        let task = URLSession.shared.dataTask(with: etaURL) { [weak self] data, response, error in\n            guard let self = self else { return }\n            \n            if let error = error {\n                print(\"Failed to fetch ETA: \\(error)\")\n                return\n            }\n            \n            guard let data = data else { return }\n            if let eta = self.parseETA(from: data) {\n                DispatchQueue.main.async {\n                    self.updateUI(with: eta)\n                }\n            }\n        }\n        task.resume()\n    }\n    \n    private func parseETA(from data: Data) -\u003e String? {\n        return String(data: data, encoding: .utf8)\n    }\n    \n    private func updateUI(with eta: String) {\n        print(\"ETA Updated: \\(eta)\")\n    }\n}\n```\n\n### Technical Deep Dive\n\n#### 1. Network Failure Handling\nImplement an exponential backoff strategy for handling network failures:\n\n```swift\nprivate func retryRequest(after delay: TimeInterval) {\n    DispatchQueue.main.asyncAfter(deadline: .now() + delay) { [weak self] in\n        self?.fetchETA()\n    }\n}\n```\n\n#### 2. Thread Safety Implementation\nEnsure UI updates occur on the main thread:\n\n```swift\nDispatchQueue.main.async {\n    self.updateUI(with: eta)\n}\n```\n\n#### 3. Request Cancellation\nImplement proper request cancellation to prevent resource leaks:\n\n```swift\nprivate var currentTask: URLSessionDataTask?\n\n@objc private func fetchETA() {\n    currentTask?.cancel()\n    currentTask = URLSession.shared.dataTask(with: etaURL) { [weak self] data, response, error in\n        // Handle response\n    }\n    currentTask?.resume()\n}\n```\n\n## Contributing\nWe welcome contributions! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.\n\n## All rights @Shobhakar Tiwari\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshobhakartiwari%2Fios_coding_interview","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshobhakartiwari%2Fios_coding_interview","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshobhakartiwari%2Fios_coding_interview/lists"}