{"id":533,"date":"2008-09-03T07:19:52","date_gmt":"2008-09-03T12:19:52","guid":{"rendered":"http:\/\/www.wiredprairie.us\/blog\/index.php\/archives\/533"},"modified":"2008-09-03T07:19:52","modified_gmt":"2008-09-03T12:19:52","slug":"coding-challenge-21-2","status":"publish","type":"post","link":"https:\/\/www.wiredprairie.us\/blog\/index.php\/archives\/533","title":{"rendered":"Coding Challenge #21"},"content":{"rendered":"
Coding Challenge Series<\/a> \/ Technical Interview Series<\/a><\/p>\n Create a function which copies byte data from a source location to a destination location (you might use pointers or an array depending on the programming language). The function must copy using this pattern: 8 bytes, skip 8 bytes, 4 bytes, skip 8 bytes, 8 bytes, … repeat (+8,-8,+4,-8….). <\/p>\n Bonus points for really nailing the performance of this one.<\/p>\n <\/p>\n (Are you enjoying this series? I’d appreciate a comment if you’d like me to continue the series. It takes more time than I’d like to admit to create and post these entries every week.)<\/p>\n","protected":false},"excerpt":{"rendered":" Coding Challenge Series \/ Technical Interview Series Create a function which copies byte data from a source location to a destination location (you might use pointers or an array depending on the programming language). The function must copy using this pattern: 8 bytes, skip 8 bytes, 4 bytes, skip 8 bytes, 8 bytes, … repeat […]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true},"categories":[4,10],"tags":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/pd5QIe-8B","jetpack_likes_enabled":true,"jetpack-related-posts":[{"id":532,"url":"https:\/\/www.wiredprairie.us\/blog\/index.php\/archives\/532","url_meta":{"origin":533,"position":0},"title":"Coding Challenge #22","date":"September 10, 2008","format":false,"excerpt":"Coding Challenge Series \/ Technical Interview Series Now that you've become an expert in efficiently copying bytes (you did solve the last challenge, didn't you?), I have an even more challenging question.... You have a large block of byte oriented data representing a 256-color LCD panel. Each byte represents the\u2026","rel":"","context":"In "Coding"","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":449,"url":"https:\/\/www.wiredprairie.us\/blog\/index.php\/archives\/449","url_meta":{"origin":533,"position":1},"title":"Coding Challenge #17","date":"August 6, 2008","format":false,"excerpt":"Coding Challenge Series \/ Technical Interview Series You are writing code for an embedded system. There are some restrictions on memory and I\/O that you must follow. Your challenge is to create a file search function. The function is provided an ASCII string and the name of the file. The\u2026","rel":"","context":"In "Coding"","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":473,"url":"https:\/\/www.wiredprairie.us\/blog\/index.php\/archives\/473","url_meta":{"origin":533,"position":2},"title":"Coding Challenge #19","date":"August 20, 2008","format":false,"excerpt":"Coding Challenge Series \/ Technical Interview Series I have 4 bytes (a double-word) represented in little-endian format. Each byte contains the usual 8 bits. Write the function necessary the individual bits on a console screen as 1s or 0s -- as one giant bit string (which properly represents the total\u2026","rel":"","context":"In "Interview"","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":395,"url":"https:\/\/www.wiredprairie.us\/blog\/index.php\/archives\/395","url_meta":{"origin":533,"position":3},"title":"Coding Challenge #12","date":"July 2, 2008","format":false,"excerpt":"Coding Challenge Series \/ Technical Interview Series Decode a HTML URL encoded string. A URL encoded string is a series of characters, where the sequence %## is a single byte hex encoded character. Hi%20there! becomes Hi there! Do not use any standard function for hex or decoding functions that may\u2026","rel":"","context":"In "Interview"","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":659,"url":"https:\/\/www.wiredprairie.us\/blog\/index.php\/archives\/659","url_meta":{"origin":533,"position":4},"title":"ColorConverter for Silverlight","date":"January 17, 2009","format":false,"excerpt":"Silverlight 2.0 is missing a ColorConverter. There\u2019s no easy and efficient way from code to convert from a HEX color format to a built in Color type. I like being able to paste standard web color formats into my source code without converting them to a Color.FromArgb byte format (as\u2026","rel":"","context":"In "Coding"","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":429,"url":"https:\/\/www.wiredprairie.us\/blog\/index.php\/archives\/429","url_meta":{"origin":533,"position":5},"title":"Coding Challenge #15","date":"July 23, 2008","format":false,"excerpt":"Coding Challenge Series \/ Technical Interview Series Create a structure which represents a binary tree. Iterate through all of the elements of the tree in any order, without using recursion. Update: Your function is only provided the root of the constructed tree. A tree node should contain no more than\u2026","rel":"","context":"In "Interview"","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"https:\/\/www.wiredprairie.us\/blog\/index.php\/wpjson\/wp\/v2\/posts\/533"}],"collection":[{"href":"https:\/\/www.wiredprairie.us\/blog\/index.php\/wpjson\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wiredprairie.us\/blog\/index.php\/wpjson\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wiredprairie.us\/blog\/index.php\/wpjson\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wiredprairie.us\/blog\/index.php\/wpjson\/wp\/v2\/comments?post=533"}],"version-history":[{"count":0,"href":"https:\/\/www.wiredprairie.us\/blog\/index.php\/wpjson\/wp\/v2\/posts\/533\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wiredprairie.us\/blog\/index.php\/wpjson\/wp\/v2\/media?parent=533"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wiredprairie.us\/blog\/index.php\/wpjson\/wp\/v2\/categories?post=533"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wiredprairie.us\/blog\/index.php\/wpjson\/wp\/v2\/tags?post=533"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}