DMSi has a secure access room with a card reader on each side.

Overview

Interview - Card Reader

DMSi has a secure access room with a card reader on each side. You must scan to enter and scan to exit. However, we've been having some issues with access logs lately. It seems that while the card reader is permitting entry, it is dropping some logs. We need to determine if it is the fault of the reader or the fault of the individuals' proxy cards. In order to do so, we must identify which employees have a dropped log entry.

Our logs are formatted as an Array of scan record objects. Each log contains the employee name and the type of scan that was recorded, enter or exit.

[
  ScanRecord(employee: "Paul", scan: .ENTER),
  ScanRecord(employee: "Mary", scan: .ENTER),
  ScanRecord(employee: "Mary", scan: .EXIT),
  ScanRecord(employee: "Paul", scan: .ENTER),
  ScanRecord(employee: "Paul", scan: .EXIT)
];

We want to get a tuple where the first item is an Array of employee names whose entrances failed to log, and the second item is an Array of employee names whose exits failed to log.

public func getInvalidLogs(_ records: [ScanRecord]) -> ([String], [String]) {
    let missingEntries: [String] = []
    let missingExits: [String] = []
    return (missingEntries, missingExits)
}

An example would be the case of Paul this morning. He scanned into the room, presumably spent some time in there, and then left. However, his exit did not log.

[
  ScanRecord(employee: "Paul", scan: .ENTER),
  ScanRecord(employee: "Mary", scan: .ENTER),
  ScanRecord(employee: "Benedict", scan: .ENTER),
  ScanRecord(employee: "Mary", scan: .EXIT),
  ScanRecord(employee: "Benedict", scan: .EXIT)
];

Given this log, we would want to return a tuple that looks like this:

([], ["Paul"])

Importantly, the room is physically empty at the start and end of the day. So we can be certain that if a person's first entry is an exit or last entry is an enter that they are missing a log.

Since we are really just trying to debug a hardware problem, we don't need an exhaustive list of every missing log. Rather, we want a list of missing exits and missing entries where an employee appears only once in each list. If Paul has multiple missing entry logs, he should only appear once in the missingEntries Array. However, if he had a missing entry and a missing exit, he should appear once in both Arrays.

You might also like...
A fancy collection style view controller that was inspired by this Profile Card mockup
A fancy collection style view controller that was inspired by this Profile Card mockup

JFCardSelectionViewController A fancy collection style view controller that was inspired by this Profile Card mockup: https://dribbble.com/shots/14584

Easy to use cryptographic framework for data protection: secure messaging with forward secrecy and secure data storage. Has unified APIs across 14 platforms.
Easy to use cryptographic framework for data protection: secure messaging with forward secrecy and secure data storage. Has unified APIs across 14 platforms.

Themis provides strong, usable cryptography for busy people General purpose cryptographic library for storage and messaging for iOS (Swift, Obj-C), An

Easy to use cryptographic framework for data protection: secure messaging with forward secrecy and secure data storage. Has unified APIs across 14 platforms.
Easy to use cryptographic framework for data protection: secure messaging with forward secrecy and secure data storage. Has unified APIs across 14 platforms.

Themis provides strong, usable cryptography for busy people General purpose cryptographic library for storage and messaging for iOS (Swift, Obj-C), An

This is a repository with an app that shows a list of posts and where you can access the detail of each of them
This is a repository with an app that shows a list of posts and where you can access the detail of each of them

PostsApp This is a repository with an app that shows a list of posts and where you can access the detail of each of them Dependencies You need to inst

Cybr/Secure - A simple but powerful secure password generator
Cybr/Secure - A simple but powerful secure password generator

A simple but powerful secure password generator. You get the option of password length (10 to 20 characters) and whether you include numbers, symbols, uppercase and/or lowercase letters. Simply tap the lock icon to generate a secure password and then tap to copy the password.

Control Room : a macOS app that lets you control the simulators for iOS, tvOS, and watchOS
Control Room : a macOS app that lets you control the simulators for iOS, tvOS, and watchOS

Control Room is a macOS app that lets you control the simulators for iOS, tvOS, and watchOS – their UI appearance, status bar configuration, and more.

Music Room: a mobile app that offers a new way of experiencing music
Music Room: a mobile app that offers a new way of experiencing music

🎼 Music Room - 42 School Project 🎸 🤳🏻 Music Room is a mobile app that offers

ARInRoomISS - A minimal iOS AR app that displays the International Space Station (ISS) in the room
ARInRoomISS - A minimal iOS AR app that displays the International Space Station (ISS) in the room

A minimal iOS AR app to display the International Space Station (ISS) in the room.

Left Side Menu \ Side Bar with modern interface for iOS

SideMenu A customizable, interactive, auto expanding and collapsing side menu fo

A credit card reader and parser for iOS Using Native Vision/VisionKit

