<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-KVGHS6G" height="0" width="0" style="display:none;visibility:hidden"></iframe>

Chime计算机科学面试真题

职位分类
全部
数据相关
计算机科学
人工智能
产品经理
BQ
面试题
全部(2)
OOD(0)
Algorithm(1)
System Design(0)
高频题(0)
Math(0)
全部(2)
OOD(0)
Algorithm(1)
System Design(0)
高频题(0)
Math(0)
1.Credit Card Transaction Processor
2.Credit Card Processor Problem
1. Credit Card Transaction Processor
Develop a program that simulates a credit card transaction system. The input is an array of strings, where each string is a command that is space-separated. The commands can be of the following types: - 'new': Followed by a credit card number and a credit limit. Validate the credit card number to ensure it has 12-16 digits. If valid, store this information. - 'credit' or 'debit': Followed by a credit card number and a transaction amount. Update the balance for the card accordingly. The output should be an array of strings formatted as 'credit card number balance'. Discard any transactions that would exceed the card's credit limit. Use a dictionary to track the credit limits and balances, initializing balances to zero. After processing, output the final balances for each card.
2. Credit Card Processor Problem
The interview question involves a classic problem related to a credit card processor. The candidate mentioned they were able to solve and run 17 out of 18 test cases successfully. The last test case was a bonus, which they did not have time to address.