card-reader-ios A credit card reader and parser for iOS Using Native Vision/VisionKit May-14-2021.00-43-17.mp4 Instructions Hold camera up to a card a

card.io provides fast, easy credit card scanning in mobile apps
card.io provides fast, easy credit card scanning in mobile apps

card.io SDK for iOS card.io provides fast, easy credit card scanning in mobile apps. NEW!!! card.io is now an open-source project! As of December 2014

Swipe able, customizable card stack view, Tinder like card stack view based on UICollectionView. Cards UI
Swipe able, customizable card stack view, Tinder like card stack view based on UICollectionView. Cards UI

Swipable, customizable card stack view, Tinder like card stack view based on UICollectionView. Cards UI Сocoapods installation Add in your Podfile: po

Ios-card-transition - iOS CocoaPod to create beautiful card transitions
Ios-card-transition - iOS CocoaPod to create beautiful card transitions

CSCardTransition CSCardTransition is a small library allowing you to create wond

Card Decks is a small utility application for your iPhone, iPod touch and iPad which brings you simple, configurable, colored, multi-line text cards that are grouped into card decks

Card Decks is a small utility application for your iPhone, iPod touch and iPad which brings you simple, configurable, colored, multi-line text cards that are grouped into card decks.

SwiftUI-Card - Simple card ui designed using SwiftUI
SwiftUI-Card - Simple card ui designed using SwiftUI

SwiftUI - Card Simple card ui designed using SwiftUI Preview

IOS Card Game - A simple card game using SwiftUI
IOS Card Game - A simple card game using SwiftUI

IOS_Card_Game A simple card game using Swift UI.

Appstore card animation transition. UICollectionView and UITableView card expand animated transition
Appstore card animation transition. UICollectionView and UITableView card expand animated transition

Appstore card animation transition. UICollectionView and UITableView card expand animated transition. This library tries to add the appstore transition to your own app. The goal is to be as simple as possible to integrate in an app while keeping the flexibility and customization alive.

📱AutoLayout can be set differently for each device
📱AutoLayout can be set differently for each device

DeviceLayout DeviceLayout is a Swift framework that lets you set Auto Layout constraints's differently for each device Using only IBInspector of Xcode

All the reusable code that we need in each project

SwiftyUtils SwiftyUtils groups all the reusable code that we need to ship in each project. This framework contains: Extensions Protocols Structs Subcl

Owner
Hundter Biede
UNL Computer Science Student
Hundter Biede
iPad Comic reader based on ComicFLow

Overview Finally a comic reader for iPad done right! ComicFlow was designed with one goal in mind: providing the best experience for comic fans with l

Pablo Clemente Pérez 0 Dec 2, 2021
A free and open source xkcd comic reader for iOS.

A free, ad-free, open-source, native, and universal xkcd.com reader for iOS. Download it from the app store now! Architecture AFNetworking for network

Mike 249 Dec 12, 2022
Free and open source manga reader for iOS and iPadOS.

Aidoku A free and open source manga reading application for iOS and iPadOS. Features Ad free Robust WASM source system Online reading through external

null 421 Jan 2, 2023
A macOS menu bar app that enables system-wide navigation functionality for side buttons on third-party mice.

SaneSideButtons macOS mostly ignores the M4/M5 mouse buttons, commonly used for navigation. Third-party apps can bind them to ⌘+[ and ⌘+], but this on

Jan Hülsmann 121 Dec 23, 2022
The Git interface you've been missing all your life has finally arrived.

GitUp Work quickly, safely, and without headaches. The Git interface you've been missing all your life has finally arrived. Git recently celebrated it

GitUp 10.6k Jan 4, 2023
It's a pet project which has been developed as a code challenge

What is it ❓ It's a pet project which has been developed as a code challenge. It's written purely in Swift without using 3rd party frameworks. You can

iMamad 1 Apr 23, 2022
The most powerful Event-Driven Observer Pattern solution the Swift language has ever seen!

Event-Driven Swift Decoupling of discrete units of code contributes massively to the long-term maintainability of your project(s). While Observer Patt

Flowduino 4 Nov 14, 2022
🚀 Access my pull requests from the menu bar

OhMyPullRequests ?? Access my pull requests from menu bar. It lists pull requests that either: Someone requests you to review the pull request. Your p

Zihua Li 29 Jul 2, 2022
NetworkIcom - Project using Swift and SwiftUI to access Icom 7610 via Ethernet

Background This repository is an upload of a local Git repository from an Apple

Mark Erbaugh 9 Sep 25, 2022
Mi Card App for Android & IOS in Flutter

Mi Card Our Goal Now that you've seen how to create a Flutter app entirely from scratch, we're going to go further and learn more about how to design

Ruksar Ahmed 0 Nov 6, 2021